新增arch安装软件

This commit is contained in:
lsy 2024-09-22 23:02:07 +08:00
parent 0d8d1133ec
commit 7822f5b316

View File

@ -2,6 +2,7 @@
declare install_str declare install_str
declare version="$(cat /etc/os-release | grep "^ID" | awk -F '=' '{print $2}')" declare version="$(cat /etc/os-release | grep "^ID" | awk -F '=' '{print $2}')"
declare status=0
declare pkg declare pkg
if [[ -f "/usr/bin/apt-get" ]];then if [[ -f "/usr/bin/apt-get" ]];then
@ -12,6 +13,10 @@ elif [[ -f "/usr/bin/apt" ]];then
pkg='apt' pkg='apt'
install_str+="${pkg} install -y" install_str+="${pkg} install -y"
sudo apt update -y sudo apt update -y
elif [[ -f "/usr/bin/pacman" ]];then
pkg='pacman'
install_str+="${pkg} -Sy --noconfirm"
sudo pacman -Syu --noconfirm
else else
echo "暂不支持该系统一键安装常用软件" echo "暂不支持该系统一键安装常用软件"
exit exit
@ -75,7 +80,6 @@ fi
if [[ ! $pick_x =~ [Nn] ]];then if [[ ! $pick_x =~ [Nn] ]];then
eval "$(curl https://get.x-cmd.com)" eval "$(curl https://get.x-cmd.com)"
fi fi
@ -98,6 +102,12 @@ if [[ ! $pick_docker =~ [Nn] ]];then
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo ${pkg} update sudo ${pkg} update
sudo ${pkg} install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y sudo ${pkg} install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y
elif [[ ${pkg} == 'arch' ]];then
sudo pacman -Sy docker --noconfirm
sudo systemctl start docker.service
sudo systemctl enable docker.service
sudo usermod -aG docker $USER
newgrp docker
fi fi
fi fi