After each installation of the CentOS system, you need to initialize some basic settings, such as: modifying the time zone, setting the Alibaba Cloud image source, turning off SELinux, disabling swap, turning off the firewall, etc., these operations must be set, so write a shell script, after each installation of the system, you can directly execute the script, the script is as follows:
After execution, the output is as follows:
The current system version is: CentOS 8 Start setting up the Alibaba Cloud image source
mv: 无法获取'/etc/yum.repos.d/CentOS-Base.repo' 的文件状态(stat): 没有那个文件或目录 --2021-10-24 13:52:02-- https://mirrors.aliyun.com/repo/Centos-8.repo Resolving host mirrors.aliyun.com (mirrors.aliyun.com)... 114.80.179.230, 101.89.125.241, 114.80.179.224, ... Connecting mirrors.aliyun.com (mirrors.aliyun.com)|114.80.179.230|:443... connected. HTTP request has been made, waiting for a response... 200 OK Length: 2595 (2.5K) [application/octet-stream] Saving to: "/etc/yum.repos.d/CentOS-Base.repo"
/etc/yum.repos.d/CentOS-Base.repo 100%[===========================================================================================================================================>] 2.53K --.-KB/s 用时 0s
2021-10-24 13:52:02 (186 MB/s) - Saved "/etc/yum.repos.d/CentOS-Base.repo" [2595/2595])
Set up the docker source --2021-10-24 13:52:02-- https://download.docker.com/linux/centos/docker-ce.repo Resolving host download.docker.com (download.docker.com)... 13.227.254.86, 13.227.254.77, 13.227.254.53, ... Connecting download.docker.com (download.docker.com)|13.227.254.86|:443... connected. HTTP request has been made, waiting for a response... 200 OK Length: 1919 (1.9K) [binary/octet-stream] Saving to: "/etc/yum.repos.d/docker-ce.repo"
/etc/yum.repos.d/docker-ce.repo 100%[===========================================================================================================================================>] 1.87K --.-KB/s 用时 0s
2021-10-24 13:52:03 (77.2 MB/s) - Saved "/etc/yum.repos.d/docker-ce.repo" [1919/1919])
Set the docker source to replace with Tsinghua University to speed up the download Start shutting down and stopping the firewall Removed /etc/systemd/system/multi-user.target.wants/firewalld.service. Removed /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service. Start closing SELinux SELINUX=disabled Disable swap partition swap Set the time zone in Shanghai, China Repository extras is listed more than once in the configuration CentOS-8 - Base - mirrors.aliyun.com 6.7 MB/s | 7.5 MB 00:01 CentOS-8 - Extras - mirrors.aliyun.com 82 kB/s | 10 kB 00:00 CentOS-8 - AppStream - mirrors.aliyun.com 9.3 MB/s | 9.3 MB 00:01 CentOS Linux 8 - AppStream 6.8 MB/s | 9.3 MB 00:01 CentOS Linux 8 - BaseOS 6.5 MB/s | 7.5 MB 00:01 Docker CE Stable - x86_64 80 kB/s | 16 kB 00:00 The metadata cache is established. Automatic time synchronization to a remote NTP server Reboot the server centos 8 remove podman command: yum remove -y podman podman-catatonit buildah The Install docke command is as follows: yum install -y docker-ce docker-ce-cli containerd.io Or use a specific version, which can be passedhttps://centos.pkgs.org/Inquire yum install -y containerd.io-1.4.11 docker-ce-20.10.9 docker-ce-cli-20.10.9 systemctl enable docker && systemctl start docker About the CentOS tutorial on virtual machine installation:
(End)
|