![yumdownloader 无法解决依赖关系?](https://linux22.com/image/721784/yumdownloader%20%E6%97%A0%E6%B3%95%E8%A7%A3%E5%86%B3%E4%BE%9D%E8%B5%96%E5%85%B3%E7%B3%BB%EF%BC%9F.png)
根据yum下载器:
--resolve
When downloading RPMs, resolve dependencies and also download the required packages.
然而,当我尝试时:
$ sudo yumdownloader devtoolset-7-gcc-c++.x86_64 --destdir /opt/downloaded_rpms/ --resolve
它没有下载依赖项:
$ ll /opt/downloaded_rpms/
total 11644
-rw-r--r-- 1 root root 11683460 Dec 25 17:10 devtoolset-7-gcc-c++-7.2.1-1.el7.sc1.x86_64.rpm
因此,当我尝试安装时,它抱怨道:
# sudo yum install /tmp/devtoolset-7-gcc-c++-7.2.1-1.el7.sc1.x86_64.rpm
Loaded plugins: fastestmirror
Examining /tmp/devtoolset-7-gcc-c++-7.2.1-1.el7.sc1.x86_64.rpm: devtoolset-7-gcc-c++-7.2.1-1.el7.sc1.x86_64
Marking /tmp/devtoolset-7-gcc-c++-7.2.1-1.el7.sc1.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package devtoolset-7-gcc-c++.x86_64 0:7.2.1-1.el7.sc1 will be installed
--> Processing Dependency: devtoolset-7-gcc = 7.2.1-1.el7.sc1 for package: devtoolset-7-gcc-c++-7.2.1-1.el7.sc1.x86_64
...
...
--> Processing Dependency: devtoolset-7-libstdc++-devel = 7.2.1-1.el7.sc1 for package: devtoolset-7-gcc-c++-7.2.1-1.el7.sc1.x86_64
--> Processing Dependency: devtoolset-7-runtime for package: devtoolset-7-gcc-c++-7.2.1-1.el7.sc1.x86_64
--> Finished Dependency Resolution
Error: Package: devtoolset-7-gcc-c++-7.2.1-1.el7.sc1.x86_64 (/devtoolset-7-gcc-c++-7.2.1-1.el7.sc1.x86_64)
Requires: devtoolset-7-gcc = 7.2.1-1.el7.sc1
Error: Package: devtoolset-7-gcc-c++-7.2.1-1.el7.sc1.x86_64 (/devtoolset-7-gcc-c++-7.2.1-1.el7.sc1.x86_64)
Requires: devtoolset-7-libstdc++-devel = 7.2.1-1.el7.sc1
Error: Package: devtoolset-7-gcc-c++-7.2.1-1.el7.sc1.x86_64 (/devtoolset-7-gcc-c++-7.2.1-1.el7.sc1.x86_64)
Requires: devtoolset-7-runtime
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
我做错什么了吗?
谢谢!
答案1
根据 Red Hat错误 1152326:
...这是依赖项已安装时的预期行为。
yumdownloader --resolve
将仅下载缺少的依赖项。您可以使用空的installroot
来下载包及其所有依赖项:# yumdownloader NAME --resolve --installroot=/path/to/installroot --releasever=/