|
1 | 1 | #!/bin/bash |
2 | 2 | ## Author: SuperManito |
3 | | -## Modified: 2026-01-04 |
| 3 | +## Modified: 2026-01-16 |
4 | 4 | ## License: MIT |
5 | 5 | ## GitHub: https://github.com/SuperManito/LinuxMirrors |
6 | 6 | ## Website: https://linuxmirrors.cn |
@@ -252,7 +252,12 @@ File_ArmbianSourceList=$Dir_AptAdditionalSources/armbian.list |
252 | 252 | File_ArmbianSourceListBackup=$File_ArmbianSourceList.bak |
253 | 253 | File_ProxmoxSourceList=$Dir_AptAdditionalSources/pve-no-subscription.list |
254 | 254 | File_ProxmoxSourceListBackup=$File_ProxmoxSourceList.bak |
255 | | -File_ProxmoxAPLInfo=/usr/share/perl5/PVE/APLInfo.pm |
| 255 | +File_ProxmoxSources=$Dir_AptAdditionalSources/pve-no-subscription.sources |
| 256 | +File_ProxmoxSourcesBackup=$File_ProxmoxSources.bak |
| 257 | +File_ProxmoxCephSourceList=$Dir_AptAdditionalSources/ceph.list |
| 258 | +File_ProxmoxCephSourceListBackup=$File_ProxmoxCephSourceList.bak |
| 259 | +File_ProxmoxCephSources=$Dir_AptAdditionalSources/ceph.sources |
| 260 | +File_ProxmoxCephSourcesBackup=$File_ProxmoxCephSources.bak |
256 | 261 | File_LinuxMintSourceList=$Dir_AptAdditionalSources/official-package-repositories.list |
257 | 262 | File_LinuxMintSourceListBackup=$File_LinuxMintSourceList.bak |
258 | 263 | File_RaspberryPiSourceList=$Dir_AptAdditionalSources/raspi.list |
@@ -1540,7 +1545,13 @@ function backup_original_mirrors() { |
1540 | 1545 | fi |
1541 | 1546 | # Proxmox VE |
1542 | 1547 | if [ -f "${File_ProxmoxVersion}" ]; then |
1543 | | - backup_file $File_ProxmoxSourceList $File_ProxmoxSourceListBackup "pve-no-subscription.list" |
| 1548 | + if [[ "${USE_DEB822_FORMAT}" == "true" ]]; then |
| 1549 | + backup_file $File_ProxmoxSources $File_ProxmoxSourcesBackup "pve-no-subscription.sources" |
| 1550 | + [ -f "${File_ProxmoxCephSources}" ] && backup_file $File_ProxmoxCephSources $File_ProxmoxCephSourcesBackup "ceph.sources" |
| 1551 | + else |
| 1552 | + backup_file $File_ProxmoxSourceList $File_ProxmoxSourceListBackup "pve-no-subscription.list" |
| 1553 | + [ -f "${File_ProxmoxCephSourceList}" ] && backup_file $File_ProxmoxCephSourceList $File_ProxmoxCephSourceListBackup "ceph.list" |
| 1554 | + fi |
1544 | 1555 | fi |
1545 | 1556 | # Linux Mint |
1546 | 1557 | if [[ "${SYSTEM_JUDGMENT}" == "${SYSTEM_LINUX_MINT}" ]]; then |
@@ -1625,7 +1636,15 @@ function remove_original_mirrors() { |
1625 | 1636 | # Armbian |
1626 | 1637 | [ -f "${File_ArmbianRelease}" ] && clear_file $File_ArmbianSourceList |
1627 | 1638 | # Proxmox VE |
1628 | | - [ -f "${File_ProxmoxVersion}" ] && clear_file $File_ProxmoxSourceList |
| 1639 | + if [ -f "${File_ProxmoxVersion}" ]; then |
| 1640 | + if [[ "${USE_DEB822_FORMAT}" == "true" ]]; then |
| 1641 | + clear_file $File_ProxmoxSources |
| 1642 | + [ -f "${File_ProxmoxCephSources}" ] && clear_file $File_ProxmoxCephSources |
| 1643 | + else |
| 1644 | + clear_file $File_ProxmoxSourceList |
| 1645 | + [ -f "${File_ProxmoxCephSourceList}" ] && clear_file $File_ProxmoxCephSourceList |
| 1646 | + fi |
| 1647 | + fi |
1629 | 1648 | # Linux Mint |
1630 | 1649 | [[ "${SYSTEM_JUDGMENT}" == "${SYSTEM_LINUX_MINT}" ]] && clear_file $File_LinuxMintSourceList |
1631 | 1650 | # Raspberry Pi OS |
@@ -1803,7 +1822,13 @@ function change_mirrors_main() { |
1803 | 1822 | fi |
1804 | 1823 | # Proxmox VE |
1805 | 1824 | if [ -f "${File_ProxmoxVersion}" ]; then |
1806 | | - diff_file $File_ProxmoxSourceListBackup $File_ProxmoxSourceList |
| 1825 | + if [[ "${USE_DEB822_FORMAT}" == "true" ]]; then |
| 1826 | + diff_file $File_ProxmoxSourcesBackup $File_ProxmoxSources |
| 1827 | + [ -f "${File_ProxmoxCephSources}" ] && diff_file $File_ProxmoxCephSourcesBackup $File_ProxmoxCephSources |
| 1828 | + else |
| 1829 | + diff_file $File_ProxmoxSourceListBackup $File_ProxmoxSourceList |
| 1830 | + [ -f "${File_ProxmoxCephSourceList}" ] && diff_file $File_ProxmoxCephSourceListBackup $File_ProxmoxCephSourceList |
| 1831 | + fi |
1807 | 1832 | fi |
1808 | 1833 | # Linux Mint |
1809 | 1834 | if [[ "${SYSTEM_JUDGMENT}" == "${SYSTEM_LINUX_MINT}" ]]; then |
@@ -2132,6 +2157,9 @@ Signed-By: /usr/share/keyrings/${SYSTEM_JUDGMENT,,}-archive-keyring.gpg" |
2132 | 2157 |
|
2133 | 2158 | $(_template_deb822 "deb-src" "${1}" "${2}" "${3}" | sed -e "s|^|# |g")" |
2134 | 2159 | } |
| 2160 | + function gen_deb822_unsrc() { |
| 2161 | + echo "$(_template_deb822 "deb" "${1}" "${2}" "${3}")" |
| 2162 | + } |
2135 | 2163 | function gen_deb822_disabled() { |
2136 | 2164 | echo "$(_template_deb822 "deb" "${1}" "${2}" "${3}" | sed -e "s|^|# |g") |
2137 | 2165 |
|
@@ -2549,17 +2577,39 @@ $(gen_deb "${source_address}" "${base_system_codename}" "${repo_components}")" |
2549 | 2577 | fi |
2550 | 2578 | # Proxmox VE |
2551 | 2579 | if [ -f "${File_ProxmoxVersion}" ]; then |
2552 | | - source_address="${SOURCE}/proxmox/debian" |
2553 | | - apt_source_file="${File_ProxmoxSourceList}" |
2554 | | - apt_source_content="$(gen_deb_unsrc "${source_address}/pve" "${SYSTEM_VERSION_CODENAME}" "pve-no-subscription") |
2555 | | -$(gen_deb_unsrc_disabled "${source_address}/pbs" "${SYSTEM_VERSION_CODENAME}" "pbs-no-subscription") |
2556 | | -$(gen_deb_unsrc_disabled "${source_address}/pbs-client" "${SYSTEM_VERSION_CODENAME}" "pbs-client-no-subscription") |
2557 | | -$(gen_deb_unsrc_disabled "${source_address}/pmg" "${SYSTEM_VERSION_CODENAME}" "pmg-no-subscription")" |
2558 | | - write_apt_source |
2559 | | - if [ -s "${File_ProxmoxAPLInfo}" ]; then |
2560 | | - sed -e "s|url => [\"']https\?://[^/]*/images[\"']|url => \"${WEB_PROTOCOL}://${SOURCE}/images\"|g" \ |
| 2580 | + if [[ "${USE_OFFICIAL_SOURCE}" == "true" ]]; then |
| 2581 | + source_address="download.proxmox.com" |
| 2582 | + else |
| 2583 | + source_address="${SOURCE}/proxmox" |
| 2584 | + fi |
| 2585 | + if [[ "${USE_DEB822_FORMAT}" == "true" ]]; then |
| 2586 | + apt_source_file="${File_ProxmoxSources}" |
| 2587 | + apt_source_content="$(gen_deb822_unsrc "${source_address}/debian/pve" "${SYSTEM_VERSION_CODENAME}" "pve-no-subscription")" |
| 2588 | + write_apt_source |
| 2589 | + # Ceph 仓库 |
| 2590 | + if [ -f "${File_ProxmoxCephSources}" ]; then |
| 2591 | + local ceph_codename="$(ceph -v | grep ceph | awk '{print $(NF-1)}')" |
| 2592 | + apt_source_file="${File_ProxmoxCephSources}" |
| 2593 | + apt_source_content="$(gen_deb822_unsrc "${source_address}/debian/ceph-${ceph_codename}" "${SYSTEM_VERSION_CODENAME}" "no-subscription")" |
| 2594 | + write_apt_source |
| 2595 | + fi |
| 2596 | + else |
| 2597 | + apt_source_file="${File_ProxmoxSourceList}" |
| 2598 | + apt_source_content="$(gen_deb_unsrc "${source_address}/debian/pve" "${SYSTEM_VERSION_CODENAME}" "pve-no-subscription")" |
| 2599 | + write_apt_source |
| 2600 | + # Ceph 仓库 |
| 2601 | + if [ -f "${File_ProxmoxCephSourceList}" ]; then |
| 2602 | + local ceph_codename="$(ceph -v | grep ceph | awk '{print $(NF-1)}')" |
| 2603 | + apt_source_file="${File_ProxmoxCephSourceList}" |
| 2604 | + apt_source_content="$(gen_deb_unsrc "${source_address}/debian/ceph-${ceph_codename}" "${SYSTEM_VERSION_CODENAME}" "no-subscription")" |
| 2605 | + write_apt_source |
| 2606 | + fi |
| 2607 | + fi |
| 2608 | + # CT Templates |
| 2609 | + if [ -s /usr/share/perl5/PVE/APLInfo.pm ]; then |
| 2610 | + sed -e "s|url => [\"']https\?://[^/]*/images[\"']|url => \"${WEB_PROTOCOL}://${source_address}/images\"|g" \ |
2561 | 2611 | -i \ |
2562 | | - $File_ProxmoxAPLInfo |
| 2612 | + /usr/share/perl5/PVE/APLInfo.pm |
2563 | 2613 | fi |
2564 | 2614 | fi |
2565 | 2615 | } |
@@ -7012,7 +7062,7 @@ baseurl=https://mirrors.openanolis.cn/anolis/$releasever/Plus/$basearch/debug |
7012 | 7062 | enabled=0 |
7013 | 7063 | gpgkey=https://mirrors.openanolis.cn/anolis/RPM-GPG-KEY-ANOLIS |
7014 | 7064 | gpgcheck=1 |
7015 | | - |
| 7065 | +
|
7016 | 7066 | [PowerTools-debuginfo] |
7017 | 7067 | name=AnolisOS-$releasever - PowerTools Debuginfo |
7018 | 7068 | baseurl=https://mirrors.openanolis.cn/anolis/$releasever/PowerTools/$basearch/debug |
@@ -7080,7 +7130,7 @@ baseurl=https://mirrors.openanolis.cn/anolis/$releasever/Plus/source/ |
7080 | 7130 | enabled=0 |
7081 | 7131 | gpgkey=https://mirrors.openanolis.cn/anolis/RPM-GPG-KEY-ANOLIS |
7082 | 7132 | gpgcheck=1 |
7083 | | - |
| 7133 | +
|
7084 | 7134 | [PowerTools-source] |
7085 | 7135 | name=AnolisOS-$releasever - PowerTools Source |
7086 | 7136 | baseurl=https://mirrors.openanolis.cn/anolis/$releasever/PowerTools/source/ |
|
0 commit comments