中文 English

Proxmox VE 9.0 Daily Maintenance: Remove the No-Subscription Notice and Use China Mirrors (Updated 2025-08-06)

Published: 2023-02-26
PVE Proxmox VE pvekclean

This article collects the most common maintenance tasks for PVE 6.x / 7.x / 8.x / 9.x and fixes duplicated sections and obvious errors from older revisions.

Check the current version first, then follow the instructions that match that version. Do not mix repository settings across different PVE releases.

pveversion

1. Routine maintenance (general)

1.1 Remove unused kernels with pvekclean

git clone https://github.com/jordanhillis/pvekclean.git /opt/pvekclean
cd /opt/pvekclean
chmod +x pvekclean.sh
./pvekclean.sh

1.2 System update and common tools

apt-get update
apt-get install -y vim lrzsz unzip net-tools curl screen tmux uuid-runtime git
apt-get dist-upgrade -y
apt-get autoremove --purge -y

2. Remove the no-subscription notice (optional)

Note: this only patches the UI layer. PVE upgrades may overwrite it, so it is best suited to personal lab environments.

cp /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js \
   /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js.bak.$(date +%F-%H%M%S)
sed -i "s/data.status !== 'Active'/false/g" /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js
systemctl restart pveproxy

3. PVE UI enhancement (hardware summary information)

Official forum thread: https://bbs.x86pi.cn/thread?topicId=20

# Stable release
wget -q -O /root/pve_source.tar.gz \
'https://bbs.x86pi.cn/file/topic/2023-11-28/file/01ac88d7d2b840cb88c15cb5e19d4305b2.gz' \
&& tar zxvf /root/pve_source.tar.gz \
&& /root/pve_source

Follow the script prompts to choose the matching version, for example 7 -> 1 -> o.

4. Configure China mirrors (pick the version that matches your system)

4.1 PVE 6.x (Debian buster)

cat > /etc/apt/sources.list <<'EOF_INNER'
deb https://mirrors.huaweicloud.com/debian/ buster main non-free contrib
deb-src https://mirrors.huaweicloud.com/debian/ buster main non-free contrib
deb https://mirrors.huaweicloud.com/debian-security/ buster/updates main non-free contrib
deb-src https://mirrors.huaweicloud.com/debian-security/ buster/updates main non-free contrib
deb https://mirrors.huaweicloud.com/debian/ buster-updates main non-free contrib
deb-src https://mirrors.huaweicloud.com/debian/ buster-updates main non-free contrib
deb https://mirrors.huaweicloud.com/debian/ buster-backports main non-free contrib
deb-src https://mirrors.huaweicloud.com/debian/ buster-backports main non-free contrib
EOF_INNER

rm -f /etc/apt/sources.list.d/pve-enterprise.list
curl -fsSL https://mirrors.ustc.edu.cn/proxmox/debian/proxmox-ve-release-6.x.gpg -o /etc/apt/trusted.gpg.d/proxmox-ve-release-6.x.gpg
echo "deb https://mirrors.ustc.edu.cn/proxmox/debian/pve buster pve-no-subscription" > /etc/apt/sources.list.d/pve-install-repo.list
apt-get update && apt-get dist-upgrade -y

4.2 PVE 7.x (Debian bullseye)

cat > /etc/apt/sources.list <<'EOF_INNER'
deb https://mirrors.huaweicloud.com/debian/ bullseye main non-free contrib
deb-src https://mirrors.huaweicloud.com/debian/ bullseye main non-free contrib
deb https://mirrors.huaweicloud.com/debian-security/ bullseye-security main
deb-src https://mirrors.huaweicloud.com/debian-security/ bullseye-security main
deb https://mirrors.huaweicloud.com/debian/ bullseye-updates main non-free contrib
deb-src https://mirrors.huaweicloud.com/debian/ bullseye-updates main non-free contrib
deb https://mirrors.huaweicloud.com/debian/ bullseye-backports main non-free contrib
deb-src https://mirrors.huaweicloud.com/debian/ bullseye-backports main non-free contrib
EOF_INNER

rm -f /etc/apt/sources.list.d/pve-enterprise.list
curl -fsSL https://mirrors.ustc.edu.cn/proxmox/debian/proxmox-release-bullseye.gpg -o /etc/apt/trusted.gpg.d/proxmox-release-bullseye.gpg
echo "deb https://mirrors.ustc.edu.cn/proxmox/debian/pve bullseye pve-no-subscription" > /etc/apt/sources.list.d/pve-install-repo.list
apt-get update && apt-get dist-upgrade -y

4.3 PVE 8.x (Debian bookworm)

cat > /etc/apt/sources.list <<'EOF_INNER'
deb https://mirrors.huaweicloud.com/debian/ bookworm main non-free contrib
deb-src https://mirrors.huaweicloud.com/debian/ bookworm main non-free contrib
deb https://mirrors.huaweicloud.com/debian-security/ bookworm-security main
deb-src https://mirrors.huaweicloud.com/debian-security/ bookworm-security main
deb https://mirrors.huaweicloud.com/debian/ bookworm-updates main non-free contrib
deb-src https://mirrors.huaweicloud.com/debian/ bookworm-updates main non-free contrib
deb https://mirrors.huaweicloud.com/debian/ bookworm-backports main non-free contrib
deb-src https://mirrors.huaweicloud.com/debian/ bookworm-backports main non-free contrib
EOF_INNER

