Читать книгу Mastering Linux System Administration - Richard Blum - Страница 102
Handling Broken Dependencies
ОглавлениеSometimes as multiple software packages get loaded, a software dependency for one package can get overwritten by the installation of another package. This is called a broken dependency.
If this should happen on your system, first try the following command:
dnf clean all
Then try to use the upgrade
option in the dnf
command. Sometimes, just cleaning up any misplaced files can help.
If that doesn't solve the problem, try the following command:
dnf repoquery --deplist package_name
This command displays all the package's library dependencies and what software package provides them. Once you know the libraries required for a package, you can then install them. Here's an example of determining the dependencies for the zsh package:
# dnf repoquery --deplist zsh CentOS Linux 8 - AppStream 1.3 MB/s | 6.2 MB 00:04 CentOS Linux 8 - BaseOS 867 kB/s | 2.3 MB 00:02 package: zsh-5.5.1-6.el8_1.2.x86_64 dependency: /bin/sh provider: bash-4.4.19-12.el8.x86_64 dependency: coreutils provider: coreutils-8.30-8.el8.x86_64 dependency: grep provider: grep-3.1-6.el8.x86_64 dependency: info provider: info-6.5-6.el8.x86_64 dependency: libc.so.6(GLIBC_2.15)(64bit) provider: glibc-2.28-127.el8.x86_64 dependency: libdl.so.2()(64bit) provider: glibc-2.28-127.el8.x86_64 dependency: libdl.so.2(GLIBC_2.2.5)(64bit) provider: glibc-2.28-127.el8.x86_64 dependency: libgdbm.so.6()(64bit) provider: gdbm-libs-1:1.18-1.el8.x86_64 dependency: libm.so.6()(64bit) provider: glibc-2.28-127.el8.x86_64 dependency: libm.so.6(GLIBC_2.2.5)(64bit) provider: glibc-2.28-127.el8.x86_64 dependency: libm.so.6(GLIBC_2.23)(64bit) provider: glibc-2.28-127.el8.x86_64 dependency: libncursesw.so.6()(64bit) provider: ncurses-libs-6.1-7.20180224.el8.x86_64 dependency: libpcre.so.1()(64bit) provider: pcre-8.42-4.el8.x86_64 dependency: librt.so.1()(64bit) provider: glibc-2.28-127.el8.x86_64 dependency: librt.so.1(GLIBC_2.2.5)(64bit) provider: glibc-2.28-127.el8.x86_64 dependency: libtinfo.so.6()(64bit) provider: ncurses-libs-6.1-7.20180224.el8.x86_64 dependency: rtld(GNU_HASH) provider: glibc-2.28-127.el8.i686 provider: glibc-2.28-127.el8.x86_64 #
As you can see from the output, there are lots of different packages that must be installed for the Z shell to work properly. Good thing dnf
ensured they were all installed for us!