@@ -197,7 +197,7 @@ start_routines_9() {
197197
198198 # Check sources.list
199199 if [[ -f " $listfile " ]] && grep -qE ' ^\s*deb ' " $listfile " ; then
200- (( ++ LEGACY_COUNT ))
200+ (( ++ LEGACY_COUNT))
201201 fi
202202
203203 # Check .list files
@@ -289,11 +289,15 @@ EOF
289289 msg_ok " Kept 'pve-enterprise' repository"
290290 ;;
291291 disable)
292- msg_info " Disabling (commenting) 'pve-enterprise' repository"
293- # Comment out every non-comment line in the file that has 'pve-enterprise' in Components
292+ msg_info " Disabling 'pve-enterprise' repository"
293+ # Use Enabled: false instead of commenting to avoid malformed entry
294294 for file in /etc/apt/sources.list.d/* .sources; do
295295 if grep -q " Components:.*pve-enterprise" " $file " ; then
296- sed -i ' /^\s*Types:/,/^$/s/^\([^#].*\)$/# \1/' " $file "
296+ if grep -q " ^Enabled:" " $file " ; then
297+ sed -i ' s/^Enabled:.*/Enabled: false/' " $file "
298+ else
299+ echo " Enabled: false" >> " $file "
300+ fi
297301 fi
298302 done
299303 msg_ok " Disabled 'pve-enterprise' repository"
@@ -346,10 +350,15 @@ EOF
346350 msg_ok " Kept 'ceph enterprise' repository"
347351 ;;
348352 disable)
349- msg_info " Disabling (commenting) 'ceph enterprise' repository"
353+ msg_info " Disabling 'ceph enterprise' repository"
354+ # Use Enabled: false instead of commenting to avoid malformed entry
350355 for file in /etc/apt/sources.list.d/* .sources; do
351356 if grep -q " enterprise.proxmox.com.*ceph" " $file " ; then
352- sed -i ' /^\s*Types:/,/^$/s/^\([^#].*\)$/# \1/' " $file "
357+ if grep -q " ^Enabled:" " $file " ; then
358+ sed -i ' s/^Enabled:.*/Enabled: false/' " $file "
359+ else
360+ echo " Enabled: false" >> " $file "
361+ fi
353362 fi
354363 done
355364 msg_ok " Disabled 'ceph enterprise' repository"
472481 ;;
473482 no)
474483 msg_error " Selected no to Adding 'ceph package repositories'"
475- find /etc/apt/sources.list.d/ -type f \( -name " *.sources" -o -name " *.list" \) \
484+ # Use Enabled: false for .sources files, comment for .list files
485+ for file in /etc/apt/sources.list.d/* .sources; do
486+ if grep -q " enterprise.proxmox.com.*ceph" " $file " 2> /dev/null; then
487+ if grep -q " ^Enabled:" " $file " ; then
488+ sed -i ' s/^Enabled:.*/Enabled: false/' " $file "
489+ else
490+ echo " Enabled: false" >> " $file "
491+ fi
492+ fi
493+ done
494+ find /etc/apt/sources.list.d/ -type f -name " *.list" \
476495 -exec sed -i ' /enterprise.proxmox.com.*ceph/s/^/# /' {} \;
477496 msg_ok " Disabled all Ceph Enterprise repositories"
478497 ;;
@@ -491,11 +510,12 @@ EOF
491510 yes)
492511 msg_info " Adding 'pve-test' repository (deb822, disabled)"
493512 cat > /etc/apt/sources.list.d/pve-test.sources << EOF
494- # Types: deb
495- # URIs: http://download.proxmox.com/debian/pve
496- # Suites: trixie
497- # Components: pve-test
498- # Signed-By: /usr/share/keyrings/proxmox-archive-keyring.gpg
513+ Types: deb
514+ URIs: http://download.proxmox.com/debian/pve
515+ Suites: trixie
516+ Components: pve-test
517+ Signed-By: /usr/share/keyrings/proxmox-archive-keyring.gpg
518+ Enabled: false
499519EOF
500520 msg_ok " Added 'pve-test' repository"
501521 ;;
0 commit comments