Skip to content

CentOS 8 FAQ

CentOS 8 关闭防火墙

sh
sudo systemctl stop firewalld.service       ## 停止firewall
sudo systemctl disable firewalld.service    ## 禁止firewall开机启动

CentOS 8 安装 docker

sh
sudo yum install -y yum-utils \
  device-mapper-persistent-data \
  lvm2
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
sudo yum install -y containerd.io
sudo yum install -y --nobest docker-ce docker-ce-cli
sudo systemctl start docker
sudo systemctl enable docker

CentOS 8 安装 docker-compose

sh
sudo yum install -y epel-release
sudo yum-config-manager --enable epel
pip3 install --user docker-compose

linux 下使用 cpu 并发解压缩来加快速度

sh
sudo apt install pigz
tar --use-compress-program=pigz -cvpf package.tgz ./package
tar --use-compress-program=pigz -xvpf package.tgz -C ./package

修改成中国时区

sh
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

升级 8 至 stream

sh
## 安装centos-release-stream仓库
dnf install -y centos-release-stream
## 可以使用下面命令列出所有仓库
dnf repolist
## 使用dnf的swap选项移除centos-linux-repos并安装centos-stream-repos
dnf swap centos-linux-repos centos-stream-repos
## 将已安装的软件包同步到最新的可用版本
dnf distro-sync
## 使用以下命令验证系统是否是centos-stream版本
cat /etc/centos-release

Version 4.2 (core-1.3.4)