From 53b2249ce5f80ac76c1cf8b05c2ab67569a1df71 Mon Sep 17 00:00:00 2001 From: sjlleo Date: Wed, 25 May 2022 08:13:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=B0=9D=E8=AF=95=E6=80=A7=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E9=83=A8=E5=88=86=20CentOS=206=E3=80=81Debian8=20?= =?UTF-8?q?=E4=B8=8B=20wget=20=E5=AE=89=E8=A3=85=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nt_install.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/nt_install.sh b/nt_install.sh index 5643e5c..b9e34e7 100644 --- a/nt_install.sh +++ b/nt_install.sh @@ -52,11 +52,12 @@ installWgetPackage() { # macOS should install wget originally. Nothing to do echo "wget 正在安装中..." # try apt - apt-get -h &>/dev/null + # 是时候直接使用 APT 来管理包了 + apt -h &>/dev/null if [ $? -eq 0 ]; then # 先更新一下数据源,有些机器数据源比较老可能会404 - apt-get update -y &>/dev/null - apt-get install wget -y &>/dev/null + apt update -y &>/dev/null + apt install wget -y &>/dev/null fi # try yum @@ -79,8 +80,9 @@ installWgetPackage() { pacman -Sy &>/dev/null pacman -S wget &>/dev/null fi - - wget -h &>/dev/null + + # 有的发行版自带的wget,只有 --help 参数 + wget --help &>/dev/null if [ $? -ne 0 ]; then echo "wget 安装失败" exit 1