update
This commit is contained in:
commit
b8233471ab
5 files changed
+153
No files matched your search
@@ -0,0 +1,53 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
mirror_site="mirrors.tuna.tsinghua.edu.cn"
|
||||
#mirror_site="mirrors.ustc.edu.cn"
|
||||
packages_base="packages-base.txt"
|
||||
packages_addon="packages-addon.txt"
|
||||
|
||||
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 -f "$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
|
||||
|
||||
|
||||
$command update
|
||||
test -f "$packages_addon"
|
||||
xargs -a <(awk '! /^ *(#|$)/' "$packages_addon") -r $command install
|
||||
|
||||
cp .zshrc $HOME
|
||||
|
||||
Reference in new issue
Block a user