aboutsummaryrefslogtreecommitdiff
path: root/docker/debian-dev/bootstrap/setup-apt.bash
diff options
context:
space:
mode:
authorYuqian Yang <crupest@crupest.life>2025-02-22 18:11:35 +0800
committerYuqian Yang <crupest@crupest.life>2025-02-23 01:36:11 +0800
commit1e9b2436eaffa4130f6a69c3a108f6feb9dd4ac8 (patch)
tree585b6124b0100371b4bd8a291c4a59fbb5fbf1fe /docker/debian-dev/bootstrap/setup-apt.bash
parenta931457d61b053682d5e89a0cfb411e43e5e21c7 (diff)
downloadcrupest-1e9b2436eaffa4130f6a69c3a108f6feb9dd4ac8.tar.gz
crupest-1e9b2436eaffa4130f6a69c3a108f6feb9dd4ac8.tar.bz2
crupest-1e9b2436eaffa4130f6a69c3a108f6feb9dd4ac8.zip
feat(services): refactor structure.
Diffstat (limited to 'docker/debian-dev/bootstrap/setup-apt.bash')
-rwxr-xr-xdocker/debian-dev/bootstrap/setup-apt.bash41
1 files changed, 0 insertions, 41 deletions
diff --git a/docker/debian-dev/bootstrap/setup-apt.bash b/docker/debian-dev/bootstrap/setup-apt.bash
deleted file mode 100755
index 38cba05..0000000
--- a/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!"