Home | 简体中文 | 繁体中文 | 杂文 | Github | 知乎专栏 | Facebook | Linkedin | Youtube | 打赏(Donations) | About
知乎专栏

5.3. DNF 包管理

5.3.1. 安装 epel-release 包

Extra Packages for Enterprise Linux repository configuration

使用下面命令安装企业版扩展包

		
dnf -y install epel-release		
		
		

安装演示

		
[root@localhost ~]# dnf search epel-release
Last metadata expiration check: 0:01:57 ago on Thu 05 Dec 2019 09:06:55 PM CST.
==================================================================================================== Name Exactly Matched: epel-release ====================================================================================================
epel-release.noarch : Extra Packages for Enterprise Linux repository configuration
[root@localhost ~]# 
[root@localhost ~]# dnf -y install epel-release
Last metadata expiration check: 0:02:41 ago on Thu 05 Dec 2019 09:06:55 PM CST.
Dependencies resolved.
============================================================================================================================================================================================================================================
 Package                                                      Arch                                                   Version                                                   Repository                                              Size
============================================================================================================================================================================================================================================
Installing:
 epel-release                                                 noarch                                                 8-5.el8                                                   extras                                                  22 k

Transaction Summary
============================================================================================================================================================================================================================================
Install  1 Package

Total download size: 22 k
Installed size: 30 k
Downloading Packages:
epel-release-8-5.el8.noarch.rpm                                                                                                                                                                              16 kB/s |  22 kB     00:01    
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                                                       7.5 kB/s |  22 kB     00:02     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                                                                                    1/1 
  Installing       : epel-release-8-5.el8.noarch                                                                                                                                                                                        1/1 
  Running scriptlet: epel-release-8-5.el8.noarch                                                                                                                                                                                        1/1 
  Verifying        : epel-release-8-5.el8.noarch                                                                                                                                                                                        1/1 

Installed:
  epel-release-8-5.el8.noarch                                                                                                                                                                                                               

Complete!
		
		
		

5.3.2. DNF 软件库管理

		
[root@localhost ~]# dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
Adding repo from: https://download.docker.com/linux/centos/docker-ce.repo	
		
		

5.3.3. 软件库管理

5.3.3.1. 显示系统中可用的 DNF 软件库

		
[root@localhost ~]# dnf repolist
Last metadata expiration check: 0:00:25 ago on Sat 23 Nov 2019 11:06:18 AM EST.
repo id             repo name                                                 status
AppStream           CentOS-8 - AppStream                                      5,089
BaseOS              CentOS-8 - Base                                           2,843
*epel               Extra Packages for Enterprise Linux 8 - x86_64            3,328
extras              CentOS-8 - Extras                                             3
		
		
			
		
dnf repolist -v		
		
			
查看系统中所有的 DNF 软件库(包括禁用状态)
		
[root@localhost ~]# dnf repolist all
Last metadata expiration check: 0:01:45 ago on Sat 23 Nov 2019 11:06:18 AM EST.
repo id                   repo name                                   status
AppStream                 CentOS-8 - AppStream                        enabled: 5,089
AppStream-source          CentOS-8 - AppStream Sources                disabled
BaseOS                    CentOS-8 - Base                             enabled: 2,843
BaseOS-source             CentOS-8 - BaseOS Sources                   disabled
PowerTools                CentOS-8 - PowerTools                       disabled
base-debuginfo            CentOS-8 - Debuginfo                        disabled
c8-media-AppStream        CentOS-AppStream-8 - Media                  disabled
c8-media-BaseOS           CentOS-BaseOS-8 - Media                     disabled
centosplus                CentOS-8 - Plus                             disabled
centosplus-source         CentOS-8 - Plus Sources                     disabled
cr                        CentOS-8 - cr                               disabled
*epel                     Extra Packages for Enterprise Linux 8 - x86 enabled: 3,328
epel-debuginfo            Extra Packages for Enterprise Linux 8 - x86 disabled
epel-playground           Extra Packages for Enterprise Linux 8 - Pla disabled
epel-playground-debuginfo Extra Packages for Enterprise Linux 8 - Pla disabled
epel-playground-source    Extra Packages for Enterprise Linux 8 - Pla disabled
epel-source               Extra Packages for Enterprise Linux 8 - x86 disabled
epel-testing              Extra Packages for Enterprise Linux 8 - Tes disabled
epel-testing-debuginfo    Extra Packages for Enterprise Linux 8 - Tes disabled
epel-testing-source       Extra Packages for Enterprise Linux 8 - Tes disabled
extras                    CentOS-8 - Extras                           enabled:     3
extras-source             CentOS-8 - Extras Sources                   disabled
fasttrack                 CentOS-8 - fasttrack                        disabled
		
		
				

