linux rpm 没有返回,容易忘记的linux命令之rpm
1 rpm軟件包管理方式
也許現實中yum簡單方便,但是有時候我們也還會用rpm包,yum用的也是rpm包,從安裝,查詢,卸載,升級多方面記住,當然還是多多實踐才能記住。
NAME
rpm - RPM Package Manager
2 常用的命令,man文檔好長
①安裝
rpm -ivh PACKAGENAME
-i 安裝install的意思
-h, --hash ?Print 50 hash marks as the package archive is unpacked. ?Use with -v|--verbose for a nicer display.顯示50個#來標示當前安裝進度
-v ?Print verbose information - normally routine progress messages will be displayed. ? ? ? ? ? 顯示冗余信息
--nodeps Don’t do a dependency check before installing or upgrading a package.
不會在安裝或升級前進行依賴檢測
--replacepkgs Install the packages even if some of them are already installed on this system. ?覆蓋安裝
--force Same as using --replacepkgs, --replacefiles, and --oldpackage.
--test Do not install the package, simply check for and report potential conflicts.
測試是否能安裝,實際不安裝
②查詢
-q PACKAGENAME
[root@www ~]# rpm -q ?pidgin
pidgin-2.7.9-27.el6.x86_64
-qa 查詢所有的已經安裝的包,通常配合grep使用
[root@www ~]# rpm -qa|grep openssh
openssh-askpass-5.3p1-84.1.el6.x86_64
openssh-clients-5.3p1-84.1.el6.x86_64
openssh-5.3p1-84.1.el6.x86_64
openssh-server-5.3p1-84.1.el6.x86_64
-qi 顯示安裝包相關的信息
[root@www ~]# rpm -qi ?pidgin
Name ? ? ? ?: pidgin ? ? ? ? ? ? ? ? ? ? ? Relocations: (not relocatable)
Version 主版本 ?: 2.7.9 ? ? ? ? ? ? ? ? ? ? ? ? ? ? Vendor(供應商): CentOS
Release ? ? : 27.el6 ? ? ? ? ? ? ? ? ? ? ? ?Build Date: Thu 06 Feb 2014 02:17:15 AM CST
Install Date: Thu 23 Apr 2015 07:51:37 PM CST ? ? ?Build Host: c6b10.bsys.dev.centos.org
Group ? ? ? : Applications/Internet ? ? ? ? Source RPM: pidgin-2.7.9-27.el6.src.rpm
Size ? ? ? ?: 3142033 ? ? ? ? ? ? ? ? ? ? ? ? ?License: GPLv2+ and GPLv2 and MIT
Signature ? : RSA/SHA1, Thu 06 Feb 2014 03:43:36 AM CST, Key ID 0946fca2c105b9de
Packager ? ?: CentOS BuildSystem
URL ? ? ? ? : http://pidgin.im/
Summary ? ? : A Gtk+ based multiprotocol instant messaging client
Description :
...省略...
-ql 安裝軟件后的文件生成列表
[root@www ~]# rpm -ql openssh
/etc/ssh
/etc/ssh/moduli
/usr/bin/ssh-keygen
/usr/libexec/openssh
/usr/libexec/openssh/ssh-keysign
/usr/share/doc/openssh-5.3p1
/usr/share/doc/openssh-5.3p1/CREDITS
/usr/share/doc/openssh-5.3p1/ChangeLog
/usr/share/doc/openssh-5.3p1/INSTALL
/usr/share/doc/openssh-5.3p1/LICENCE證書
/usr/share/doc/openssh-5.3p1/OVERVIEW
/usr/share/doc/openssh-5.3p1/PROTOCOL
/usr/share/doc/openssh-5.3p1/PROTOCOL.agent
/usr/share/doc/openssh-5.3p1/README安裝文檔說明
/usr/share/doc/openssh-5.3p1/README.dns
/usr/share/doc/openssh-5.3p1/README.nss
/usr/share/doc/openssh-5.3p1/README.platform
/usr/share/doc/openssh-5.3p1/README.privsep
/usr/share/doc/openssh-5.3p1/README.smartcard
/usr/share/doc/openssh-5.3p1/README.tun
/usr/share/doc/openssh-5.3p1/TODO
/usr/share/doc/openssh-5.3p1/WARNING.RNG
/usr/share/man/man1/ssh-keygen.1.gz
/usr/share/man/man8/ssh-keysign.8.gz
-qf查詢某個文件對應的安裝包,通常可以看執行文件的安裝包
[root@www ~]# rpm -qf /usr/sbin/sshd
openssh-server-5.3p1-84.1.el6.x86_64
注意幾個常用的rpm -qf `which 程序名` 返回軟件包的全名
rpm -qif `which 程序名` 返回軟件包的有關信息
rpm -qlf `which 程序名` 返回軟件包的文件列表
根據file查詢i l 或者軟件包名
③升級、降級
rpm -Uvh /PATH/TO/NEW_PACKAGE有老版本則升級,否則就安裝
適合安裝包
rpm -Fvh /PATH/TO/NEW_PACKAGE有老版本則升級,沒有就退出 ? 智能升級
適合升級包
降級:
rpm -ivh --oldpackage PACKAGENAME
④卸載
rpm -e PACKAGE_NAME 注意依賴性
--nodeps
總結
以上是生活随笔為你收集整理的linux rpm 没有返回,容易忘记的linux命令之rpm的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: stm32mp1安装linux系统,st
- 下一篇: linux fpga通信,基于Linux