Linux dependency packages refer to "library files". Most dependency packages are library files, including dynamic libraries and static libraries. Linux systems, like other operating systems, are modular in design, that is It is said that functions depend on each other, and some functions require other functions to support them, which can improve the reusability of the code.
#The operating environment of this tutorial: linux5.9.8 system, Dell G3 computer.
What is a dependency package? Why download dependency packages?
Linux systems, like other operating systems, are modular in design, which means that functions depend on each other, and some functions require other functions to support them, which can improve the reusability of the code:
Most of the dependency packages are some library files, including dynamic libraries and static libraries. If the dependency packages of a program are not installed, and only the program itself is installed, it cannot be used.
You can understand it as Like windows library files, such as DLL
For example, if I want to install a certain software, this software depends on a certain development package. This development package contains the environment files for the software to run. This is the dependency relationship.
For another example, let’s say I want to go to Youku to watch videos.
I just need to install flash. Because Youku's player is developed based on flash.
How to query the dependency packages required by the package I want to install?
At this time, you have to use a very common command, that is rpm or yum.
How to query?
1. Query through rpm
[root@testvm02 ~]# rpm -q ghostscript #查看对应的rpm包. ghostscript-8.70-19.el6.x86_64 [root@testvm02 ~]# rpm -qR ghostscript #R的意思就是requires就是依赖哪些软件包.
/bin/sh /sbin/ldconfig /sbin/ldconfig config(ghostscript) = 8.70-19.el6 ghostscript-fonts libICE.so.6()(64bit) libSM.so.6()(64bit) libX11.so.6()(64bit) libXext.so.6()(64bit) libXt.so.6()(64bit) libc.so.6()(64bit) libc.so.6(GLIBC_2.11)(64bit) libc.so.6(GLIBC_2.2.5)(64bit) libc.so.6(GLIBC_2.3)(64bit) libc.so.6(GLIBC_2.3.4)(64bit) libc.so.6(GLIBC_2.4)(64bit) libc.so.6(GLIBC_2.7)(64bit) libcairo.so.2()(64bit) libcom_err.so.2()(64bit) libcrypt.so.1()(64bit) libcups.so.2()(64bit) libcupsimage.so.2()(64bit) libdl.so.2()(64bit) libdl.so.2(GLIBC_2.2.5)(64bit) libfontconfig.so.1()(64bit) libgs.so.8()(64bit) libgssapi_krb5.so.2()(64bit)
Note: The above query is the dependent software package.
2. Query the dependent program through yum
[root@testvm02 ~]# yum deplist ghostscript
Loaded plugins: product-id, subscription-manager This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. Finding dependencies: package: ghostscript.i686 8.70-19.el6 dependency: libc.so.6(GLIBC_2.11) #依赖的库或者程序 provider: glibc.i686 2.12-1.149.el6 #这个库是通过哪个rpm包安装的. dependency: libXext.so.6 provider: libXext.i686 1.3.2-2.1.el6 dependency: libpng12.so.0 provider: libpng.i686 2:1.2.49-1.el6_2 dependency: libpng12.so.0(PNG12_0) provider: libpng.i686 2:1.2.49-1.el6_2 dependency: libpthread.so.0(GLIBC_2.1) provider: glibc.i686 2.12-1.149.el6 dependency: libdl.so.2 provider: glibc.i686 2.12-1.149.el6
3. Check which software this software depends on (that is, if I want to delete it, which software will have an impact on the operation)
[root@testvm02 ~]# rpm -q nfs-utils #查看这个软件是否安装. nfs-utils-1.2.3-54.el6.x86_64 [root@testvm02 ~]# rpm -e --test nfs-utils #通过--test进行测试删除,查看是否有依赖关系,如果有会阻止删除.测试是否能够删除. error: Failed dependencies: nfs-utils >= 1.2.1-11 is needed by (installed) nfs-utils-lib-1.1.5-9.el6.x86_64 #有其他的软件包依赖这个软件包,如果删除可能对这个程序有影响. [root@testvm02 ~]# rpm -e --test nfs-utils error: Failed dependencies: nfs-utils >= 1.2.1-11 is needed by (installed) nfs-utils-lib-1.1.5-9.el6.x86_64 [root@testvm02 ~]# rpm -e --test gcc #测试删除gcc,没有报错,也就是没有别的地方依赖它,可以进行删除. [root@testvm02 ~]# rpm -q gcc #上面的--test并没有真正删除 gcc-4.4.7-11.el6.x86_64 [root@testvm02 ~]# rpm -e gcc #不带--test参数,进行真正的删除. [root@testvm02 ~]# rpm -q gcc #再次查询没有这个gcc已经被删除掉了. package gcc is not installed
Related recommendations: "Linux Video Tutorial"
The above is the detailed content of What are linux dependency packages. For more information, please follow other related articles on the PHP Chinese website!