5.3.3.2. 查看软件包

			
[root@production ~]# dnf repoquery freeswitch
Last metadata expiration check: 1:55:11 ago on Sun 13 Apr 2025 07:15:20 AM CST.
freeswitch-0:1.10.0.release.2-1.el7.src
freeswitch-0:1.10.0.release.2-1.el7.x86_64
freeswitch-0:1.10.1.release.3-1.el7.src
freeswitch-0:1.10.1.release.3-1.el7.x86_64
freeswitch-0:1.10.10.release.17-1.el7.src
freeswitch-0:1.10.10.release.17-1.el7.x86_64
freeswitch-0:1.10.11.release.18-1.el7.src
freeswitch-0:1.10.11.release.18-1.el7.x86_64
freeswitch-0:1.10.2.release.4-1.el7.src
freeswitch-0:1.10.2.release.4-1.el7.x86_64
freeswitch-0:1.10.3.release.5-1.el7.src
freeswitch-0:1.10.3.release.5-1.el7.x86_64
freeswitch-0:1.10.4.release.6-1.el7.src
freeswitch-0:1.10.4.release.6-1.el7.x86_64
freeswitch-0:1.10.5.release.8-1.el7.src
freeswitch-0:1.10.5.release.8-1.el7.x86_64
freeswitch-0:1.10.6.release.12-1.el7.src
freeswitch-0:1.10.6.release.12-1.el7.x86_64
freeswitch-0:1.10.7.release.13-1.el7.src
freeswitch-0:1.10.7.release.13-1.el7.x86_64
freeswitch-0:1.10.8.release.14-1.el7.src
freeswitch-0:1.10.8.release.14-1.el7.x86_64
freeswitch-0:1.10.9.release.15-1.el7.src
freeswitch-0:1.10.9.release.15-1.el7.x86_64			
			
			

5.3.3.3. 查询包下载地址

			
[root@production ~]# dnf repoquery --location freeswitch
Last metadata expiration check: 2:00:13 ago on Sun 13 Apr 2025 07:15:20 AM CST.
https://freeswitch.signalwire.com/repo/yum/centos-release/7/x86_64/freeswitch-1.10.0.release.2-1.el7.src.rpm
https://freeswitch.signalwire.com/repo/yum/centos-release/7/x86_64/freeswitch-1.10.0.release.2-1.el7.x86_64.rpm
https://freeswitch.signalwire.com/repo/yum/centos-release/7/x86_64/freeswitch-1.10.1.release.3-1.el7.src.rpm
https://freeswitch.signalwire.com/repo/yum/centos-release/7/x86_64/freeswitch-1.10.1.release.3-1.el7.x86_64.rpm
https://freeswitch.signalwire.com/repo/yum/centos-release/7/x86_64/freeswitch-1.10.10.release.17-1.el7.src.rpm
https://freeswitch.signalwire.com/repo/yum/centos-release/7/x86_64/freeswitch-1.10.10.release.17-1.el7.x86_64.rpm
https://freeswitch.signalwire.com/repo/yum/centos-release/7/x86_64/freeswitch-1.10.11.release.18-1.el7.src.rpm
https://freeswitch.signalwire.com/repo/yum/centos-release/7/x86_64/freeswitch-1.10.11.release.18-1.el7.x86_64.rpm
https://freeswitch.signalwire.com/repo/yum/centos-release/7/x86_64/freeswitch-1.10.2.release.4-1.el7.src.rpm
https://freeswitch.signalwire.com/repo/yum/centos-release/7/x86_64/freeswitch-1.10.2.release.4-1.el7.x86_64.rpm
https://freeswitch.signalwire.com/repo/yum/centos-release/7/x86_64/freeswitch-1.10.3.release.5-1.el7.src.rpm
https://freeswitch.signalwire.com/repo/yum/centos-release/7/x86_64/freeswitch-1.10.3.release.5-1.el7.x86_64.rpm
https://freeswitch.signalwire.com/repo/yum/centos-release/7/x86_64/freeswitch-1.10.4.release.6-1.el7.src.rpm
https://freeswitch.signalwire.com/repo/yum/centos-release/7/x86_64/freeswitch-1.10.4.release.6-1.el7.x86_64.rpm
https://freeswitch.signalwire.com/repo/yum/centos-release/7/x86_64/freeswitch-1.10.5.release.8-1.el7.src.rpm
https://freeswitch.signalwire.com/repo/yum/centos-release/7/x86_64/freeswitch-1.10.5.release.8-1.el7.x86_64.rpm
https://freeswitch.signalwire.com/repo/yum/centos-release/7/x86_64/freeswitch-1.10.6.release.12-1.el7.src.rpm
https://freeswitch.signalwire.com/repo/yum/centos-release/7/x86_64/freeswitch-1.10.6.release.12-1.el7.x86_64.rpm
https://freeswitch.signalwire.com/repo/yum/centos-release/7/x86_64/freeswitch-1.10.7.release.13-1.el7.src.rpm
https://freeswitch.signalwire.com/repo/yum/centos-release/7/x86_64/freeswitch-1.10.7.release.13-1.el7.x86_64.rpm
https://freeswitch.signalwire.com/repo/yum/centos-release/7/x86_64/freeswitch-1.10.8.release.14-1.el7.src.rpm
https://freeswitch.signalwire.com/repo/yum/centos-release/7/x86_64/freeswitch-1.10.8.release.14-1.el7.x86_64.rpm
https://freeswitch.signalwire.com/repo/yum/centos-release/7/x86_64/freeswitch-1.10.9.release.15-1.el7.src.rpm
https://freeswitch.signalwire.com/repo/yum/centos-release/7/x86_64/freeswitch-1.10.9.release.15-1.el7.x86_64.rpm
			
			

