CentOS7.8更改yum源并安装常用工具包

CentOS7.8系统安装完毕后,首先应该修改yum源,并升级到最新的系统.

1)先备份原repo文件

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

2)下载阿里云的repo文件

#默认系统安装了curl,可以直接使用curl下载
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
curl -o /etc/yum.repos.d/epel.repo https://mirrors.aliyun.com/repo/epel-7.repo
#或者安装wget再下载
yum install wget -y
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
wget -O /etc/yum.repos.d/epel.repo https://mirrors.aliyun.com/repo/epel-7.repo

3)删除不可解析的域名

sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo
#删除阿里云内网域名,因为不是ECS云主机是无法解析的。

4)更新缓存

yum makecache 

5)更新系统,把软件更新到最新

yum update -y


6)安装常用的工具包

yum install tree wget nmap dos2unix lrzsz nc lsof tcpdump htop iftop iotop sysstat nethogs -y
yum install psmisc net-tools bash-completion vim-enhanced -y #CentOS7必须要安装的包,因为默认没有安装

 

你可能感兴趣的:(centos,centos,yum)