1. On the computer, log in to the SSH of PVE with a tool such as Xshell, and enter the following command (the content with # at the beginning is a comment, and if you do not need to enter it, only enter the one that does not start with #, the same below):

 #Modify PVE Source sed -i 's/buster\/updates/bullseye-security/g; s/buster/bullseye/g' /etc/apt/sources.list #Delete PVE Enterprise Source rm -rf /etc/apt/sources.list.d/pve-install-repo.list

2. Enter vi/etc/opt/sources.list, press i to enter editing status, delete all the original contents, copy the following contents, paste them, save and exit;

 # debian aliyun source #deb  https://mirrors.tuna.tsinghua.edu.cn/debian  bullseye main contrib non-free #deb  https://mirrors.tuna.tsinghua.edu.cn/debian  bullseye-updates main contrib non-free #deb  https://mirrors.tuna.tsinghua.edu.cn/debian-security  bullseye-security main contrib non-free #deb  http://download.proxmox.com/debian/pve  bullseye pve-no-subscription deb  http://ftp.debian.org/debian  bullseye main contrib deb  http://ftp.debian.org/debian  bullseye-updates main contrib # security updates deb  http://security.debian.org  bullseye-security main contrib deb  http://download.proxmox.com/debian/pve  bullseye pve-no-subscription

3. Enter the following command to update the system (since the source of PVE is in a foreign server, it is recommended to start the aircraft globally, otherwise the update will be very slow). During this period, an interface similar to the following figure may pop up, prompting you to select, and you can simply press Enter without thinking:

 apt update && apt dist-upgrade -y

4. After the update is completed, enter reboot to restart PVE;

5. After starting, continue to enter the following commands:

 apt autoremove -y

6. Click the command to check the current system kernel, and then unload the useless kernel to keep the system clean (OCD attacks):

 #View the currently used kernel uname -a #Check how many cores the system has dpkg --get-selections |grep kernel

7. Uninstall extra cores

 #Uninstall the useless kernel. The pve-kernel-5.3.13-1-pve after the command is the kernel displayed according to the previous command. It needs to be modified to show that your PVE is not used. The system is in use if the word "purge" is displayed after the command. Those that cannot be uninstalled can be uninstalled. Others can be uninstalled) dpkg --purge --force-remove-essential pve-kernel-5.3.13-1-pve dpkg --purge --force-remove-essential pve-kernel-5.3.13-3-pve dpkg --purge --force-remove-essential pve-kernel-5.3.18-1-pve dpkg --purge --force-remove-essential pve-kernel-5.3.18-2-pve dpkg --purge --force-remove-essential pve-kernel-5.3.18-3-pve dpkg --purge --force-remove-essential pve-kernel-5.4  dpkg --purge --force-remove-essential pve-kernel-5.4.101-1-pve dpkg --purge --force-remove-essential pve-kernel-5.4.103-1-pve dpkg --purge --force-remove-essential pve-kernel-5.4.106-1-pve dpkg --purge --force-remove-essential pve-kernel-5.4.114-1-pve dpkg --purge --force-remove-essential pve-kernel-5.4.119-1-pve dpkg --purge --force-remove-essential pve-kernel-5.4.124-1-pve dpkg --purge --force-remove-essential pve-kernel-5.4.34-1-pve dpkg --purge --force-remove-essential pve-kernel-5.4.41-1-pve dpkg --purge --force-remove-essential pve-kernel-5.4.44-1-pve dpkg --purge --force-remove-essential pve-kernel-5.4.44-2-pve dpkg --purge --force-remove-essential pve-kernel-5.4.55-1-pve dpkg --purge --force-remove-essential pve-kernel-5.4.60-1-pve dpkg --purge --force-remove-essential pve-kernel-5.4.65-1-pve dpkg --purge --force-remove-essential pve-kernel-5.4.73-1-pve dpkg --purge --force-remove-essential pve-kernel-5.4.78-1-pve dpkg --purge --force-remove-essential pve-kernel-5.4.78-2-pve dpkg --purge --force-remove-essential pve-kernel-5.4.98-1-pve dpkg --purge --force-remove-essential pve-kernel-5.3.13-1-pve #After deleting the unused kernel, update the boot menu update-grub #Restart PVE reboot

8. After deletion, check the kernel again. Only the kernel is in use, and there is no more;

9. After entering PVE, the system may restart automatically 3-4 times, which is a normal phenomenon. Please wait patiently. Don't think there is a problem with the machine. After the machine is no longer restarted, the virtual machine can be started.

10. Optimize PVE:

 #Install the time synchronization tool to automatically synchronize the time apt install chrony -y #Install a tool that automatically applies refresh after network configuration modification apt install ifupdown2 -y #Delete the previous time synchronization tool apt remove systemd-timesyncd -y apt-get remove --purge systemd-timesyncd

11. Back to the webpage, it has been updated to 7.0-10