linux配置阿里云yum源

查看安装的yum

rpm -qa |grep yum

卸载yum

rpm -qa | grep yum | xargs rpm -e --nodeps

查看安装的python-urlgrabber

rpm -qa|grep python-urlgrabber

卸载python-urlgrabber

rpm -qa|grep python-urlgrabber|xargs rpm -e --nodeps

安装阿里云的yum,以下命令中的rpm版本号可能有更新,先去https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/搜索对应的版本号

rpm -ivh --nodeps  https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
rpm -ivh --nodeps  https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-3.4.3-161.el7.centos.noarch.rpm
rpm -ivh --nodeps  https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-rhn-plugin-2.0.1-10.el7.noarch.rpm 
rpm -ivh --nodeps  https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-utils-1.1.31-50.el7.noarch.rpm
rpm -ivh --nodeps  https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/python-urlgrabber-3.10-9.el7.noarch.rpm
rpm -ivh --nodeps  https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-50.el7.noarch.rpm

下载Centos-7.repo到/etc/yum.repos.d/

curl -o /etc/yum.repos.d/Centos-7.repo http://mirrors.aliyun.com/repo/Centos-7.repo

修改Centos-7.repo

cd /etc/yum.repos.d/
ls
vi Centos-7.repo

在vi中执行

:%s/$releasever/7/g

快速替换,保存退出。

清空重载yum

yum clean all
yum update

# 最后查看一下yum列表
yum list

安装vim

yum -y install vim

安装wget

yum -y install wget

安装ifconfig、netstat

yum -y install net-tools

你可能感兴趣的:(Linux)