mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-09-21 11:55:53 +02:00
tools.func: never delete ubuntu.sources (or other distro base sources) as orphaned
This commit is contained in:
+4
-3
@@ -2040,8 +2040,9 @@ cleanup_orphaned_sources() {
|
|||||||
local basename_file
|
local basename_file
|
||||||
basename_file=$(basename "$sources_file")
|
basename_file=$(basename "$sources_file")
|
||||||
|
|
||||||
# NEVER remove debian.sources - this is the standard Debian repository
|
# NEVER remove the distro's own base sources file (debian.sources,
|
||||||
if [[ "$basename_file" == "debian.sources" ]]; then
|
# ubuntu.sources, ...)
|
||||||
|
if [[ "$basename_file" == "$(get_os_info id).sources" ]]; then
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -2113,7 +2114,7 @@ ensure_apt_working() {
|
|||||||
# Step 4: More aggressive - remove all third-party sources
|
# Step 4: More aggressive - remove all third-party sources
|
||||||
msg_warn "APT update still failing, removing third-party sources"
|
msg_warn "APT update still failing, removing third-party sources"
|
||||||
find /etc/apt/sources.list.d/ -type f \( -name "*.sources" -o -name "*.list" \) \
|
find /etc/apt/sources.list.d/ -type f \( -name "*.sources" -o -name "*.list" \) \
|
||||||
! -name "debian.sources" -delete 2>/dev/null || true
|
! -name "$(get_os_info id).sources" -delete 2>/dev/null || true
|
||||||
|
|
||||||
# Final attempt
|
# Final attempt
|
||||||
if ! $STD apt update; then
|
if ! $STD apt update; then
|
||||||
|
|||||||
Reference in New Issue
Block a user