5.3.3.4. 查询RPM中包含的文件

			
[root@production ~]# dnf repoquery -l freeswitch-0:1.10.11.release.18-1.el7.x86_64
Last metadata expiration check: 2:02:13 ago on Sun 13 Apr 2025 07:15:20 AM CST.
/etc/freeswitch
/etc/freeswitch/autoload_configs
/etc/freeswitch/dialplan
/etc/freeswitch/dialplan/default
/etc/freeswitch/dialplan/public
/etc/freeswitch/dialplan/skinny-patterns
/etc/freeswitch/directory
/etc/freeswitch/directory/default
/etc/freeswitch/lang
/etc/freeswitch/sip_profiles
/etc/freeswitch/sip_profiles/external
/etc/freeswitch/sip_profiles/external-ipv6
/etc/freeswitch/skinny_profiles
/etc/monit.d
/etc/monit.d/freeswitch.monitrc
/etc/sysconfig/freeswitch
/usr/bin/freeswitch
/usr/bin/fs_cli
/usr/bin/fs_encode
/usr/bin/fs_epmd
/usr/bin/fs_ivrd
/usr/bin/fs_tts
/usr/bin/fsxs
/usr/bin/gentls_cert
/usr/bin/switch_eavesdrop
/usr/bin/tone2wav
/usr/lib/systemd/system/freeswitch.service
/usr/lib/tmpfiles.d/freeswitch.conf
/usr/lib64/freeswitch/mod/mod_cdr_csv.so
/usr/lib64/freeswitch/mod/mod_commands.so
/usr/lib64/freeswitch/mod/mod_console.so
/usr/lib64/freeswitch/mod/mod_dialplan_directory.so
/usr/lib64/freeswitch/mod/mod_dialplan_xml.so
/usr/lib64/freeswitch/mod/mod_dptools.so
/usr/lib64/freeswitch/mod/mod_event_socket.so
/usr/lib64/freeswitch/mod/mod_logfile.so
/usr/lib64/freeswitch/mod/mod_loopback.so
/usr/lib64/freeswitch/mod/mod_native_file.so
/usr/lib64/freeswitch/mod/mod_sndfile.so
/usr/lib64/freeswitch/mod/mod_sofia.so
/usr/lib64/freeswitch/mod/mod_spandsp.so
/usr/lib64/freeswitch/mod/mod_syslog.so
/usr/lib64/freeswitch/mod/mod_tone_stream.so
/usr/lib64/freeswitch/mod/mod_xml_rpc.so
/usr/lib64/libfreeswitch.so
/usr/lib64/libfreeswitch.so.1
/usr/lib64/libfreeswitch.so.1.0.0
/usr/share/freeswitch/grammar
/usr/share/freeswitch/grammar/model
/usr/share/freeswitch/grammar/model/communicator
/usr/share/freeswitch/htdocs
/usr/share/freeswitch/htdocs/license.txt
/usr/share/freeswitch/htdocs/portal
/usr/share/freeswitch/htdocs/portal/LICENCE
/usr/share/freeswitch/htdocs/portal/README.md
/usr/share/freeswitch/htdocs/portal/assets
/usr/share/freeswitch/htdocs/portal/assets/bootstrap
/usr/share/freeswitch/htdocs/portal/assets/bootstrap-3.1.1
/usr/share/freeswitch/htdocs/portal/assets/bootstrap-3.1.1/css
/usr/share/freeswitch/htdocs/portal/assets/bootstrap-3.1.1/css/bootstrap-theme.css
/usr/share/freeswitch/htdocs/portal/assets/bootstrap-3.1.1/css/bootstrap-theme.min.css
/usr/share/freeswitch/htdocs/portal/assets/bootstrap-3.1.1/css/bootstrap.css
/usr/share/freeswitch/htdocs/portal/assets/bootstrap-3.1.1/css/bootstrap.min.css
/usr/share/freeswitch/htdocs/portal/assets/bootstrap-3.1.1/fonts
/usr/share/freeswitch/htdocs/portal/assets/bootstrap-3.1.1/fonts/glyphicons-halflings-regular.eot
/usr/share/freeswitch/htdocs/portal/assets/bootstrap-3.1.1/fonts/glyphicons-halflings-regular.svg
/usr/share/freeswitch/htdocs/portal/assets/bootstrap-3.1.1/fonts/glyphicons-halflings-regular.ttf
/usr/share/freeswitch/htdocs/portal/assets/bootstrap-3.1.1/fonts/glyphicons-halflings-regular.woff
/usr/share/freeswitch/htdocs/portal/assets/bootstrap-3.1.1/js
/usr/share/freeswitch/htdocs/portal/assets/bootstrap-3.1.1/js/bootstrap.js
/usr/share/freeswitch/htdocs/portal/assets/bootstrap-3.1.1/js/bootstrap.min.js
/usr/share/freeswitch/htdocs/portal/assets/bootstrap/css
/usr/share/freeswitch/htdocs/portal/assets/bootstrap/css/bootstrap-responsive.css
/usr/share/freeswitch/htdocs/portal/assets/bootstrap/css/bootstrap-responsive.min.css
/usr/share/freeswitch/htdocs/portal/assets/bootstrap/css/bootstrap.css
/usr/share/freeswitch/htdocs/portal/assets/bootstrap/css/bootstrap.min.css
/usr/share/freeswitch/htdocs/portal/assets/bootstrap/img
/usr/share/freeswitch/htdocs/portal/assets/bootstrap/img/glyphicons-halflings-white.png
/usr/share/freeswitch/htdocs/portal/assets/bootstrap/img/glyphicons-halflings.png
/usr/share/freeswitch/htdocs/portal/assets/bootstrap/js
/usr/share/freeswitch/htdocs/portal/assets/bootstrap/js/bootstrap.js
/usr/share/freeswitch/htdocs/portal/assets/bootstrap/js/bootstrap.min.js
/usr/share/freeswitch/htdocs/portal/assets/bs_for_ember
/usr/share/freeswitch/htdocs/portal/assets/bs_for_ember/css
/usr/share/freeswitch/htdocs/portal/assets/bs_for_ember/css/bs-growl-notifications.min.css
/usr/share/freeswitch/htdocs/portal/assets/bs_for_ember/js
/usr/share/freeswitch/htdocs/portal/assets/bs_for_ember/js/bs-alert.min.js
/usr/share/freeswitch/htdocs/portal/assets/bs_for_ember/js/bs-badge.min.js
/usr/share/freeswitch/htdocs/portal/assets/bs_for_ember/js/bs-basic.min.js
/usr/share/freeswitch/htdocs/portal/assets/bs_for_ember/js/bs-button.min.js
/usr/share/freeswitch/htdocs/portal/assets/bs_for_ember/js/bs-core.min.js
/usr/share/freeswitch/htdocs/portal/assets/bs_for_ember/js/bs-growl-notifications.min.js
/usr/share/freeswitch/htdocs/portal/assets/bs_for_ember/js/bs-items-action-bar.min.js
/usr/share/freeswitch/htdocs/portal/assets/bs_for_ember/js/bs-label.min.js
/usr/share/freeswitch/htdocs/portal/assets/bs_for_ember/js/bs-list-group.min.js
/usr/share/freeswitch/htdocs/portal/assets/bs_for_ember/js/bs-modal.min.js
/usr/share/freeswitch/htdocs/portal/assets/bs_for_ember/js/bs-nav.min.js
/usr/share/freeswitch/htdocs/portal/assets/bs_for_ember/js/bs-notifications.min.js
/usr/share/freeswitch/htdocs/portal/assets/bs_for_ember/js/bs-progressbar.min.js
/usr/share/freeswitch/htdocs/portal/assets/bs_for_ember/js/bs-wizard.min.js
/usr/share/freeswitch/htdocs/portal/assets/js
/usr/share/freeswitch/htdocs/portal/assets/js/ember-1.0.0-rc.1.js
/usr/share/freeswitch/htdocs/portal/assets/js/ember-1.0.0-rc.1.min.js
/usr/share/freeswitch/htdocs/portal/assets/js/ember-data.js
/usr/share/freeswitch/htdocs/portal/assets/js/ember-data.min.js
/usr/share/freeswitch/htdocs/portal/assets/js/ember.js
/usr/share/freeswitch/htdocs/portal/assets/js/ember.min.js
/usr/share/freeswitch/htdocs/portal/assets/js/fsportal.js
/usr/share/freeswitch/htdocs/portal/assets/js/handlebars.js
/usr/share/freeswitch/htdocs/portal/assets/js/handlebars.min.js
/usr/share/freeswitch/htdocs/portal/assets/js/ie-console.js
/usr/share/freeswitch/htdocs/portal/assets/js/jquery-1.9.1.min.js
/usr/share/freeswitch/htdocs/portal/assets/js/jquery.min.js
/usr/share/freeswitch/htdocs/portal/index.html
/usr/share/freeswitch/htdocs/slim.swf
/usr/share/freeswitch/htdocs/slimtest.htm
/usr/share/freeswitch/scripts
/var/lib/freeswitch
/var/lib/freeswitch/db
/var/lib/freeswitch/images
/var/lib/freeswitch/images/default-avatar.png
/var/lib/freeswitch/images/default-mute.png
/var/log/freeswitch
/var/run/freeswitch			
			
			

