[+] 增加 src 源
All checks were successful
Build Docker Image / Explore-Gitea-Actions (push) Successful in 12s

This commit is contained in:
Martin 2025-01-14 16:08:18 +08:00
parent 1158047f6f
commit 24179ff666

View File

@ -17,7 +17,11 @@ $(for suite in ${release} ${release}-updates ${release}-backports; do
echo "Suites: $suite" echo "Suites: $suite"
echo "Components: ${components}" echo "Components: ${components}"
echo "Signed-By: /usr/share/keyrings/${type}-archive-keyring.gpg" echo "Signed-By: /usr/share/keyrings/${type}-archive-keyring.gpg"
echo echo "Types: deb-src"
echo "URIs: https://mirrors.martin98.com/repository/${type}-tsinghua-${suite}/"
echo "Suites: $suite"
echo "Components: ${components}"
echo "Signed-By: /usr/share/keyrings/${type}-archive-keyring.gpg"
done) done)
EOF EOF
# 传统格式 # 传统格式
@ -26,6 +30,7 @@ elif [ -f /etc/apt/sources.list ]; then
cat > /etc/apt/sources.list <<EOF cat > /etc/apt/sources.list <<EOF
$(for suite in ${release} ${release}-updates ${release}-backports; do $(for suite in ${release} ${release}-updates ${release}-backports; do
echo "deb https://mirrors.martin98.com/repository/${type}-tsinghua-${suite}/ ${suite} ${components}" echo "deb https://mirrors.martin98.com/repository/${type}-tsinghua-${suite}/ ${suite} ${components}"
echo "deb-src https://mirrors.martin98.com/repository/${type}-tsinghua-${suite}/ ${suite} ${components}"
done) done)
EOF EOF
else else
@ -41,21 +46,22 @@ apt update && apt upgrade -y
# NTP # NTP
# 启用阿里云 ntp # 启用阿里云 ntp
apt install chrony -y if pidof systemd >/dev/null 2>&1; then
cat > /etc/chrony.conf <<EOF apt install chrony -y
cat > /etc/chrony.conf <<EOF
server ntp4.aliyun.com minpoll 4 maxpoll 10 iburst server ntp4.aliyun.com minpoll 4 maxpoll 10 iburst
server ntp5.aliyun.com iburst server ntp5.aliyun.com iburst
driftfile /var/lib/chrony/drift driftfile /var/lib/chrony/drift
allow 127.0.0.1 allow 127.0.0.1
EOF EOF
if pidof systemd >/dev/null 2>&1; then
systemctl restart chrony && systemctl enable chrony systemctl restart chrony && systemctl enable chrony
else else
echo "systemctl 不存在,跳过 chrony 的重启" echo "systemctl 不存在,跳过 chrony 的重启"
fi fi
# fix vim 粘贴 # fix vim 粘贴
if ! grep -q "set pastetoggle=" ~/.vimrc; then if pidof vim >/dev/null 2>&1; then
echo "set pastetoggle=" >> ~/.vimrc if ! grep -q "set pastetoggle=" ~/.vimrc; then
echo "set pastetoggle=" >> ~/.vimrc
fi
fi fi