1-3 安装、升级、卸载RPM包

2016.6.4



一、安装、升级RPM软件

1.格式:

  • rpm [选项] RPM包文件...

2.用法:

-i:安装一个新的rpm软件包


-U:升级,若未安装,则进行安装


-h:以“#”号显示安装的进度

-h, --hash

          Print 50 hash marks as the package archive is unpacked.  Use with  -v|--verbose
          for a nicer display.

-v:显示安装过程中的详细信息

-v

Print  verbose  information  -  normally routine progress messages will be dis-
          played.

-F:更新某个rpm软件,若未安装,则放弃安装

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

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


INSTALLING, UPGRADING, AND REMOVING PACKAGES:

   rpm {-i|--install} [install-options] PACKAGE_FILE ...

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

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

   rpm {-e|--erase} [--allmatches] [--nodeps] [--noscripts]
       [--notriggers] [--test] PACKAGE_NAME ...

--force:强制安装所有指定的rpm软件包

--force

          Same as using --replacepkgs, --replacefiles, and --oldpackage.

--replacepkgs

          Install the packages even if some of them are already installed on this system.




二、卸载RPM软件

1.格式:rpm -e 软件名

2.辅助选项:

  • --nodeps:安装、升级或卸载软件时,忽略依赖关系

--nodeps

          Don’t check dependencies before uninstalling the packages.




三、解决软件包依赖关系

1.安装依赖关系的多个软件时

  • 被依赖的软件包需要先安装

  • 可同时指定多个.rpm包文件进行安装

2.卸载有依赖关系的多个软件时

  • 被依赖的软件包需要先安装依赖其他程序的软件包需要先卸载

  • 被依赖的软件包需要先安装可同时指定多个软件名进行卸载

3.忽略依赖关系

  • 被依赖的软件包需要先安装结合“--nodeps”选项,但可能导致软件异常




四、维护RPM数据库

重建RPM数据库

rpm --rebuilddb

rpm --initdb



results matching ""

    No results matching ""