1.首先把创建一个临时目录虚拟挂载光驱内容:
mkdir /mnt/cdrom
2.挂载光驱内容到临时目录:
mount -t auto /dev/cdrom /mnt/cdrom
3.清空CentOS-Base.repo文件:
>/etc/yum.repos.d/CentOS-Base.repo
4.重新编译CentOS-Base.repo文件:
[base]
name=CentOS-$releasever - Base
baseurl=file:///mnt/cdrom/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
[updates]
name=CentOS-$releasever - Updates
baseurl=file:///mnt/cdrom/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
[extras]
name=CentOS-$releasever - Extras
baseurl=file:///mnt/cdrom
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
:wq!
5.清空yum源历史记录和缓存:
yum clean all
yum makecache
6.安装NetworkManager-tui:
yum install -y NetworkManager-tui //必须区分大小写,否则安装不成功。
7.重启网络服务正常:
systemctl restart network
8.使NetworkManager开机启动:
systemctl enable NetworkManager.service //记得这一句敲上,否则下次重启网卡服务起不来。