rm -f /etc/apt/sources.list.d/pve-enterprise.list
curl -fsSL https://mirrors.ustc.edu.cn/proxmox/debian/proxmox-release-bookworm.gpg -o /etc/apt/trusted.gpg.d/proxmox-release-bookworm.gpg
echo "deb https://mirrors.ustc.edu.cn/proxmox/debian/pve bookworm pve-no-subscription" > /etc/apt/sources.list.d/pve-install-repo.list
apt-get update && apt-get dist-upgrade -y

4.4 PVE 9.x (Debian trixie)

cat > /etc/apt/sources.list <<'EOF_INNER'
deb https://mirrors.huaweicloud.com/debian/ trixie main non-free contrib
deb-src https://mirrors.huaweicloud.com/debian/ trixie main non-free contrib
deb https://mirrors.huaweicloud.com/debian-security/ trixie-security main
deb-src https://mirrors.huaweicloud.com/debian-security/ trixie-security main
deb https://mirrors.huaweicloud.com/debian/ trixie-updates main non-free contrib
deb-src https://mirrors.huaweicloud.com/debian/ trixie-updates main non-free contrib
deb https://mirrors.huaweicloud.com/debian/ trixie-backports main non-free contrib
deb-src https://mirrors.huaweicloud.com/debian/ trixie-backports main non-free contrib
EOF_INNER

rm -f /etc/apt/sources.list.d/pve-enterprise.list
curl -fsSL https://mirrors.ustc.edu.cn/proxmox/debian/proxmox-release-trixie.gpg -o /etc/apt/trusted.gpg.d/proxmox-release-trixie.gpg
echo "deb https://mirrors.ustc.edu.cn/proxmox/debian/pve trixie pve-no-subscription" > /etc/apt/sources.list.d/pve-install-repo.list
apt-get update && apt-get dist-upgrade -y

5. Network and DNS

5.1 Temporary fix when DNS resolution is broken

cp /etc/resolv.conf /etc/resolv.conf.bak.$(date +%F-%H%M%S)
cat > /etc/resolv.conf <<'EOF_INNER'
nameserver 223.5.5.5
nameserver 223.6.6.6
EOF_INNER

systemctl restart networking

Note: if NetworkManager or a DHCP client manages the system, /etc/resolv.conf may be overwritten again later.

5.2 Change the default PVE management IP from the command line

vim /etc/network/interfaces

A typical configuration looks like this:

auto lo
iface lo inet loopback

iface enp2s0 inet manual

auto vmbr0
iface vmbr0 inet static
    address 192.168.1.2
    netmask 255.255.255.0
    gateway 192.168.1.1
    bridge_ports enp2s0
    bridge_stp off
    bridge_fd 0

Usually you only need to change address, netmask, and gateway. After editing, apply it with:

ifreload -a

6. Time synchronization (NTP)

6.1 PVE 6.x (timesyncd)

cat > /etc/systemd/timesyncd.conf <<'EOF_INNER'
[Time]
NTP=ntp1.aliyun.com ntp2.aliyun.com ntp3.aliyun.com ntp4.aliyun.com ntp5.aliyun.com ntp6.aliyun.com ntp7.aliyun.com
EOF_INNER

timedatectl set-ntp true
timedatectl status

6.2 PVE 7.x / 8.x / 9.x (chrony)

cat >> /etc/chrony/chrony.conf <<'EOF_INNER'
# Aliyun NTP
server ntp1.aliyun.com minpoll 4 maxpoll 10 iburst
server ntp2.aliyun.com minpoll 4 maxpoll 10 iburst
server ntp3.aliyun.com minpoll 4 maxpoll 10 iburst
server ntp4.aliyun.com minpoll 4 maxpoll 10 iburst
server ntp5.aliyun.com minpoll 4 maxpoll 10 iburst
server ntp6.aliyun.com minpoll 4 maxpoll 10 iburst
server ntp7.aliyun.com minpoll 4 maxpoll 10 iburst
EOF_INNER

systemctl restart chrony
chronyc sources -v

7. Common error handling

7.1 E: Sub-process /usr/bin/dpkg returned an error code

dpkg --configure -a
apt-get update --fix-missing
apt-get -f install
apt-get autoremove --purge -y
apt-get clean

7.2 The upgrade process wants to remove the proxmox-ve meta-package

Check what is about to be removed, then purge old kernels first:

dpkg --list | grep -E 'pve-kernel|linux-image|linux-headers'
proxmox-boot-tool kernel list

# Example: replace with your actual old kernel version
apt-get --purge remove pve-kernel-6.2.16-15-pve
update-grub

7.3 locale: Cannot set LC_CTYPE ...

echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen
locale-gen
update-locale LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8

8. References