From 384004df740b2fbd1df7127814107c9be2c20840 Mon Sep 17 00:00:00 2001 From: Super Manito <68613938+SuperManito@users.noreply.github.com> Date: Sat, 6 Sep 2025 02:55:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ChangeMirrors.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/ChangeMirrors.sh b/ChangeMirrors.sh index 5d878ab..a5f4a78 100755 --- a/ChangeMirrors.sh +++ b/ChangeMirrors.sh @@ -1,6 +1,6 @@ #!/bin/bash ## Author: SuperManito -## Modified: 2025-09-04 +## Modified: 2025-09-06 ## License: MIT ## GitHub: https://github.com/SuperManito/LinuxMirrors ## Website: https://linuxmirrors.cn @@ -1505,9 +1505,19 @@ function remove_original_mirrors() { USE_DEB822_FORMAT="true" fi # /etc/apt/sources.list - if [[ "${USE_DEB822_FORMAT}" != "true" && "${SYSTEM_JUDGMENT}" != "${SYSTEM_LINUX_MINT}" ]]; then + if [[ "${USE_DEB822_FORMAT}" != "true" ]] && [[ "${SYSTEM_JUDGMENT}" != "${SYSTEM_LINUX_MINT}" ]]; then [ -s "${File_AptSourceList}" ] && clear_file $File_AptSourceList fi + ## 解决软件源冲突 + if [[ "${USE_DEB822_FORMAT}" == "true" ]] && [ -s "${File_AptSourceList}" ]; then + if [[ "${SOURCE_BRANCH}" ]]; then + sed -e "/^deb\(-src\)\? http.*\/${SOURCE_BRANCH}/d" \ + -e "/^#[[:space:]]*deb\(-src\)\? http.*\/${SOURCE_BRANCH}/d" \ + -e "/^#.*\(默认禁用源码镜像以提高更新速度\|安全更新软件源\|预发布软件源\).*/d" \ + -i \ + $File_AptSourceList + fi + fi # Armbian [ -f "${File_ArmbianRelease}" ] && clear_file $File_ArmbianSourceList # Proxmox VE