如果不理解该命令,可以先去了解:yum 仓库管理 yum-config-manager
在使用该命令的时候碰到以下问题:
[root@iZbp115r5t4hzamv0snvm1Z cim]# yum-config-manager --add-repo https://download.opensuse.org/repositories/home:/Alexander_Pozdnyakov/CentOS_7/
-bash: yum-config-manager: command not found
这是因为系统默认没有安装这个命令,这个命令在 yum-utils 包里,安装该包即可。
# yum -y install yum-utils # 执行此命令即可
操作流程如下:
[root@iZbp115r5t4hzamv0snvm1Z cim]# yum -y install yum-utils
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* webtatic: us-east.repo.webtatic.com
Resolving Dependencies
--> Running transaction check
---> Package yum-utils.noarch 0:1.1.31-54.el7_8 will be installed
--> Processing Dependency: python-kitchen for package: yum-utils-1.1.31-54.el7_8.noarch
--> Processing Dependency: libxml2-python for package: yum-utils-1.1.31-54.el7_8.noarch
--> Running transaction check
---> Package libxml2-python.x86_64 0:2.9.1-6.el7.5 will be installed
---> Package python-kitchen.noarch 0:1.1.1-5.el7 will be installed
--> Processing Dependency: python-chardet for package: python-kitchen-1.1.1-5.el7.noarch
--> Running transaction check
---> Package python-chardet.noarch 0:2.2.1-3.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=================================================================================================
Package Arch Version Repository Size
=================================================================================================
Installing:
yum-utils noarch 1.1.31-54.el7_8 base 122 k
Installing for dependencies:
libxml2-python x86_64 2.9.1-6.el7.5 base 247 k
python-chardet noarch 2.2.1-3.el7 base 227 k
python-kitchen noarch 1.1.1-5.el7 base 267 k
Transaction Summary
=================================================================================================
Install 1 Package (+3 Dependent packages)
Total download size: 863 k
Installed size: 4.3 M
Downloading packages:
(1/4): python-chardet-2.2.1-3.el7.noarch.rpm | 227 kB 00:00:00
(2/4): libxml2-python-2.9.1-6.el7.5.x86_64.rpm | 247 kB 00:00:00
(3/4): yum-utils-1.1.31-54.el7_8.noarch.rpm | 122 kB 00:00:00
(4/4): python-kitchen-1.1.1-5.el7.noarch.rpm | 267 kB 00:00:00
-------------------------------------------------------------------------------------------------
Total 4.6 MB/s | 863 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : python-chardet-2.2.1-3.el7.noarch 1/4
Installing : python-kitchen-1.1.1-5.el7.noarch 2/4
Installing : libxml2-python-2.9.1-6.el7.5.x86_64 3/4
Installing : yum-utils-1.1.31-54.el7_8.noarch 4/4
Verifying : libxml2-python-2.9.1-6.el7.5.x86_64 1/4
Verifying : python-kitchen-1.1.1-5.el7.noarch 2/4
Verifying : yum-utils-1.1.31-54.el7_8.noarch 3/4
Verifying : python-chardet-2.2.1-3.el7.noarch 4/4
Installed:
yum-utils.noarch 0:1.1.31-54.el7_8
Dependency Installed:
libxml2-python.x86_64 0:2.9.1-6.el7.5 python-chardet.noarch 0:2.2.1-3.el7
python-kitchen.noarch 0:1.1.1-5.el7
Complete!