Centos7第三方源的安装与卸载 - 标配的小号

时间:2024-02-22 09:26:24

Centos7第三方源的安装与卸载

一、第三方源的添加:

第三方源下载地址:

http://repoforge.org/use/

选择合适自己包

我选择的是EL7的

wget 下载这个包

接着使用rpm -ivh 包名

确认是否添加成功

ls /etc/yum.repos.d/   该目录下是否新增了rpmforge.repo文件,如果有,说明添加成功

现在试一下使用第三方源,安装htop(默认没有该安装源),提示安装成功

 二、第三方源的卸载

[root@localhost yum.repos.d]# yum list|grep el8  #centos7系统不小心加了centos8的安装源,导致安装时会出异常报错,所以我们需要卸载el8相关的源
zabbix-agent.x86_64                  4.0.12-1.el7                   installed          
zabbix-release.noarch                4.0-2.el8                      installed          
zlib.x86_64                          1.2.7-18.el7                   @anaconda          
Available Packages
fping.x86_64                         3.16-1.el8                     zabbix-non-supported
zabbix-agent.x86_64                  4.0.14-1.el8                   zabbix             
zabbix-get.x86_64                    4.0.14-1.el8                   zabbix             
zabbix-java-gateway.x86_64           4.0.14-1.el8                   zabbix             
zabbix-proxy-mysql.x86_64            4.0.14-1.el8                   zabbix             
zabbix-proxy-pgsql.x86_64            4.0.14-1.el8                   zabbix             
zabbix-proxy-sqlite3.x86_64          4.0.14-1.el8                   zabbix             
zabbix-sender.x86_64                 4.0.14-1.el8                   zabbix             
zabbix-server-mysql.x86_64           4.0.14-1.el8                   zabbix             
zabbix-server-pgsql.x86_64           4.0.14-1.el8                   zabbix             
zabbix-web.noarch                    4.0.14-1.el8                   zabbix             
zabbix-web-japanese.noarch           4.0.14-1.el8                   zabbix             
zabbix-web-mysql.noarch              4.0.14-1.el8                   zabbix             
zabbix-web-pgsql.noarch              4.0.14-1.el8                   zabbix             
[root@localhost yum.repos.d]# yum remove zabbix-release.noarch  #直接remove卸载即可
Loaded plugins: fastestmirror
Resolving Dependencies
--> Running transaction check
---> Package zabbix-release.noarch 0:4.0-2.el8 will be erased
--> Finished Dependency Resolution

Dependencies Resolved

=======================================================================================
 Package                 Arch            Version              Repository          Size
=======================================================================================
Removing:
 zabbix-release          noarch          4.0-2.el8            installed           21 k

Transaction Summary
=======================================================================================
Remove  1 Package

Installed size: 21 k
Is this ok [y/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Erasing    : zabbix-release-4.0-2.el8.noarch                                     1/1 
  Verifying  : zabbix-release-4.0-2.el8.noarch                                     1/1 

Removed:
  zabbix-release.noarch 0:4.0-2.el8                                                    

Complete!
[root@localhost yum.repos.d]# yum list|grep el8
[root@localhost yum.repos.d]#