5.3.3.5. 查询 RPM 包信息

			
[root@production ~]# dnf repoquery -i freeswitch-0:1.10.11.release.18-1.el7.x86_64
Last metadata expiration check: 2:04:15 ago on Sun 13 Apr 2025 07:15:20 AM CST.
Name         : freeswitch
Version      : 1.10.11.release.18
Release      : 1.el7
Architecture : x86_64
Size         : 3.2 M
Source       : freeswitch-1.10.11.release.18-1.el7.src.rpm
Repository   : freeswitch
Summary      : FreeSWITCH open source telephony platform
URL          : http://www.freeswitch.org/
License      : MPL1.1
Description  : FreeSWITCH is an open source telephony platform designed to facilitate the creation of voice
             : and chat driven products scaling from a soft-phone up to a soft-switch.  It can be used as a
             : simple switching engine, a media gateway or a media server to host IVR applications using
             : simple scripts or XML to control the callflow.
             : 
             : We support various communication technologies such as SIP, H.323 and GoogleTalk making
             : it easy to interface with other open source PBX systems such as sipX, OpenPBX, Bayonne, YATE or Asterisk.
             : 
             : We also support both wide and narrow band codecs making it an ideal solution to bridge legacy
             : devices to the future. The voice channels and the conference bridge module all can operate
             : at 8, 16 or 32 kilohertz and can bridge channels of different rates.
             : 
             : FreeSWITCH runs on several operating systems including Windows, Max OS X, Linux, BSD and Solaris
             : on both 32 and 64 bit platforms.
             : 
             : Our developers are heavily involved in open source and have donated code and other resources to
             : other telephony projects including sipXecs, OpenSER, Asterisk, CodeWeaver and OpenPBX.

