删除CentOS库和配置文件

浏览次数:2356 关键词 ( 配置文件  CentOS  )

1 删除库配置文件  

以root权限运行下面的命令:

 

[plain] view plaincopyprint?在CODE上查看代码片派生到我的代码片  
  1. # cd /etc/yum.repos.d/  

    列出所有库(repo)

 

 

[html] view plaincopyprint?在CODE上查看代码片派生到我的代码片  
  1. #ls  
  2. CentOS-Base.repo       epel.repo                mirrors-rpmforge-testing  
  3. CentOS-Debuginfo.repo  epel-testing.repo        rpmforge.repo  

    删除目标库,指定具体的名称。

 

 

[plain] view plaincopyprint?在CODE上查看代码片派生到我的代码片  
  1. #rm epel.repo epel-testing.repo   
[html] view plaincopyprint?在CODE上查看代码片派生到我的代码片  
  1. ### ***************************** ###  
  2. ### make sure you delete GPG keys also ###  
  3. ### ***************************** ###  
  4. # rm /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL  
  5. # yum clean all  

 

2 删除库的.rpm包

 

[plain] view plaincopyprint?在CODE上查看代码片派生到我的代码片  
  1. #rpm -qa | grep epel  

输出:

 

 

[html] view plaincopyprint?在CODE上查看代码片派生到我的代码片  
  1. epel-release-6-8.noarch  

    删除即可

 

 

 

[plain] view plaincopyprint?在CODE上查看代码片派生到我的代码片  
  1. #yum remove epel-release-6-8.noarch  

    清理配置

 

 

[plain] view plaincopyprint?在CODE上查看代码片派生到我的代码片  
  1. yum clean all  
  2.