Margrop
Articles158
Tags353
Categories21
1password AC AP API AppDaemon Aqara Cron Date Diagrams.net HA HADashboard HomeAssistant IP IPv4 Java LVM‑Thin Linux MacOS MySQL NAS PPPoE PostgreSQL ProcessOn Proxmox VE SSL Shell TTS TimeMachine UML Uptime Kuma Web Windows activate ad adb adblock agent aligenie aliyun alpine annotation aop authy autofs backup baidupan bash bitwarden boot brew browser caddy2 cdn centos cert certbot charles chat chrome classloader client clone closures cloudflare cmd command commit container crontab ctyun ddsm demo dependency deploy developer devtools dll dns docker domain download draw drawio dsm dump dylib edge exception export fail2ban feign firewall-cmd flow frp frpc frps fuckgfw function gcc gfw git github golang gperftools gridea grub gvt-g hacs havcs heap hello hexo hibernate hidpi hoisting homeassistant hosts html htmlparser https idea image img img2kvm import index install intel io ios ip iptables iptv ipv6 iso java javascript jetbrains jni jnilib jpa js json jsonb jupter jupyterlab jvm k8s kernel key kid kms kodi koolproxy koolproxyr kvm lan lastpass launchctl learning lede letsencrypt linux live low-code lvm lxc m3u8 mac macos mariadb markdown maven md5 microcode mirror modem modules monitor mount mstsc mysql n2n n5105 nas network nfs node node-red nodejs nohup notepad++ npm nssm ntp oop openfeign openssl os otp ovz packet capture pat pdf pem perf ping pip plugin png powerbutton print pro proxy pve pvekclean python qcow2 qemu qemu-guest-agent rar reboot reflog remote remote desktop renew repo resize retina root route router rule rules runtime safari sata scipy-notebook scoping scp server slmgr so socks source spk spring springboot springfox ssh ssl stash string supernode svg svn swagger sync synology systemctl tap tap-windows tapwindows telecom template terminal tls token totp tvbox txt ubuntu udisk ui undertow uninstall unlocker upgrade url v2ray vhd vim vlmcsd vm vmdk web websocket wechat windows with worker wow xiaoya xml yum zip 中国电信 云电脑 交换机 光猫 公网IP 内存 内网IP 升级 启动 夏令时 天猫精灵 天翼云 安装 容器 导入 小米 常用软件 广告屏蔽 序列号 应用市场 异常 抓包 描述文件 时区 显卡虚拟化 智能家居 智能音箱 梯子 模块 流程 流程图 浏览器 漫游 激活 火绒 电信 画图 直播源 续期 网关 网络风暴 群晖 腾讯 虚拟机 证书 路由 路由器 软件管家 软路由 运维监控 镜像 镜像源 门窗传感器 防火墙 阿里云 阿里源 集客

Hitokoto

Archive

Proxmox VE 6.4 日常升级命令

Proxmox VE 6.4 日常升级命令

移除未使用的Linux内核

1
pvekclean

更新软件:

1
apt update -y && apt dist-upgrade -y

去掉未订阅的提示,支持 PVE 6.3 / 6.4

1
2
3
4
sed -i_orig "s/data.status === 'Active'/true/g" /usr/share/pve-manager/js/pvemanagerlib.js
sed -i_orig "s/if (res === null || res === undefined || \!res || res/if(/g" /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js
sed -i_orig "s/.data.status.toLowerCase() !== 'active'/false/g" /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js
systemctl restart pveproxy

确认无误后,重新启动服务器

1
reboot

解决软件升级问题

  • 新增阿里云的Debian镜像源

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    mv /etc/apt/sources.list /etc/apt/sources.list.bak
    cat > /etc/apt/sources.list <<EOF
    deb http://mirrors.aliyun.com/debian/ buster main non-free contrib
    deb http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
    deb http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib
    deb-src http://mirrors.aliyun.com/debian/ buster main non-free contrib
    deb-src http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
    deb-src http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib
    deb http://mirrors.aliyun.com/debian-security/ buster/updates main non-free contrib
    deb-src http://mirrors.aliyun.com/debian-security/ buster/updates main non-free contrib
    EOF
  • 新增Proxmox VE的中科大镜像源

    1
    2
    3
    4
    5
    6
    # 删除企业源
    rm -rf /etc/apt/sources.list.d/pve-enterprise.list
    # 下载秘钥
    wget http://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 http://mirrors.ustc.edu.cn/proxmox/debian/pve buster pve-no-subscription" >/etc/apt/sources.list.d/pve-install-repo.list

更新PVE,并安装常用软件

1
apt-get update && apt-get install vim lrzsz unzip net-tools curl screen uuid-runtime git -y && apt dist-upgrade -y

安装pvekclean

1
2
3
4
git clone https://github.com/jordanhillis/pvekclean.git
cd pvekclean
chmod +x pvekclean.sh
./pvekclean.sh

安装并设置NTP服务

参考https://pve.proxmox.com/wiki/Time_Synchronization

  • 新增阿里云的公共NTP地址
    1
    2
    3
    4
    5
    6
    mv /etc/systemd/timesyncd.conf /etc/systemd/timesyncd.conf_bak
    echo [Time] >> /etc/systemd/timesyncd.conf
    echo NTP=ntp1.aliyun.com ntp2.aliyun.com ntp3.aliyun.com ntp4.aliyun.com ntp5.aliyun.com ntp6.aliyun.com ntp7.aliyun.com >> /etc/systemd/timesyncd.conf
    cat /etc/systemd/timesyncd.conf
    timedatectl set-ntp true
    timedatectl status

如果更新时出现错误 E: Sub-process /usr/bin/dpkg returned an error code

参考https://blog.csdn.net/yusiguyuan/article/details/24269129

1
2
apt-get update --fix-missing
apt-get autoremove && sudo apt-get clean && sudo apt-get install -f

如果更新时出现错误 You are attempting to remove the meta-package ‘proxmox-ve’

  1. 首先检查 Proxmox VE 的企业源配置是否正确,企业源是否能正常访问
    1
    cat /etc/apt/sources.list.d/pve-enterprise.list
  2. 如果企业源配置完全正确,再继续往下看

    参考https://forum.proxmox.com/threads/apt-get-dist-upgrade-wants-to-remove-proxmox-ve-pve-firmware.39360/

    1
    2
    3
    4
    5
    6
    7
    8
    #Yes, I've tested it. I can remove any kernels listed with this command:
    #列出当前系统的Linux镜像
    dpkg --list | egrep -i --color 'linux-image|linux-headers'
    #Then:
    #删除旧的Linux镜像
    apt-get --purge remove linux-image-4.9.0-4-amd64 linux-image-4.9.0-5-amd64
    #更新grub
    update-grub
Author:Margrop
Link:http://blog.margrop.com/post/proxmox-ve-upgrade-software-command/
版权声明:本文采用 CC BY-NC-SA 3.0 CN 协议进行许可