rpm说明
rpm -qa :列出所有已安装的软件包[root@hub ~] rpm -qa
geoipupdate-2.5.0-1.el7.x86_64
ncurses-base-5.9-14.20130511.el7_4.noarch
libndp-1.2-9.el7.x86_64
libfastjson-0.99.4-3.el7.x86_64。。。rpm -qf FILENAME :查找提供 FILENAME 的软件包[root@hub /usr/bin] rpm -qf yum
yum-3.4.3-168.el7.centos.noarchrpm -q :列出当前安装的软件包的版本[root@hub /usr/bin] rpm -q yum
yum-3.4.3-168.el7.centos.noarchrpm -qi:获取有关软件包的详细信息[root@hub /usr/bin] rpm -qi yum
Name : yum
Version : 3.4.3
Release : 168.el7.centos
Architecture: noarch
Install Date: Mon 27 Mar 2023 10:53:36 AM CST
Group : System Environment/Base
Size : 5829237
License : GPLv2+
Signature : RSA/SHA256, Thu 15 Oct 2020 03:21:12 AM CST, Key ID 24c6a8a7f4a80eb5
Source RPM : yum-3.4.3-168.el7.centos.src.rpm
Build Date : Fri 02 Oct 2020 01:03:49 AM CST
Build Host : x86-02.bsys.centos.org
Relocations : (not relocatable)
Packager : CentOS BuildSystem <http://bugs.centos.org>
Vendor : CentOS
URL : http://yum.baseurl.org/
Summary : RPM package installer/updater/manager
Description :
Yum is a utility that can check for and automatically download and
install updated RPM packages. Dependencies are obtained and downloaded
automatically, prompting the user for permission as necessary.rpm -ql:列出软件包安装的⽂件[root@hub /usr/bin] rpm -ql yum
/etc/logrotate.d/yum
/etc/yum
/etc/yum.conf
/etc/yum.repos.d
/etc/yum/fssnap.d
/etc/yum/pluginconf.d
/etc/yum/protected.d
/etc/yum/vars
/etc/yum/version-groups.conf
/usr/bin/yum。。。rpm -qc :仅列出软件包安装的配置⽂件[root@hub /usr/bin] rpm -qc yum
/etc/logrotate.d/yum
/etc/yum.conf
/etc/yum/version-groups.confrpm -qd :仅列出软件包安装的⽂档⽂件[root@hub /usr/bin] rpm -qd yum
/usr/share/doc/yum-3.4.3/AUTHORS
/usr/share/doc/yum-3.4.3/COPYING
/usr/share/doc/yum-3.4.3/ChangeLog
/usr/share/doc/yum-3.4.3/INSTALL
/usr/share/doc/yum-3.4.3/PLUGINS
/usr/share/doc/yum-3.4.3/README
/usr/share/doc/yum-3.4.3/TODO
/usr/share/doc/yum-3.4.3/comps.rng
/usr/share/man/man5/yum.conf.5
/usr/share/man/man8/yum-shell.8
/usr/share/man/man8/yum.8rpm -q --changelog :列出软件包的更改信息[root@hub /usr/bin] rpm -q --changelog yum
* Tue Sep 29 2020 CentOS Sources <bugs@centos.org> - 3.4.3-168.el7.centos
- CentOS yum config
- use the CentOS bug tracker url
- retain installonly limit of 5
- ensure distrover is always from centos-release
- Make yum require yum-plugin-fastestmirror
。。。
yum说明
yum -y install epel-release
yum clean
yum clean all
yum update
yum list 显⽰已安装和可⽤的软件包。[root@hub /usr/bin]yum list 'http*'
yum search KEYWORD 根据仅在名称和摘要字段中找到的关键字列出软件包。若要搜索名称、摘要和描述字段中包含 “web server” 的软件包,可使⽤ search all :[root@hub /usr/bin]yum search all 'web server'
yum info PACKAGENAME 返回与软件包相关的详细信息,包括安装所需的磁盘空间。[root@hub /usr/bin] yum info httpd
Loaded plugins: fastestmirror
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
Loading mirror speeds from cached hostfile
* base: mirrors.nju.edu.cn
* elrepo: mirrors.tuna.tsinghua.edu.cn
* extras: mirrors.nju.edu.cn
* updates: mirrors.aliyun.com
Available Packages
Name : httpd
Arch : x86_64
Version : 2.4.6
Release : 99.el7.centos.1
Size : 2.7 M
Repo : updates/7/x86_64
Summary : Apache HTTP Server
URL : http://httpd.apache.org/
License : ASL 2.0
Description : The Apache HTTP Server is a powerful, efficient, and extensible
: web server.yum provides PATHNAME 显⽰与指定的路径名(通常包含通配符)匹配的软件包。[root@hub /usr/bin]yum provides rz
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* elrepo: mirrors.tuna.tsinghua.edu.cn
* extras: mirrors.nju.edu.cn
* updates: mirrors.nju.edu.cn
base | 3.6 kB 00:00:00
docker-ce-stable | 3.5 kB 00:00:00
elrepo | 3.0 kB 00:00:00
extras | 2.9 kB 00:00:00
kubernetes | 1.4 kB 00:00:00
updates | 2.9 kB 00:00:00
(1/4): extras/7/x86_64/primary_db | 250 kB 00:00:00
(2/4): docker-ce-stable/7/x86_64/primary_db | 133 kB 00:00:00
(3/4): elrepo/primary_db | 375 kB 00:00:01
(4/4): updates/7/x86_64/primary_db | 25 MB 00:00:04
docker-ce-stable/7/x86_64/filelists_db | 58 kB 00:00:00
elrepo/filelists_db | 41 kB 00:00:00
extras/7/x86_64/filelists_db | 303 kB 00:00:00
kubernetes/filelists | 45 kB 00:00:00
updates/7/x86_64/filelists_db | 14 MB 00:00:05
lrzsz-0.12.20-36.el7.x86_64 : The lrz and lsz modem communications programs
Repo : base
Matched from:。。。
使⽤yum list kernel可列出所有已安装和可⽤的内核。若要查看当前运⾏中的内核,请使⽤uname 命令。-r 选项仅显⽰内核的版本和发⾏版本,⽽ -a 选项显⽰内核发⾏版和其他信息。[root@hub /usr/bin] yum list kernel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* elrepo: mirrors.tuna.tsinghua.edu.cn
* extras: mirrors.nju.edu.cn
* updates: mirrors.nju.edu.cn
Installed Packages
kernel.x86_64 3.10.0-862.el7 @anaconda
kernel.x86_64 3.10.0-1160.88.1.el7 @updates
Available Packages
kernel.x86_64 3.10.0-1160.108.1.el7 updates
[root@hub /usr/bin] uname -r
3.10.0-1160.88.1.el7.x86_64
[root@hub /usr/bin] uname -a
Linux hub 3.10.0-1160.88.1.el7.x86_64 #1 SMP Tue Mar 7 15:41:52 UTC 2023 x86_64 x86_64 x86_64 GNU/Linuxyum remove PACKAGENAME 删除安装的软件包,包括所有受⽀持的软件包。
[root@hub /usr/bin] yum remove httpdyum也具有组的概念,即针对特定⽬的⽽⼀起安装的相关软件集合。在红帽企业 Linux 8 中, 有两种类型的组。常规组是软件包的集合。环境组是常规组的集合。⼀个组提供的软件包或组 可能为mandatory(安装该组时必须予以安装)、 default (安装该组时通常会安装),或optional(安装该组时不予以安装,除⾮特别要求)。与 yum list 相似, yum group list 命令可显⽰已安装和可⽤的组的名称[root@hub /usr/bin] yum group listyum group info 显⽰组的相关信息。它将列出必选、默认和可选软件包名称。[root@hub /usr/bin] yum group info "RPM Development Tools"