基础安装
alias useproxy="
export http_proxy=http://10.0.2.2:2080;
export https_proxy=http://10.0.2.2:2080;
export all_proxy=http://10.0.2.2:2080;
"
alias unproxy="
unset http_proxy;
unset https_proxy;
unset all_proxy;
"
## 移除多于内核
echo "-- BEFORE --";rpm -qa | grep ^kernel; rpm -qa |grep ^kernel |grep -E -v `uname -r` |xargs rpm -e --nodeps; echo "--- AFTER ---"; rpm -qa | grep ^kernel
rpm -qa|grep kernel
dnf install epel-release nano net-tools htop -y
dnf install langpacks-en glibc-all-langpacks -y
dnf install langpacks-en glibc-all-langpacks -y
localectl list-locales | grep zh
localectl set-locale LANG="zh_CN.utf8"
localectl status
dnf groupinstall 'Development Tools' -y
dnf install cmake -y
# 搜索文件Pkg
yum provides "*/pg_config"
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
cargo install fd-find
cargo install ripgrep
cargo install lsd
关闭SELinux
Docker安装
dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
dnf install docker-ce docker-ce-cli containerd.io
systemctl enable --now docker
systemctl status docker
Doacker安装MariaDB
mkdir -p /opt/docker/mariadb
docker run --name mariadb --restart=always -e MYSQL_ROOT_PASSWORD=root -v /opt/docker/mariadb:/var/lib/mysql -p 3306:3306 -d mariadb:10.11.2
Doacker安装Redis
mkdir -p /opt/docker/redis
docker run -itd --name redis --restart=always -v /opt/docker/redis:/data -p 6379:6379 redis:7.0.10
docker ps
Doacker安装PostgreSQL(无中文字符集,中文排序不对)
mkdir -p /opt/docker/postgresql
docker run --name postgres --restart=always -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -v /opt/docker/postgresql:/var/lib/postgresql/data -p 5432:5432 -d postgres:15.2
docker ps
docker exec -it postgres bash
# 启动失败时 查看日志
docker inspect --format '{{.LogPath}}' 6343f20e07f9
cat /var/lib/docker/containers/6343f20e07f905de0c53008e11659c82127447f07acc79923574fc72ea4cda29/6343f20e07f905de0c53008e11659c82127447f07acc79923574fc72ea4cda29-json.log
docker exec -it postgres bash
docker stop 6343f20e07f9
docker rm 6343f20e07f9
MariaDB
设置软件源并安装