2017-08-16 40 views
0

我想做没有网络的yum更新。如何安装本地rpms accroding包依赖项

两个阶段:

第一步,网络连接的计算机上下载软件包:

yum update --downloadonly --downloaddir=/local-dir 

第二步,非网络的计算机上安装下载的软件包:

rpm -ivh /local-dir/* 

而是一步两个将失败,出现错误,那么/local-dir中存在失败的依赖关系,但rpm不会自动检测到它。

error: Failed dependencies: 
     selinux-policy < 3.13.1-89 conflicts with firewalld-0.4.3.2-8.1.el7_3.3.noarch 
     NetworkManager < 1:1.4.0-3.el7 conflicts with firewalld-0.4.3.2-8.1.el7_3.3.noarch 
     firewalld < 0.3.13 conflicts with firewalld-filesystem-0.4.3.2-8.1.el7_3.3.noarch 
     systemd < 219-20 conflicts with libselinux-2.5-6.el7.x86_64 
     selinux-policy-base < 3.13.1-66 conflicts with libsemanage-2.5-5.1.el7_3.x86_64 
     selinux-policy < 3.13.1-92 conflicts with openssh-6.6.1p1-35.el7_3.x86_64 
     firewalld < 0.3.14 conflicts with python-firewall-0.4.3.2-8.1.el7_3.3.noarch 
+1

你真的要安装所有RPM的你下载?可能不会。你可能想考虑创建一个当地的YUM回购。你需要安装'createrepo',你可以谷歌其余。 –

+0

不,我的原始目标是'我想做没有网络的yum更新',我认为'createrepo'是存档我的目标的更好方法。非常感谢@RedCricket –

回答

0

使用rpm -Uvvh /local-dir/*

{-U|-upgrade} This upgrades or installs the package currently installed 
    to a newer version. This is the same as install, 
    except all other version(s) of the package are 
    removed after the new package is installed.