This article is a mirror article of machine translation, please click here to jump to the original article.

View: 26090|Reply: 4

[linux] The CentOS system initializes some basic settings

[Copy link]
Posted on 10/24/2021 2:00:23 PM | | |
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:

ESXI installed (CentOS system) virtual machine
https://www.itsvse.com/thread-10123-1-1.html


(End)




Previous:ESXI installed (CentOS system) virtual machine
Next:Docker deploys war applications to Tomcat containers
Posted on 10/29/2021 11:43:45 PM |
Here we go again,,,
 Landlord| Posted on 11/8/2021 11:46:05 AM |
20211108 version:


centos (2.76 KB, Number of downloads: 1, 售价: 5 粒MB)
Posted on 2/19/2023 4:48:05 PM |
Cows, co
Posted on 3/15/2023 7:16:54 AM |
Big brother bull's nose
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com