update
This commit is contained in:
1 file changed
+68
-31
@@ -3,13 +3,13 @@ set -e
|
|||||||
|
|
||||||
OS_ARCH=$(dpkg --print-architecture) || (echo "Not Debian Based Distro" && exit 1)
|
OS_ARCH=$(dpkg --print-architecture) || (echo "Not Debian Based Distro" && exit 1)
|
||||||
OS_CODE=$(source /etc/os-release && echo "$VERSION_CODENAME")
|
OS_CODE=$(source /etc/os-release && echo "$VERSION_CODENAME")
|
||||||
OS_VERSION=""
|
OS_BRANCH=""
|
||||||
case $OS_CODE in
|
case $OS_CODE in
|
||||||
bullseye) OS_VERSION="11" ;;
|
bookworm) OS_BRANCH="debian" ;;
|
||||||
bookworm) OS_VERSION="12" ;;
|
trixie) OS_BRANCH="debian" ;;
|
||||||
trixie) OS_VERSION="13" ;;
|
noble) OS_BRANCH="ubuntu" ;;
|
||||||
esac
|
esac
|
||||||
if [ -z $OS_VERSION ]; then
|
if [ -z $OS_BRANCH ]; then
|
||||||
echo "Unsupported Debian Code: $OS_CODE" && exit 1
|
echo "Unsupported Debian Code: $OS_CODE" && exit 1
|
||||||
fi
|
fi
|
||||||
DISTRO_PVE=$($(command -v pvesh &>/dev/null) && echo 1 || echo 0)
|
DISTRO_PVE=$($(command -v pvesh &>/dev/null) && echo 1 || echo 0)
|
||||||
@@ -20,25 +20,28 @@ AWD=$(dirname "$SCRIPT")
|
|||||||
choose_sites(){
|
choose_sites(){
|
||||||
case $MIRROR_SOURCE in
|
case $MIRROR_SOURCE in
|
||||||
1)
|
1)
|
||||||
MIRROR_URL=https://mirrors.cernet.edu.cn/debian/
|
DEBIAN_URL=https://mirrors.cernet.edu.cn/debian
|
||||||
SEC_URL=https://mirrors.cernet.edu.cn/debian-security
|
DEBIAN_SEC_URL=https://mirrors.cernet.edu.cn/debian-security
|
||||||
DOCKER_URL=https://mirrors.cernet.edu.cn/docker-ce/linux/debian
|
DOCKER_DEBIAN_URL=https://mirrors.cernet.edu.cn/docker-ce/linux/debian
|
||||||
DOCKER_PGP=https://mirrors.cernet.edu.cn/docker-ce/linux/debian/gpg
|
|
||||||
PVE_URL=https://mirrors.cernet.edu.cn/proxmox/debian/pve
|
PVE_URL=https://mirrors.cernet.edu.cn/proxmox/debian/pve
|
||||||
|
UBUNTU_URL=https://mirrors.cernet.edu.cn/ubuntu
|
||||||
|
DOCKER_UBUNTU_URL=https://mirrors.cernet.edu.cn/docker-ce/linux/ubuntu
|
||||||
;;
|
;;
|
||||||
2)
|
2)
|
||||||
MIRROR_URL=https://mirrors.aliyun.com/debian/
|
DEBIAN_URL=https://mirrors.aliyun.com/debian
|
||||||
SEC_URL=https://mirrors.aliyun.com/debian-security
|
DEBIAN_SEC_URL=https://mirrors.aliyun.com/debian-security
|
||||||
DOCKER_URL=https://mirrors.aliyun.com/docker-ce/linux/debian
|
DOCKER_DEBIAN_URL=https://mirrors.aliyun.com/docker-ce/linux/debian
|
||||||
DOCKER_PGP=https://mirrors.aliyun.com/docker-ce/linux/debian/gpg
|
|
||||||
PVE_URL=https://mirrors.cernet.edu.cn/proxmox/debian/pve
|
PVE_URL=https://mirrors.cernet.edu.cn/proxmox/debian/pve
|
||||||
|
UBUNTU_URL=https://mirrors.aliyun.com/ubuntu
|
||||||
|
DOCKER_UBUNTU_URL=https://mirrors.aliyun.com/docker-ce/linux/ubuntu
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
MIRROR_URL=https://deb.debian.org/debian/
|
DEBIAN_URL=https://deb.debian.org/debian
|
||||||
SEC_URL=https://security.debian.org/debian-security
|
DEBIAN_SEC_URL=https://security.debian.org/debian-security
|
||||||
DOCKER_URL=https://download.docker.com/linux/debian
|
DOCKER_DEBIAN_URL=https://download.docker.com/linux/debian
|
||||||
DOCKER_PGP=https://download.docker.com/linux/debian/gpg
|
|
||||||
PVE_URL=http://download.proxmox.com/debian/pve
|
PVE_URL=http://download.proxmox.com/debian/pve
|
||||||
|
UBUNTU_URL=https://archive.ubuntu.com/ubuntu
|
||||||
|
DOCKER_UBUNTU_URL=https://download.docker.com/linux/ubuntu
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
@@ -49,22 +52,42 @@ set_pkg_source(){
|
|||||||
rm /etc/apt/sources.list || true
|
rm /etc/apt/sources.list || true
|
||||||
rm /etc/apt/sources.list.d/* || true
|
rm /etc/apt/sources.list.d/* || true
|
||||||
|
|
||||||
echo -e "Enabled: yes
|
if [[ $OS_BRANCH == "debian" ]]; then
|
||||||
|
echo -e "Enabled: yes
|
||||||
Types: deb
|
Types: deb
|
||||||
URIs: $MIRROR_URL
|
URIs: $DEBIAN_URL
|
||||||
Suites: $OS_CODE $OS_CODE-updates $OS_CODE-backports
|
Suites: $OS_CODE $OS_CODE-updates $OS_CODE-backports
|
||||||
Components: main contrib non-free non-free-firmware
|
Components: main contrib non-free non-free-firmware
|
||||||
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
|
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
|
||||||
Architectures: $OS_ARCH
|
Architectures: $OS_ARCH
|
||||||
|
|
||||||
Types: deb
|
Types: deb
|
||||||
URIs: $SEC_URL
|
URIs: $DEBIAN_SEC_URL
|
||||||
Suites: $OS_CODE-security
|
Suites: $OS_CODE-security
|
||||||
Components: main contrib non-free non-free-firmware
|
Components: main contrib non-free non-free-firmware
|
||||||
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
|
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
|
||||||
Architectures: $OS_ARCH
|
Architectures: $OS_ARCH
|
||||||
" | tee /etc/apt/sources.list.d/debian.sources
|
" | tee /etc/apt/sources.list.d/debian.sources
|
||||||
|
|
||||||
|
elif [[ $OS_BRANCH == "ubuntu" ]]; then
|
||||||
|
echo -e "Enabled: yes
|
||||||
|
Types: deb
|
||||||
|
URIs: $UBUNTU_URL
|
||||||
|
Suites: $OS_CODE $OS_CODE-updates $OS_CODE-backports
|
||||||
|
Components: main restricted universe multiverse
|
||||||
|
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
|
||||||
|
Architectures: $OS_ARCH
|
||||||
|
|
||||||
|
Types: deb
|
||||||
|
URIs: $UBUNTU_URL
|
||||||
|
Suites: $OS_CODE-security
|
||||||
|
Components: main restricted universe multiverse
|
||||||
|
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
|
||||||
|
Architectures: $OS_ARCH
|
||||||
|
" | tee /etc/apt/sources.list.d/ubuntu.sources
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
if ((DISTRO_PVE)); then
|
if ((DISTRO_PVE)); then
|
||||||
echo -e "Types: deb
|
echo -e "Types: deb
|
||||||
URIs: $PVE_URL
|
URIs: $PVE_URL
|
||||||
@@ -73,36 +96,50 @@ Components: pve-no-subscription
|
|||||||
Signed-By: /etc/apt/trusted.gpg.d/proxmox-release-$OS_CODE.gpg
|
Signed-By: /etc/apt/trusted.gpg.d/proxmox-release-$OS_CODE.gpg
|
||||||
" | tee /etc/apt/sources.list.d/pve-no-subscription.sources
|
" | tee /etc/apt/sources.list.d/pve-no-subscription.sources
|
||||||
else
|
else
|
||||||
echo -e "Types: deb
|
|
||||||
URIs: $DOCKER_URL
|
if [[ $OS_BRANCH == "debian" ]]; then
|
||||||
|
echo -e "Types: deb
|
||||||
|
URIs: $DOCKER_DEBIAN_URL
|
||||||
Suites: $OS_CODE
|
Suites: $OS_CODE
|
||||||
Components: stable
|
Components: stable
|
||||||
Signed-By: /etc/apt/trusted.gpg.d/docker.gpg
|
Signed-By: /etc/apt/trusted.gpg.d/docker.gpg
|
||||||
Architectures: $OS_ARCH
|
Architectures: $OS_ARCH
|
||||||
" | tee /etc/apt/sources.list.d/docker.sources
|
" | tee /etc/apt/sources.list.d/docker.sources
|
||||||
curl -fsSL $DOCKER_PGP $SET_PROXY | \
|
curl -fsSL $DOCKER_DEBIAN_URL/gpg $SET_PROXY | \
|
||||||
gpg --dearmor | tee /etc/apt/trusted.gpg.d/docker.gpg > /dev/null
|
gpg --dearmor | tee /etc/apt/trusted.gpg.d/docker.gpg > /dev/null
|
||||||
|
|
||||||
#For docker-ctop
|
#For docker-ctop
|
||||||
echo -e "Types: deb
|
echo -e "Types: deb
|
||||||
URIs: http://packages.azlux.fr/debian
|
URIs: http://packages.azlux.fr/debian
|
||||||
Suites: $OS_CODE
|
Suites: $OS_CODE
|
||||||
Components: main
|
Components: main
|
||||||
Signed-By: /etc/apt/trusted.gpg.d/azlux-archive-keyring.gpg
|
Signed-By: /etc/apt/trusted.gpg.d/azlux-archive-keyring.gpg
|
||||||
Architectures: $OS_ARCH
|
Architectures: $OS_ARCH
|
||||||
" | tee /etc/apt/sources.list.d/azlux.sources
|
" | tee /etc/apt/sources.list.d/azlux.sources
|
||||||
curl -fsSL "https://azlux.fr/repo.gpg.key" $SET_PROXY | \
|
curl -fsSL "https://azlux.fr/repo.gpg.key" $SET_PROXY | \
|
||||||
gpg --dearmor | tee /etc/apt/trusted.gpg.d/azlux-archive-keyring.gpg > /dev/null
|
gpg --dearmor | tee /etc/apt/trusted.gpg.d/azlux-archive-keyring.gpg > /dev/null
|
||||||
|
|
||||||
echo -e "Types: deb
|
echo -e "Types: deb
|
||||||
URIs: https://packagecloud.io/crowdsec/crowdsec/any/
|
URIs: https://packagecloud.io/crowdsec/crowdsec/any/
|
||||||
Suites: any
|
Suites: any
|
||||||
Components: main
|
Components: main
|
||||||
Signed-By: /etc/apt/trusted.gpg.d/crowdsec-archive-keyring.gpg
|
Signed-By: /etc/apt/trusted.gpg.d/crowdsec-archive-keyring.gpg
|
||||||
Architectures: $OS_ARCH
|
Architectures: $OS_ARCH
|
||||||
" | tee /etc/apt/sources.list.d/crowdsec.sources
|
" | tee /etc/apt/sources.list.d/crowdsec.sources
|
||||||
curl -fsSL "https://packagecloud.io/crowdsec/crowdsec/gpgkey" $SET_PROXY | \
|
curl -fsSL "https://packagecloud.io/crowdsec/crowdsec/gpgkey" $SET_PROXY | \
|
||||||
gpg --dearmor | tee /etc/apt/trusted.gpg.d/crowdsec-archive-keyring.gpg > /dev/null
|
gpg --dearmor | tee /etc/apt/trusted.gpg.d/crowdsec-archive-keyring.gpg > /dev/null
|
||||||
|
|
||||||
|
elif [[ $OS_BRANCH == "ubuntu" ]]; then
|
||||||
|
echo -e "Types: deb
|
||||||
|
URIs: $DOCKER_UBUNTU_URL
|
||||||
|
Suites: $OS_CODE
|
||||||
|
Components: stable
|
||||||
|
Signed-By: /etc/apt/trusted.gpg.d/docker.gpg
|
||||||
|
Architectures: $OS_ARCH
|
||||||
|
" | tee /etc/apt/sources.list.d/docker.sources
|
||||||
|
curl -fsSL $DOCKER_UBUNTU_URL/gpg $SET_PROXY | \
|
||||||
|
gpg --dearmor | tee /etc/apt/trusted.gpg.d/docker.gpg > /dev/null
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user