Name         : freeswitch
Version      : 1.10.11.release.18
Release      : 1.el7
Architecture : x86_64
Size         : 3.2 M
Source       : freeswitch-1.10.11.release.18-1.el7.src.rpm
Repository   : freeswitch-debuginfo
Summary      : FreeSWITCH open source telephony platform
URL          : http://www.freeswitch.org/
License      : MPL1.1
Description  : FreeSWITCH is an open source telephony platform designed to facilitate the creation of voice
             : and chat driven products scaling from a soft-phone up to a soft-switch.  It can be used as a
             : simple switching engine, a media gateway or a media server to host IVR applications using
             : simple scripts or XML to control the callflow.
             : 
             : We support various communication technologies such as SIP, H.323 and GoogleTalk making
             : it easy to interface with other open source PBX systems such as sipX, OpenPBX, Bayonne, YATE or Asterisk.
             : 
             : We also support both wide and narrow band codecs making it an ideal solution to bridge legacy
             : devices to the future. The voice channels and the conference bridge module all can operate
             : at 8, 16 or 32 kilohertz and can bridge channels of different rates.
             : 
             : FreeSWITCH runs on several operating systems including Windows, Max OS X, Linux, BSD and Solaris
             : on both 32 and 64 bit platforms.
             : 
             : Our developers are heavily involved in open source and have donated code and other resources to
             : other telephony projects including sipXecs, OpenSER, Asterisk, CodeWeaver and OpenPBX.

Name         : freeswitch
Version      : 1.10.11.release.18
Release      : 1.el7
Architecture : x86_64
Size         : 3.2 M
Source       : freeswitch-1.10.11.release.18-1.el7.src.rpm
Repository   : freeswitch-source
Summary      : FreeSWITCH open source telephony platform
URL          : http://www.freeswitch.org/
License      : MPL1.1
Description  : FreeSWITCH is an open source telephony platform designed to facilitate the creation of voice
             : and chat driven products scaling from a soft-phone up to a soft-switch.  It can be used as a
             : simple switching engine, a media gateway or a media server to host IVR applications using
             : simple scripts or XML to control the callflow.
             : 
             : We support various communication technologies such as SIP, H.323 and GoogleTalk making
             : it easy to interface with other open source PBX systems such as sipX, OpenPBX, Bayonne, YATE or Asterisk.
             : 
             : We also support both wide and narrow band codecs making it an ideal solution to bridge legacy
             : devices to the future. The voice channels and the conference bridge module all can operate
             : at 8, 16 or 32 kilohertz and can bridge channels of different rates.
             : 
             : FreeSWITCH runs on several operating systems including Windows, Max OS X, Linux, BSD and Solaris
             : on both 32 and 64 bit platforms.
             : 
             : Our developers are heavily involved in open source and have donated code and other resources to
             : other telephony projects including sipXecs, OpenSER, Asterisk, CodeWeaver and OpenPBX.
			
			

5.3.3.6. 通过目录查询对应的包

			
[root@production ~]# dnf repoquery --file /var/lib/libvirt/
Last metadata expiration check: 2:05:31 ago on Sun 13 Apr 2025 07:15:20 AM CST.
libvirt-daemon-common-0:10.5.0-7.2.el9_5.x86_64
libvirt-daemon-common-0:10.5.0-7.4.el9_5.x86_64
libvirt-daemon-common-0:10.5.0-7.5.el9_5.x86_64
libvirt-daemon-common-0:10.5.0-7.el9_5.alma.1.x86_64			
			
			

