linux 最小功能版 切换yum源

虚拟机网络配置为桥接

ip addr

查看网卡信息

vi /etc/sysconfig /network-scripts/ifcfg-网卡名

编辑ONBOOT=yes,激活网卡

重启网络服务

service network restart

安装net-tools,以便使用ifconfig命令

yum install net-tools

替换默认源使用说明

http://mirrors.163.com/.help/centos.html

查看当前版本命令

cat /etc/redhat-release

 

安装wget

yum install wget

进行以下操作

改名(进行备份)

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

切换到这个目录

cd /etc/yum.repos.d/

下载对应版本的repo文件

wget http://mirrors.163.com/.help/CentOS7-Base-163.repo

清理yum缓存

yum clean all

建立缓存

yum makecache

安装vim编辑器

yum install vim

猜你喜欢

转载自www.cnblogs.com/wgy2020/p/12169259.html