From 06e6105df67a95cd9c1ab33005d7da8beaab3e7a Mon Sep 17 00:00:00 2001 From: whyour Date: Sun, 30 Jun 2024 13:39:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20apt=20=E5=91=BD=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- back/config/const.ts | 16 ++++++++-------- back/config/util.ts | 4 ++-- back/data/dependence.ts | 2 +- docker/310.Dockerfile | 12 ++++++------ docker/Dockerfile | 12 ++++++------ shell/bot.sh | 2 +- shell/start.sh | 4 ++-- 7 files changed, 26 insertions(+), 26 deletions(-) diff --git a/back/config/const.ts b/back/config/const.ts index 5a6830d2..786e29a9 100644 --- a/back/config/const.ts +++ b/back/config/const.ts @@ -36,19 +36,19 @@ export const LINUX_DEPENDENCE_COMMAND: Record< } > = { Debian: { - install: 'apt install -y', - uninstall: 'apt remove -y', - info: 'apt info', + install: 'apt-get install -y', + uninstall: 'apt-get remove -y', + info: 'dpkg-query -s', check(info: string) { - return info.includes('apt-manual-installed'); + return info.includes('install ok installed'); }, }, Ubuntu: { - install: 'apt install -y', - uninstall: 'apt remove -y', - info: 'apt info', + install: 'apt-get install -y', + uninstall: 'apt-get remove -y', + info: 'dpkg-query -s', check(info: string) { - return info.includes('apt-manual-installed'); + return info.includes('install ok installed'); }, }, Alpine: { diff --git a/back/config/util.ts b/back/config/util.ts index ebb01f45..a8da0ccc 100644 --- a/back/config/util.ts +++ b/back/config/util.ts @@ -649,7 +649,7 @@ async function _updateLinuxMirror( currentDomainWithScheme, mirrorDomainWithScheme || 'http://deb.debian.org', ); - return 'apt update'; + return 'apt-get update'; } else { throw Error(`Current mirror domain not found.`); } @@ -662,7 +662,7 @@ async function _updateLinuxMirror( currentDomainWithScheme, mirrorDomainWithScheme || 'http://archive.ubuntu.com', ); - return 'apt update'; + return 'apt-get update'; } else { throw Error(`Current mirror domain not found.`); } diff --git a/back/data/dependence.ts b/back/data/dependence.ts index 15d993a2..685c1e71 100644 --- a/back/data/dependence.ts +++ b/back/data/dependence.ts @@ -44,7 +44,7 @@ export enum DependenceTypes { export enum GetDependenceCommandTypes { 'pnpm ls -g ', 'pip3 show --disable-pip-version-check', - 'apt info', + 'apt-get info', } export enum versionDependenceCommandTypes { diff --git a/docker/310.Dockerfile b/docker/310.Dockerfile index 74aca74c..d7fce102 100644 --- a/docker/310.Dockerfile +++ b/docker/310.Dockerfile @@ -6,8 +6,8 @@ COPY --from=nodebuilder /usr/local/bin/node /usr/local/bin/ COPY --from=nodebuilder /usr/local/lib/node_modules/. /usr/local/lib/node_modules/ RUN set -x && \ ln -s /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm && \ - apt update && \ - apt install --no-install-recommends -y libatomic1 && \ + apt-get update && \ + apt-get install --no-install-recommends -y libatomic1 && \ npm i -g pnpm@8.3.1 && \ cd /tmp/build && \ pnpm install --prod @@ -31,9 +31,9 @@ COPY --from=nodebuilder /usr/local/lib/node_modules/. /usr/local/lib/node_module RUN set -x && \ ln -s /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm && \ - apt update && \ - apt upgrade -y && \ - apt install --no-install-recommends -y git \ + apt-get update && \ + apt-get upgrade -y && \ + apt-get install --no-install-recommends -y git \ curl \ wget \ tzdata \ @@ -46,7 +46,7 @@ RUN set -x && \ netcat \ unzip \ libatomic1 && \ - apt clean && \ + apt-get clean && \ ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \ echo "Asia/Shanghai" >/etc/timezone && \ git config --global user.email "qinglong@users.noreply.github.com" && \ diff --git a/docker/Dockerfile b/docker/Dockerfile index 57686f94..06b05ec8 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -6,8 +6,8 @@ COPY --from=nodebuilder /usr/local/bin/node /usr/local/bin/ COPY --from=nodebuilder /usr/local/lib/node_modules/. /usr/local/lib/node_modules/ RUN set -x && \ ln -s /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm && \ - apt update && \ - apt install --no-install-recommends -y libatomic1 && \ + apt-get update && \ + apt-get install --no-install-recommends -y libatomic1 && \ npm i -g pnpm@8.3.1 && \ cd /tmp/build && \ pnpm install --prod @@ -32,9 +32,9 @@ COPY --from=nodebuilder /usr/local/lib/node_modules/. /usr/local/lib/node_module RUN set -x && \ ln -s /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm && \ ln -s /usr/local/lib/node_modules/npm/bin/npx-cli.js /usr/local/bin/npx && \ - apt update && \ - apt upgrade -y && \ - apt install --no-install-recommends -y git \ + apt-get update && \ + apt-get upgrade -y && \ + apt-get install --no-install-recommends -y git \ curl \ wget \ tzdata \ @@ -47,7 +47,7 @@ RUN set -x && \ netcat \ unzip \ libatomic1 && \ - apt clean && \ + apt-get clean && \ ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \ echo "Asia/Shanghai" >/etc/timezone && \ git config --global user.email "qinglong@users.noreply.github.com" && \ diff --git a/shell/bot.sh b/shell/bot.sh index 7656901e..f0d1e4a6 100755 --- a/shell/bot.sh +++ b/shell/bot.sh @@ -13,7 +13,7 @@ os_name=$(source /etc/os-release && echo "$ID") if [[ $os_name == 'alpine' ]]; then apk --no-cache add -f zlib-dev gcc jpeg-dev python3-dev musl-dev freetype-dev elif [[ $os_name == 'debian' ]] || [[ $os_name == 'ubuntu' ]]; then - apt install -y gcc python3-dev musl-dev + apt-get install -y gcc python3-dev musl-dev else echo -e "暂不支持此系统 $os_name" exit 1 diff --git a/shell/start.sh b/shell/start.sh index 57ad3689..2758c073 100644 --- a/shell/start.sh +++ b/shell/start.sh @@ -46,8 +46,8 @@ if [[ $os_name == 'alpine' ]]; then procps \ netcat-openbsd elif [[ $os_name == 'debian' ]] || [[ $os_name == 'ubuntu' ]]; then - apt update - apt install -y git curl wget tzdata perl openssl jq nginx procps netcat-openbsd openssh-client + apt-get update + apt-get install -y git curl wget tzdata perl openssl jq nginx procps netcat-openbsd openssh-client else echo -e "暂不支持此系统部署 $os_name" exit 1