update
This commit is contained in:
1 parent
a315252924
commit
adf8c793df
4 files changed
+96
-60
No files matched your search
@@ -1,11 +1,6 @@
|
||||
#!/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=""
|
||||
@@ -14,52 +9,101 @@ case $OS_CODE in
|
||||
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
|
||||
configure(){
|
||||
cp .zshrc $HOME
|
||||
usermod -s /usr/bin/zsh $(whoami)
|
||||
|
||||
sed -i -r "/.*HashKnownHosts.*/d" /etc/ssh/ssh_config
|
||||
sed -i -r "/.*HostKeyAlgorithms.*/d" /etc/ssh/ssh_config
|
||||
sed -i -r "/.*PubkeyAcceptedKeyTypes.*/d" /etc/ssh/ssh_config
|
||||
echo " HashKnownHosts no" >> /etc/ssh/ssh_config
|
||||
echo " HostKeyAlgorithms ssh-ed25519,ssh-rsa" >> /etc/ssh/ssh_config
|
||||
echo " PubkeyAcceptedKeyTypes ssh-ed25519,ssh-rsa" >> /etc/ssh/ssh_config
|
||||
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
|
||||
sed -i -r "/.*HashKnownHosts.*/d" /etc/ssh/ssh_config
|
||||
sed -i -r "/.*HostKeyAlgorithms.*/d" /etc/ssh/ssh_config
|
||||
sed -i -r "/.*PubkeyAcceptedKeyTypes.*/d" /etc/ssh/ssh_config
|
||||
echo " HashKnownHosts no" >> /etc/ssh/ssh_config
|
||||
echo " HostKeyAlgorithms ssh-ed25519,ssh-rsa" >> /etc/ssh/ssh_config
|
||||
echo " PubkeyAcceptedKeyTypes ssh-ed25519,ssh-rsa" >> /etc/ssh/ssh_config
|
||||
|
||||
command="nala"
|
||||
apt update
|
||||
apt install $command || command="apt"
|
||||
test -r "$packages_base"
|
||||
xargs -a <(awk '! /^ *(#|$)/' "$packages_base") -r $command install
|
||||
mirror_site=mirrors.tuna.tsinghua.edu.cn
|
||||
#mirror_site=mirrors.ustc.edu.cn
|
||||
sec_site=$mirror_site
|
||||
docker_source=https://$mirror_site/docker-ce/linux/debian
|
||||
if [ $ORIGINAL_SOURCE -eq 1 ]; then
|
||||
mirror_site="deb.debian.org"
|
||||
sec_site="security.debian.org"
|
||||
docker_source=https://download.docker.com/linux/debian
|
||||
fi;
|
||||
|
||||
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://$sec_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"
|
||||
$command install ca-certificates curl gnupg lsb-release
|
||||
|
||||
|
||||
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
|
||||
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 [arch=$OS_ARCH] $docker_source $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
|
||||
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
|
||||
install_pkg(){
|
||||
command="nala"
|
||||
command -v $command &>/dev/null || command="apt"
|
||||
$command update
|
||||
test -r "$PKG_BASE"
|
||||
xargs -a <(awk '! /^ *(#|$)/' "$PKG_BASE") -r $command install
|
||||
}
|
||||
|
||||
cp .zshrc $HOME
|
||||
usermod -s /usr/bin/zsh $(whoami)
|
||||
usage(){
|
||||
echo "Usage: $0 [OPTIONS]";
|
||||
echo "Options:";
|
||||
echo " -f <PACKAGES> package list file (default: $PKG_BASE)";
|
||||
echo " -i install only";
|
||||
echo " -o original apt source";
|
||||
}
|
||||
|
||||
PKG_BASE="packages-base"
|
||||
INSTALL_ONLY=0;
|
||||
ORIGINAL_SOURCE=0;
|
||||
while getopts ":f:io" OPT; do
|
||||
case $OPT in
|
||||
f)
|
||||
PKG_BASE=$OPTARG;
|
||||
;;
|
||||
i)
|
||||
INSTALL_ONLY=1;
|
||||
;;
|
||||
o)
|
||||
ORIGINAL_SOURCE=1;
|
||||
;;
|
||||
?)
|
||||
echo "Invalid Option: -$OPTARG";
|
||||
usage;
|
||||
exit 1;;
|
||||
esac;
|
||||
done;
|
||||
|
||||
if [ $INSTALL_ONLY -eq 0 ]; then
|
||||
configure;
|
||||
fi;
|
||||
install_pkg;
|
||||
@@ -1,5 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
test -r "$1"
|
||||
xargs -a <(awk '! /^ *(#|$)/' "$1") -r nala install
|
||||
@@ -1,7 +0,0 @@
|
||||
zsh-completions
|
||||
docker-ce
|
||||
docker-ce-cli
|
||||
containerd.io
|
||||
docker-buildx-plugin
|
||||
docker-compose-plugin
|
||||
speedtest
|
||||
+9
-5
@@ -1,7 +1,3 @@
|
||||
ca-certificates
|
||||
curl
|
||||
gnupg
|
||||
lsb-release
|
||||
traceroute
|
||||
bridge-utils
|
||||
bind9-dnsutils
|
||||
@@ -14,7 +10,15 @@ fd-find
|
||||
exa
|
||||
bat
|
||||
fzf
|
||||
netcat-openbsd
|
||||
zsh
|
||||
zsh-autosuggestions
|
||||
zsh-syntax-highlighting
|
||||
|
||||
iperf3
|
||||
zsh-completions
|
||||
docker-ce
|
||||
docker-ce-cli
|
||||
containerd.io
|
||||
docker-buildx-plugin
|
||||
docker-compose-plugin
|
||||
speedtest
|
||||
Reference in new issue
Block a user