Proxmox 7.x 初始化安装

更换 PVE 社区源

1. 备份企业源

mv /etc/apt/sources.list.d/pve-enterprise.list /etc/apt/sources.list.d/pve-enterprise.list.bak

2. 下载密钥

wget http://download.proxmox.com/debian/proxmox-release-bullseye.gpg -O /etc/apt/trusted.gpg.d/proxmox-release-bullseye.gpg

3. 添加社区源

echo "deb https://mirrors.tuna.tsinghua.edu.cn/proxmox/debian/pve bullseye pve-no-subscription" > /etc/apt/sources.list.d/pve-no-subscription.list

更改CT Templates源

1. 查找设定下载源的文件

grep -rn "download.proxmox.com" /usr/share/perl5/PVE/*

2. 备份APLInfo

cp /usr/share/perl5/PVE/APLInfo.pm /usr/share/perl5/PVE/APLInfo.pm_back

3. 替换地址

sed -i 's|http://download.proxmox.com|https://mirrors.tuna.tsinghua.edu.cn/proxmox|g' /usr/share/perl5/PVE/APLInfo.pm

更换 Debian 国内源

1. 备份原文件: /etc/apt/sources.list

cp /etc/apt/sources.list /etc/apt/sources.list.bak

2. 修改sources.list文件,将http://ftp.debian.org替换成https://repo.huaweicloud.com,同时也将http://security.debian.org替换成https://repo.huaweicloud.com,可以参考如下命令:

sed -i "s@http://ftp.debian.org@https://repo.huaweicloud.com@g" /etc/apt/sources.list
sed -i "s@http://security.debian.org@https://repo.huaweicloud.com/debian-security@g" /etc/apt/sources.list

3. 如果遇到无法拉取 https 源的情况,请先使用 http 源并安装:

sudo apt install apt-transport-https ca-certificates

更新和升级

apt update
apt upgrade

Fix Proxmox VE Permission denied

1. 安装服务

apt install systemd-timesyncd

2. 修改时间服务器

vim /etc/systemd/timesyncd.conf
[Time]
NTP=ntp.aliyun.com

3. 重启并开机自启动服务

systemctl restart systemd-timesyncd.service
systemctl enable systemd-timesyncd.service

4. 查看时间状态

timedatectl status
systemctl status systemd-timesyncd

5. 设置主板 BIOS 时间

timedatectl set-local-rtc 0
hwclock --localtime --systohc

6. 重启 PVE

systemctl restart pvedaemon

彻底删除软件

# 删除软件及其配置文件
apt-get --purge remove <package>

# 删除没用的依赖包
apt-get autoremove <package>

# 此时dpkg的列表中有“rc”状态的软件包,可以执行如下命令做最后清理:
dpkg -l | grep ^rc | awk '{print $2}' | sudo xargs dpkg -P

# 当然如果要删除暂存的软件安装包,也可以再使用clean命令。
apt-get clean <package>

去除订阅提醒

1. 打开 proxmoxlib.js 文件

vim /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js

2. 找到下述代码

if (res === null || res === undefined || !res || res
.data.status.toLowerCase() !== 'active') {
    Ext.Msg.show({
        title: gettext('No valid subscription'),
        icon: Ext.Msg.WARNING,
        message: Proxmox.Utils.getNoSubKeyHtml(res.data.url),
        buttons: Ext.Msg.OK,
        callback: function(btn) {
            if (btn !== 'ok') {
                return;
            }
            orig_cmd();
        },
    });
} else {
    orig_cmd();
}

3. 修改 IF 判断条件为 false

// if (res === null || res === undefined || !res || res
// .data.status.toLowerCase() !== 'active') {
if (false) {
    Ext.Msg.show({
        title: gettext('No valid subscription'),
        icon: Ext.Msg.WARNING,
        message: Proxmox.Utils.getNoSubKeyHtml(res.data.url),
        buttons: Ext.Msg.OK,
        callback: function(btn) {
            if (btn !== 'ok') {
                return;
            }
            orig_cmd();
        },
    });
} else {
    orig_cmd();
}

2. 重启PVE网页服务

systemctl restart pveproxy.service
上一篇
下一篇