本章介绍PVE
虚拟机安装完成后的必要配置,主要是为了性能提升和日常使用的优化。
更换国内源
源
在Linux
系中是一个常见的东西,pve
基于Debian
自然也不例外
1. 去除企业源
这个主要是为了企业使用的一个源,我们自己用,不需要,如果不去掉,在更新的时候会提示错误,如下图
解决办法是删除或注释,推荐注释掉即可
nano /etc/apt/sources.list.d/pve-enterprise.list
#deb https://enterprise.proxmox.com/debian/pve buster pve-enterprise
nano
基本命令
Ctrl + O
,然后Enter
保存Ctrl + x
退出
2. 更换国内软件源(Proxmox
源)
推荐使用 清华Proxmox源,本文所有的源都是来自清华源
新建文件 /etc/apt/sources.list.d/pve-no-subscription.list
,在该文件中增加需要添加的源
- Debian 8:
deb https://mirrors.tuna.tsinghua.edu.cn/proxmox/debian jessie pve-no-subscription
- Debian 9:
deb https://mirrors.tuna.tsinghua.edu.cn/proxmox/debian stretch pve-no-subscription
- Debian 10:
deb https://mirrors.tuna.tsinghua.edu.cn/proxmox/debian buster pve-no-subscription
本文使用的是Debian 10
, 一条命令如下:
echo "deb https://mirrors.tuna.tsinghua.edu.cn/proxmox/debian buster pve-no-subscription" >> /etc/apt/sources.list.d/pve-no-subscription.list
2. 更换国内系统源(Debian
源)
debian
的系统源位置是 /etc/apt/sources.list
, 先备份该文件,再替换为国内源
备份
cp /etc/apt/sources.list /etc/apt/sources.list-backup
替换内容
nano /etc/apt/sources.list
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free
如果遇到无法拉取
https
源的情况,请先使用http
源并安装如下软件
sudo apt install apt-transport-https ca-certificates
去除无有效的订阅
弹窗
修改 /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js
,将 if (data.status !== 'Active')
改成 if (false)
, 重启服务,重启成功后刷新本地缓存即可
一条命令修改:
sed -i "s/data.status !== 'Active'/false/g" /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js
重启服务
systemctl restart pveproxy
注意:该方法更新后会失效,而且系统更新也不一定还是
if (data.status !== 'Active')
最新的代码if (res === null || res === undefined || !res || res.data.status !== 'Active')
如下:更改为if (false)
success: function(response, opts) {
let res = response.result;
if (res === null || res === undefined || !res || res
.data.status !== '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();
}
},