From 8eaf15281dcf416839b3d2cb6dd23c353e575b42 Mon Sep 17 00:00:00 2001 From: iridiumR <88495501+1ridic@users.noreply.github.com> Date: Sat, 21 Jan 2023 20:53:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20Arch=20=E7=9A=84=E5=AE=89?= =?UTF-8?q?=E8=A3=85=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Arch 的官方源中不含有`yay`,安装脚本亦没有检查`base-devel`包和`git`包是否存在,正确方法是克隆仓库后使用`makepkg`安装`libselinux` --- script/install.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/script/install.sh b/script/install.sh index d29c778..04d0c1c 100755 --- a/script/install.sh +++ b/script/install.sh @@ -131,7 +131,10 @@ install_arch(){ [yY][eE][sS] | [yY]) useradd -m nezha-agent sed -i "$ a\nezha-agent ALL=(ALL ) NOPASSWD:ALL" /etc/sudoers - sudo -iu nezha-agent yay -S libselinux --noconfirm + sudo -iu nezha-agent bash -c 'gpg --keyserver keys.gnupg.net --recv-keys BE22091E3EF62275; + cd /tmp; git clone https://aur.archlinux.org/libsepol.git; cd libsepol; makepkg -si --noconfirm --asdeps; cd ..; + git clone https://aur.archlinux.org/libselinux.git; cd libselinux; makepkg -si --noconfirm; cd ..; + rm -rf libsepol libselinux' sed -i '/nezha-agent/d' /etc/sudoers && sleep 30s && killall -u nezha-agent&&userdel nezha-agent echo -e "${red}提示: ${plain}已删除用户nezha-agent,请务必手动核查一遍!\n" ;; @@ -148,7 +151,7 @@ install_arch(){ install_soft() { (command -v yum >/dev/null 2>&1 && yum makecache && yum install $* selinux-policy -y) || (command -v apt >/dev/null 2>&1 && apt update && apt install $* selinux-utils -y) || - (command -v pacman >/dev/null 2>&1 && pacman -Syu $* yay --noconfirm && install_arch) || + (command -v pacman >/dev/null 2>&1 && pacman -Syu $* base-devel git --noconfirm && install_arch) || (command -v apt-get >/dev/null 2>&1 && apt-get update && apt-get install $* selinux-utils -y) || (command -v apk >/dev/null 2>&1 && apk update && apk add $* -f) }