5.3.3.7. 列出某个仓库包提供的软件包

			
[root@production ~]# dnf repository-packages freeswitch list 
Last metadata expiration check: 2:08:43 ago on Sun 13 Apr 2025 07:15:20 AM CST.
Installed Packages
broadvoice.x86_64                                                                           0.1.0-1.el7.centos                                                              @freeswitch
freeswitch.x86_64                                                                           1.10.11.release.18-1.el7                                                        @freeswitch
freeswitch-application-abstraction.x86_64                                                   1.10.11.release.18-1.el7                                                        @freeswitch
freeswitch-application-avmd.x86_64                                                          1.10.11.release.18-1.el7                                                        @freeswitch
freeswitch-application-blacklist.x86_64                                                     1.10.11.release.18-1.el7                                                        @freeswitch
freeswitch-application-callcenter.x86_64                                                    1.10.11.release.18-1.el7                                                        @freeswitch
freeswitch-application-cidlookup.x86_64 
			
			

5.3.4. 列出所有 RPM 包

用于列出系统上所有软件包

		
[root@localhost ~]# dnf list |more
Last metadata expiration check: 0:04:15 ago on Sat 23 Nov 2019 11:06:18 AM EST.
Installed Packages
GeoIP.x86_64                                         1.5.0-14.el7                                            @System      
NetworkManager.x86_64                                1:1.18.0-5.el7_7.1                                      @System      
NetworkManager-libnm.x86_64                          1:1.18.0-5.el7_7.1                                      @System      
NetworkManager-team.x86_64                           1:1.18.0-5.el7_7.1                                      @System      
NetworkManager-tui.x86_64                            1:1.18.0-5.el7_7.1                                      @System      
NetworkManager-wifi.x86_64                           1:1.18.0-5.el7_7.1                                      @System      
acl.x86_64                                           2.2.51-14.el7                                           @System      
adwaita-cursor-theme.noarch                          3.28.0-1.el7                                            @System      
adwaita-icon-theme.noarch                            3.28.0-1.el7                                            @System      
aic94xx-firmware.noarch                              30-6.el7                                                @System      
alsa-firmware.noarch                                 1.0.28-2.el7                                            @System      
alsa-lib.x86_64                                      1.1.8-1.el7                                             @System      
alsa-tools-firmware.x86_64                           1.1.0-1.el7                                             @System      
at-spi2-atk.x86_64                                   2.26.2-1.el7                                            @System      
at-spi2-core.x86_64                                  2.28.0-1.el7                                            @System      
atk.x86_64                                           2.28.1-1.el7                                            @System      
audit.x86_64                                         2.8.5-4.el7                                             @System      
audit-libs.x86_64                                    2.8.5-4.el7                                             @System      
audit-libs-python.x86_64                             2.8.5-4.el7                                             @System      
authconfig.x86_64                                    6.2.8-30.el7                                            @System      
autoconf.noarch                                      2.69-11.el7                                             @System      
--More--
		
		

列出制定包

		
[root@localhost ~]# dnf list nginx
Last metadata expiration check: 0:10:05 ago on Sat 23 Nov 2019 11:06:18 AM EST.
Available Packages
nginx.x86_64                                   1:1.14.1-9.module_el8.0.0+184+e34fea82                                   AppStream		
		
		

5.3.4.1. 查看已经安装包

用于列出系统上所有已经安装的软件包

		
[root@localhost ~]# dnf list installed | more
Installed Packages
GeoIP.x86_64                       1.5.0-14.el7                    @System      
NetworkManager.x86_64              1:1.18.0-5.el7_7.1              @System      
NetworkManager-libnm.x86_64        1:1.18.0-5.el7_7.1              @System      
NetworkManager-team.x86_64         1:1.18.0-5.el7_7.1              @System      
NetworkManager-tui.x86_64          1:1.18.0-5.el7_7.1              @System      
NetworkManager-wifi.x86_64         1:1.18.0-5.el7_7.1              @System      
acl.x86_64                         2.2.51-14.el7                   @System      
adwaita-cursor-theme.noarch        3.28.0-1.el7                    @System      
adwaita-icon-theme.noarch          3.28.0-1.el7                    @System      
aic94xx-firmware.noarch            30-6.el7                        @System      
alsa-firmware.noarch               1.0.28-2.el7                    @System      
alsa-lib.x86_64                    1.1.8-1.el7                     @System      
alsa-tools-firmware.x86_64         1.1.0-1.el7                     @System      
at-spi2-atk.x86_64                 2.26.2-1.el7                    @System      
at-spi2-core.x86_64                2.28.0-1.el7                    @System      
atk.x86_64                         2.28.1-1.el7                    @System      
audit.x86_64                       2.8.5-4.el7                     @System      
audit-libs.x86_64                  2.8.5-4.el7                     @System      
audit-libs-python.x86_64           2.8.5-4.el7                     @System      
authconfig.x86_64                  6.2.8-30.el7                    @System      
autoconf.noarch                    2.69-11.el7                     @System      
automake.noarch                    1.13.4-3.el7                    @System      
--More--
		
		
			

