rpm与yum
rpm包的管理
rpm包的简单查询指令
查询已安装的rpm列表:rpm -qa|grep xx
[root@CentOS01 ~]# rpm -qa | grep sql
sqlite-3.7.17-8.el7_7.1.x86_64
查询指定包的详细安装信息:rpm -qi xx
[root@CentOS01 ~]# rpm -qi sqlite
Name : sqlite
Version : 3.7.17
Release : 8.el7_7.1
Architecture: x86_64
Install Date: Thu 27 Jan 2022 04:12:35 AM CST
Group : Applications/Databases
Size : 814303
License : Public Domain
Signature : RSA/SHA256, Wed 29 Jan 2020 12:54:30 AM CST, Key ID 24c6a8a7f4a80eb5
Source RPM : sqlite-3.7.17-8.el7_7.1.src.rpm
Build Date : Tue 28 Jan 2020 10:29:47 PM CST
Build Host : x86-01.bsys.centos.org
Relocations : (not relocatable)
Packager : CentOS BuildSystem <http://bugs.centos.org>
Vendor : CentOS
URL : http://www.sqlite.org/
Summary : Library that implements an embeddable SQL database engine
查询指定包安装后产生的文件:rpm -ql xx
[root@CentOS01 ~]# rpm -ql sqlite
/usr/bin/sqlite3
/usr/lib64/libsqlite3.so.0
/usr/lib64/libsqlite3.so.0.8.6
/usr/share/doc/sqlite-3.7.17
/usr/share/doc/sqlite-3.7.17/README
/usr/share/man/man1/sqlite3.1.gz
查询指定文件属于哪一个rpm包:rpm -qf xx
[root@CentOS01 /]# rpm -qf /etc/passwd
setup-2.8.71-11.el7.noarch
rpm包安装卸载
卸载rpm包:rpm -e xx
rpm -e sqlite
#强制卸载
rpm -e --nodeps sqlite
安装rpm包:rpm -ivh RPM包全路径名称
- i=install 安装
- v=verbose 提示
- h=hash 进度条
yum
基本指令
查询yum服务器是否有需要安装的软件
yum list | grep xx软件
[root@CentOS01 /]# yum list | grep firefox
firefox.i686 91.8.0-1.el7.centos updates
firefox.x86_64 91.8.0-1.el7.centos updates
firefox-noscript.noarch 11.0.3-3.el7 epel
firefox-pkcs11-loader.x86_64 3.13.6-1.el7 epel epel
yum反查
yum provides 关键词
安装指定yum包
yum install xxx
[root@CentOS01 /]# yum install firefox-pkcs11-loader.x86_64