centos替换源
#!/bin/sh
# 本文原内容来自:https://github.com/judasn/linux-tutorial/blob/master/centos-extra-packages.md
## 可能额外需要移除/etc/yum.repos.d/mirrors-rpmforge中失效的源,以及移除对应的.repo文件
echo "源设置开始"
echo "备份默认源设置"
sudo mv /etc/yum.repos.d/centos-base.repo /etc/yum.repos.d/centos-base.repo.backup
cd /etc/yum.repos.d/
echo "下载网易 centos6 源"
sudo wget http://mirrors.163.com/.help/centos6-base-163.repo
echo "安装网易 centos6 源"
sudo mv centos6-base-163.repo centos-base.repo
rpm --import /etc/pki/rpm-gpg/rpm-gpg-key-centos-6
echo "清除缓存后更新程序"
sudo yum clean all
sudo yum makecache
sudo yum update -y
echo "使用第三方源"
echo "安装 epel 源"
sudo yum install -y epel-release
rpm --import /etc/pki/rpm-gpg/rpm-gpg-key-epel-6
echo "安装 repoforge 源"
wget
sudo rpm -ivh rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
sudo rpm --import /etc/pki/rpm-gpg/rpm-gpg-key-rpmforge-dag
echo "清除缓存后更新程序"
sudo yum clean all
sudo yum makecache
sudo yum update -y
echo "测试安装 htop"
sudo yum install -y htop
echo "完成源设置"
上一篇: 让你一文弄懂Pandas文本数据处理
下一篇: vc5Secs.exe进程是什么意思