5.3.4.2. 列出可用的软件包

		
[root@localhost ~]# dnf list available | more
Last metadata expiration check: 0:07:35 ago on Sat 23 Nov 2019 11:06:18 AM EST.
Available Packages
3proxy.x86_64                                        0.8.13-1.el8                                            epel     
BackupPC.x86_64                                      4.3.1-3.el8                                             epel     
BackupPC-XS.x86_64                                   0.59-3.el8                                              epel     
CGSI-gSOAP.x86_64                                    1.3.11-7.el8                                            epel     
CGSI-gSOAP-devel.x86_64                              1.3.11-7.el8                                            epel     
CUnit.i686                                           2.1.3-17.el8                                            AppStream
CUnit.x86_64                                         2.1.3-17.el8                                            AppStream
Field3D.x86_64                                       1.7.2-16.el8                                            epel     
Field3D-devel.x86_64                                 1.7.2-16.el8                                            epel     
GConf2.i686                                          3.2.6-22.el8                                            AppStream
GConf2.x86_64                                        3.2.6-22.el8                                            AppStream
GraphicsMagick.x86_64                                1.3.33-1.el8                                            epel     
GraphicsMagick-c++.x86_64                            1.3.33-1.el8                                            epel     
GraphicsMagick-c++-devel.x86_64                      1.3.33-1.el8                                            epel     
GraphicsMagick-devel.x86_64                          1.3.33-1.el8                                            epel     
GraphicsMagick-doc.noarch                            1.3.33-1.el8                                            epel     
GraphicsMagick-perl.x86_64                           1.3.33-1.el8                                            epel     
HepMC.x86_64                                         2.06.10-1.el8                                           epel     
HepMC-devel.x86_64                                   2.06.10-1.el8                                           epel     
HepMC-doc.noarch                                     2.06.10-1.el8                                           epel     
HepMC3.x86_64                                        3.1.2-1.el8                                             epel     
--More--
		
		
			

5.3.4.3. 显示重复内容

		
dnf list docker-ce --showduplicates | sort -r
		
			

5.3.4.4. 使用通配符

			
[root@gitlab ~]# dnf list -y mongodb-org
gitlab_gitlab-ce                                                                                                                                                                                               45  B/s | 862  B     00:19    
gitlab_gitlab-ce-source                                                                                                                                                                                       218  B/s | 862  B     00:03    
runner_gitlab-runner                                                                                                                                                                                          138  B/s | 862  B     00:06    
runner_gitlab-runner-source                                                                                                                                                                                   238  B/s | 862  B     00:03    
Available Packages
mongodb-org.x86_64                                                                                                 5.0.0-1.el8                                                                                                 mongodb-org-5.0

[root@gitlab ~]# dnf list -y mongodb-org-*
Last metadata expiration check: 0:03:16 ago on Tue 20 Jul 2021 10:06:00 AM CST.
Installed Packages
mongodb-org-database-tools-extra.x86_64                                                                                      5.0.0-1.el8                                                                                      @mongodb-org-5.0
mongodb-org-server.x86_64                                                                                                    5.0.0-1.el8                                                                                      @mongodb-org-5.0
mongodb-org-shell.x86_64                                                                                                     5.0.0-1.el8                                                                                      @mongodb-org-5.0
mongodb-org-tools.x86_64                                                                                                     5.0.0-1.el8                                                                                      @mongodb-org-5.0
Available Packages
mongodb-org-database.x86_64                                                                                                  5.0.0-1.el8                                                                                      mongodb-org-5.0 
mongodb-org-mongos.x86_64                                                                                                    5.0.0-1.el8                                                                                      mongodb-org-5.0	
			
			

