搭建本地yum源
- 配置网络
nmcli connection modify "ens33" ipv4.method manual ipv4.addresses "192.168.131.161/24" ipv4.gateway "192.168.131.2" ipv4.dns "114.114.114.114" connection.autoconnect yes
nmcli con down ens33
nmcli con up ens33
[root@localhost ~]
PING www.a.shifen.com (36.152.44.95) 56(84) bytes of data.
64 bytes from 36.152.44.95 (36.152.44.95): icmp_seq=1 ttl=128 time=35.8 ms
64 bytes from 36.152.44.95 (36.152.44.95): icmp_seq=2 ttl=128 time=35.6 ms
^C
--- www.a.shifen.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1004ms
rtt min/avg/max/mdev = 35.627/35.727/35.827/0.100 ms
- 关闭防火墙及开机自启
systemctl stop firewalld.service
systemctl disable firewalld.service
- 关闭SELinux
setenforce 0
sed -i '/SELINUX/{s/permissive/disabled/}' /etc/selinux/config
或 vim /etc/selinux/config
SELINUX=disabled
- 挂载镜像
mount /dev/sr0 /mnt/
vim /etc/fstab
/dev/cdrom /mnt iso9660 defaults 0 0
- 配置本地yum
mkdir /tmp/repo
mv /etc/yum.repos.d/CentOS-* /tmp/repo/
vim /etc/yum.repos.d/centos7.repo
[centos]
name=centos
baseurl=file:///mnt
enabled=1
gpgcheck=0
- 检验本地yum源是否成功
[root@localhost ~]
已加载插件:fastestmirror, langpacks
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
正在清理软件源: centos
Cleaning up list of fastest mirrors
已加载插件:fastestmirror, langpacks
Determining fastest mirrors
centos | 3.6 kB 00:00
(1/2): centos/group_gz | 165 kB 00:00
(2/2): centos/primary_db | 3.2 MB 00:00
源标识 源名称 状态
centos centos 4,067
repolist: 4,067