Pages

Monday, 21 December 2015

CentOS6的yum问题

CentOS release 6.2
在/etc/yum.repos.d目录执行以下2条命令即可。添加epel和remi源
1、epel
#rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
2、remi
#rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
yum查看
[root@196-68 yum.repos.d]# yum list --enablerepo=remi mysql
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
Cannot retrieve metalink for repository: epel. Please verify its path and try again
解决办法:
修改/etc/yum.repos.d/epel.repo,做如下改动:
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch

baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch

update
用163源替换
cd /etc/yum.repos.d/
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
Not using downloaded repomd.xml because it is older than what we have
centos 安装mongodb的时候会出现这个问题,所以应该清空/var/cache/yum/目录下面的文件.

相关帖子:https://briteming.blogspot.com/2015/12/centosepel.html