59 lines
2.2 KiB
Bash
Executable File
59 lines
2.2 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -e
|
|
|
|
mirror_site="mirrors.tuna.tsinghua.edu.cn"
|
|
#mirror_site="mirrors.ustc.edu.cn"
|
|
packages_base="packages-base"
|
|
packages_addon="packages-addon"
|
|
|
|
OS_ARCH=$(dpkg --print-architecture)
|
|
OS_CODE=$(. /etc/os-release && echo "$VERSION_CODENAME")
|
|
OS_VERSION=""
|
|
case $OS_CODE in
|
|
bullseye) OS_VERSION="11" ;;
|
|
bookworm) OS_VERSION="12" ;;
|
|
esac
|
|
|
|
sed -i -r "s/.*set tabsize.*/set tabsize 4/g" /etc/nanorc
|
|
sed -i -r "s/.*set tabstospaces.*/set tabstospaces/g" /etc/nanorc
|
|
|
|
echo -e "deb https://$mirror_site/debian/ $OS_CODE main contrib non-free non-free-firmware
|
|
deb https://$mirror_site/debian/ $OS_CODE-updates main contrib non-free non-free-firmware
|
|
deb https://$mirror_site/debian/ $OS_CODE-backports main contrib non-free non-free-firmware
|
|
deb https://$mirror_site/debian-security $OS_CODE-security main contrib non-free non-free-firmware
|
|
" | tee /etc/apt/sources.list
|
|
|
|
command="nala"
|
|
apt update
|
|
apt install $command || command="apt"
|
|
test -r "$packages_base"
|
|
xargs -a <(awk '! /^ *(#|$)/' "$packages_base") -r $command install
|
|
|
|
|
|
if [[ $OS_VERSION=="12" ]]; then
|
|
OS_VERSION="Testing"
|
|
fi
|
|
echo "deb http://download.opensuse.org/repositories/shells:/zsh-users:/zsh-completions/Debian_$OS_VERSION/ /" | \
|
|
tee /etc/apt/sources.list.d/shells:zsh-users:zsh-completions.list
|
|
curl -fsSL "https://download.opensuse.org/repositories/shells:zsh-users:zsh-completions/Debian_$OS_VERSION/Release.key" | \
|
|
gpg --dearmor | tee /etc/apt/trusted.gpg.d/shells_zsh-users_zsh-completions.gpg > /dev/null
|
|
|
|
|
|
echo "deb [arch=$OS_ARCH] https://$mirror_site/docker-ce/linux/debian $OS_CODE stable" | \
|
|
tee /etc/apt/sources.list.d/docker.list
|
|
curl -fsSL "https://download.docker.com/linux/debian/gpg" | \
|
|
gpg --dearmor | tee /etc/apt/trusted.gpg.d/docker.gpg > /dev/null
|
|
|
|
|
|
echo "deb https://packagecloud.io/ookla/speedtest-cli/debian/ $OS_CODE main" | \
|
|
tee /etc/apt/sources.list.d/ookla_speedtest-cli.list
|
|
curl -fsSL "https://packagecloud.io/ookla/speedtest-cli/gpgkey" | \
|
|
gpg --dearmor | tee /etc/apt/trusted.gpg.d/ookla_speedtest-cli-archive-keyring.gpg > /dev/null
|
|
|
|
$command update
|
|
test -r "$packages_addon"
|
|
xargs -a <(awk '! /^ *(#|$)/' "$packages_addon") -r $command install
|
|
|
|
cp .zshrc $HOME
|
|
usermod -s /usr/bin/zsh $(whoami)
|