rpm -F和rpm -U有什么区别?

时间:2016-06-08 10:18:43

标签: unix rpm

我正在浏览rpm的手册页,但可以得到rpm -Frpm -U之间的确切差异。
有人可以帮我解决这个问题吗?

1 个答案:

答案 0 :(得分:3)

-F|--freshen仅安装已安装在系统上的软件包的更新。所以

rpm -U already-installed-package.2.0.rpm
rpm -F already-installed-package.2.0.rpm

是等价的,但是

rpm -U not-installed-package.2.0.rpm # will install
rpm -F not-installed-package.2.0.rpm # won't install

不是。

来自手册页:

  

rpm {-U | --upgrade} [install-options] PACKAGE_FILE ...

   This upgrades or installs the package currently installed to a newer version.  This is the same as install, except all other
     在新软件包发布后,将删除软件包的

版本   安装。

   rpm {-F|--freshen} [install-options] PACKAGE_FILE ...

   This will upgrade packages, but only ones for which an earlier version is installed.