5.3.5. 搜索软件库中的包

		
[root@localhost ~]# dnf search mysql
Last metadata expiration check: 0:11:11 ago on Sat 23 Nov 2019 11:06:18 AM EST.
================================================= Name & Summary Matched: mysql =================================================
mysql.x86_64 : MySQL client programs and shared libraries
libnss-mysql.x86_64 : NSS library for MySQL
postfix-mysql.x86_64 : Postfix MySQL map support
rsyslog-mysql.x86_64 : MySQL support for rsyslog
collectd-mysql.x86_64 : MySQL plugin for collectd
libdbi-dbd-mysql.x86_64 : MySQL plugin for libdbi
dovecot-mysql.x86_64 : MySQL back end for dovecot
pdns-backend-mysql.x86_64 : MySQL backend for pdns
perl-DBD-MySQL.x86_64 : A MySQL interface for Perl
root-sql-mysql.x86_64 : MySQL client plugin for ROOT
freeradius-mysql.x86_64 : MySQL support for freeradius
voms-mysql-plugin.x86_64 : VOMS server plugin for MySQL
mysql-server.x86_64 : The MySQL server and related files
nagios-plugins-mysql.x86_64 : Nagios Plugin - check_mysql
zabbix40-web-mysql.noarch : Zabbix web frontend for MySQL
mysql-test.x86_64 : The test suite distributed with MySQL
python2-PyMySQL.noarch : Pure-Python MySQL client library
python3-PyMySQL.noarch : Pure-Python MySQL client library
apr-util-mysql.x86_64 : APR utility library MySQL DBD driver
qt5-qtbase-mysql.i686 : MySQL driver for Qt5's SQL classes
qt5-qtbase-mysql.x86_64 : MySQL driver for Qt5's SQL classes
rubygem-mysql2-doc.noarch : Documentation for rubygem-mysql2
zabbix40-proxy-mysql.x86_64 : Zabbix proxy compiled to use MySQL
mysql-devel.x86_64 : Files for development of MySQL applications
zabbix40-server-mysql.x86_64 : Zabbix server compiled to use MySQL
mysql-libs.x86_64 : The shared libraries required for MySQL clients
preludedb-mysql.x86_64 : Plugin to use prelude with a MySQL database
pcp-pmda-mysql.x86_64 : Performance Co-Pilot (PCP) metrics for MySQL
mysql-errmsg.x86_64 : The error messages files required by MySQL server
mysql80-community-release.noarch : MySQL repository configuration for yum
perl-DateTime-Format-MySQL.noarch : Parse and format MySQL dates and times
mysql-common.x86_64 : The shared files required for MySQL server and client
php-mysqlnd.x86_64 : A module for PHP applications that use MySQL databases
mysql-community-client.x86_64 : MySQL database client applications and tools
rubygem-mysql2.x86_64 : A simple, fast Mysql library for Ruby, binding to libmysql
mysql-community-libs.x86_64 : Shared libraries for MySQL database client applications
mysql-community-common.x86_64 : MySQL database common files for server and client libs
lighttpd-mod_mysql_vhost.x86_64 : Virtual host module for lighttpd that uses a MySQL database
lighttpd-mod_authn_mysql.x86_64 : Authentication module for lighttpd that uses a MySQL database
mysql-community-libs-compat.x86_64 : Shared compat libraries for MySQL 5.6.45 database client applications
====================================================== Name Matched: mysql ======================================================
zabbix40-dbfiles-mysql.noarch : Zabbix database schemas, images, data and patches
==================================================== Summary Matched: mysql =====================================================
innotop.noarch : A MySQL and InnoDB monitor program
mariadb-devel.x86_64 : Files for development of MariaDB/MySQL applications
mariadb-server-utils.x86_64 : Non-essential server utilities for MariaDB/MySQL applications
mariadb-java-client.noarch : Connects applications developed in Java to MariaDB and MySQL databases
		
		

5.3.6. 查看软件包详情

		
[root@localhost ~]# dnf info redis
Last metadata expiration check: 0:13:10 ago on Sat 23 Nov 2019 11:06:18 AM EST.
Available Packages
Name         : redis
Version      : 5.0.3
Release      : 1.module_el8.0.0+6+ab019c03
Arch         : x86_64
Size         : 927 k
Source       : redis-5.0.3-1.module_el8.0.0+6+ab019c03.src.rpm
Repo         : AppStream
Summary      : A persistent key-value database
URL          : http://redis.io
License      : BSD and MIT
Description  : Redis is an advanced key-value store. It is often referred to as a data
             : structure server since keys can contain strings, hashes, lists, sets and
             : sorted sets.
             : 
             : You can run atomic operations on these types, like appending to a string;
             : incrementing the value in a hash; pushing to a list; computing set
             : intersection, union and difference; or getting the member with highest
             : ranking in a sorted set.
             : 
             : In order to achieve its outstanding performance, Redis works with an
             : in-memory dataset. Depending on your use case, you can persist it either
             : by dumping the dataset to disk every once in a while, or by appending
             : each command to a log.
             : 
             : Redis also supports trivial-to-setup master-slave replication, with very
             : fast non-blocking first synchronization, auto-reconnection on net split
             : and so forth.
             : 
             : Other features include Transactions, Pub/Sub, Lua scripting, Keys with a
             : limited time-to-live, and configuration settings to make Redis behave like
             : a cache.
             : 
             : You can use Redis from most programming languages also.
		
		

5.3.7. 查找某一文件的提供者

		
[root@localhost ~]# dnf provides /bin/bash
Last metadata expiration check: 0:11:58 ago on Sat 23 Nov 2019 11:06:18 AM EST.
bash-4.2.46-33.el7.x86_64 : The GNU Bourne Again shell
Repo        : @System
Matched from:
Provide    : /bin/bash

bash-4.4.19-7.el8.i686 : The GNU Bourne Again shell
Repo        : BaseOS
Matched from:
Provide    : /bin/bash

bash-4.4.19-7.el8.x86_64 : The GNU Bourne Again shell
Repo        : BaseOS
Matched from:
Provide    : /bin/bash

bash-4.4.19-8.el8_0.x86_64 : The GNU Bourne Again shell
Repo        : BaseOS
Matched from:
Provide    : /bin/bash
		
		
		

5.3.8. 删除软件包

		
[root@localhost ~]# dnf remove nginx