坐标南京某学校。
校园网配置Docker需要配置一下代理服务器。
从下午两点配置到晚上19.38,记录一下,方便以后的同学少走弯路。
1 yum镜像源配置
如果第2步可以直接跑通则不需要这一步,可直接进入第2步。
这里将yum源改为 mirrors.163.com
(1)备份系统原始yum源
# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
(2)进入文件夹
# cd /etc/yum.repos.d/
(3)下载新的yum源配置文件到这个文件夹,对于centos7来讲,命令是
# wget http://mirrors.163.com/.help/CentOS7-Base-163.repo
(其他centos系统将7换为对应版本号)
(4)生成缓存
# yum makecache
(5)更新系统
# yum -y update
更新完一堆东西后会显示
zenity.x86_64 0:3.28.1-1.el7
zlib.x86_64 0:1.2.7-18.el7
Replaced:
caribou.x86_64 0:0.4.21-1.el7
caribou-gtk2-module.x86_64 0:0.4.21-1.el7
caribou-gtk3-module.x86_64 0:0.4.21-1.el7
gnome-dictionary-libs.x86_64 0:3.20.0-1.el7
gnome-tweak-tool.noarch 0:3.22.0-1.el7
grub2.x86_64 1:2.02-0.65.el7.centos.2
grub2-tools.x86_64 1:2.02-0.65.el7.centos.2
mesa-libwayland-egl.x86_64 0:17.2.3-8.20171019.el7
pyatspi.noarch 0:2.20.3-1.el7
python2-caribou.noarch 0:0.4.21-1.el7
Complete!
2 配置好了yum镜像源后,可以安装Docker了
(1)yum安装
[root@localhost yum.repos.d]# yum install -y yum-utils device-mapper-persistent-data lvm2Loaded plugins: fastestmirror, langpacks
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Loading mirror speeds from cached hostfile
* base: ap.stykers.moe
* extras: mirrors.nju.edu.cn
* updates: ftp.sjtu.edu.cn
base | 3.6 kB 00:00:00
extras