diff options
author | Yuqian Yang <crupest@outlook.com> | 2025-06-29 15:07:57 +0800 |
---|---|---|
committer | Yuqian Yang <crupest@outlook.com> | 2025-06-29 15:08:47 +0800 |
commit | a123d4266935ff9d75a8e32dd29ee965e9eb4d50 (patch) | |
tree | b5bc36630c747f1311b4e4f8f7b6fb489dd59640 /services/docker/debian-dev/bootstrap/setup-apt.bash | |
parent | 50299600c0134f00c7f8e4fe6b599987596c6dc5 (diff) | |
download | crupest-a123d4266935ff9d75a8e32dd29ee965e9eb4d50.tar.gz crupest-a123d4266935ff9d75a8e32dd29ee965e9eb4d50.tar.bz2 crupest-a123d4266935ff9d75a8e32dd29ee965e9eb4d50.zip |
debian-dev: refactor all.
Diffstat (limited to 'services/docker/debian-dev/bootstrap/setup-apt.bash')
-rwxr-xr-x | services/docker/debian-dev/bootstrap/setup-apt.bash | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/services/docker/debian-dev/bootstrap/setup-apt.bash b/services/docker/debian-dev/bootstrap/setup-apt.bash deleted file mode 100755 index 38cba05..0000000 --- a/services/docker/debian-dev/bootstrap/setup-apt.bash +++ /dev/null @@ -1,41 +0,0 @@ -#! /usr/bin/env bash -# shellcheck disable=1090,1091 - -set -e - -if [[ $EUID -ne 0 ]]; then - die "This script must be run as root." -fi - -script_dir=$(dirname "$0") - -old_one="/etc/apt/sources.list" -new_one="/etc/apt/sources.list.d/debian.sources" - -echo "Setup apt sources ..." - -echo "Backup old ones to .bak ..." -if [[ -f "$old_one" ]]; then - mv "$old_one" "$old_one.bak" -fi - -if [[ -f "$new_one" ]]; then - mv "$new_one" "$new_one.bak" -fi - -echo "Copy the new one ..." -cp "$script_dir/official.sources" "$new_one" - -if [[ -n "$CRUPEST_DEBIAN_DEV_IN_CHINA" ]]; then - echo "Replace with China mirror ..." - china_mirror="mirrors.ustc.edu.cn" - sed -i "s|deb.debian.org|${china_mirror}|" "$new_one" -fi - -echo "Try to use https ..." -apt-get update -apt-get install -y apt-transport-https ca-certificates - -sed -i 's|http://|https://|' "$new_one" - -echo "APT source setup done!" |