Proxmox VE(Proxmox Virtual Environment)系统软件源所有基于 Debian 的操作系统都使用 APT 命令作为软件包管理工具。软件源列表定义在 /etc/apt/sources.list 文件中,以及/etc/apt/sources.d 目录下后缀名为.list 的文件中。既可以直接使用 apt-get 命令升级软件,也可以使用 GUI 界面升级。

软件源文件 sources.list 的每一行都定义了一个软件源,最常用的软件源一般放在前面。在 sources.list 中,空行会被忽略,字符#及以后的内容会被解析为注释。可以用 apt-get update 命令获取软件源中的软件包信息,在安装或更新 系统的时候,使用官方自带源因为官方源在国外的缘故,速度慢且失败的概率高,几百兆的更新速度只有几十k甚至几K的情况。

国内网络大环境的情况下建议使用中科大、清华、阿里和网易的国内源,速度快,可以节省更新所占用的时间。这里以Proxmox VE(Proxmox Virtual Environment)PVE 6.3系统演示为例。

登录PVE设备命令控制台

在电脑中使用浏览器访问PVE的IP地址并登录后台,在左侧树形结构的视图的菜单找到【节点 ‘pve’】下并选择【 >_ Shell】菜单

进入网页版的ssh界面下;或者使用ssh管理工具输入访问IP、root密码后登录到ssh下

Proxmox VE 使用在线SSH网页版

软件包仓库国内源设置

输入 nano /etc/apt/sources.list 命令,编辑修改 /etc/apt/sources.list 软件包仓库位置的配置文件

root@pve:~# nano /etc/apt/sources.list  

Bash

Copy

将系统 /etc/apt/sources.list 软件包仓库位置的原始默认配置文件

deb http://ftp.debian.org/debian buster main contrib  
  
deb http://ftp.debian.org/debian buster-updates main contrib  
  
# security updates  
deb http://security.debian.org buster/updates main contrib  

修改为 Debian系统源(阿里云源)和中科大proxmox源【https://mirrors.ustc.edu.cn/proxmox/】(使用帮助)

内容如下:

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

编辑完成后,使用快捷键 Ctrl + O 回车保存文件,Ctrl + X 退出编辑器。

去除 Proxmox 企业版更新源

Proxmox VE 企业版软件源是默认的、稳定的、推荐使用的软件源,供订阅了 Proxmox VE 企业版的用户使用。该软件源包含了最稳定的软件包,适用于生产环境使用。软件源 pve-enterprise 默认是启用的,一旦有软件包有新的升级,root@pam 用户就会收到有关新软件包的电子邮件通知。在 GUI 界面,可以查看每个软件包的变更历史(如果有的话),其中有升级的每个细节。所以订阅了 Proxmox VE 企业版的用户永远不会错过重要的安全补丁。

Proxmox VE 企业版必须提供订阅密钥才可以访问企业版软件源。Proxmox VE 系统服务商提供有不同级别的订阅服务,具体信息可以查看网址 http://www.proxmox.com/en/proxmox-ve/pricing如果你没有订阅 Proxmox VE 企业版,可以将企业版软件源配置信息在软件源配置文件中注释掉(在该行开头插入一个 # 字符),以避免系统发出错误提示信息。这种情况下可以配置使用 pve-no-subscriptin 软件源。

因为没有订阅 Proxmox VE 企业版服务,所以这里对Proxmox VE 企业版更新源进行注释操作。

输入 nano /etc/apt/sources.list.d/pve-enterprise.list 命令,编辑修改 /etc/apt/sources.list.d/pve-enterprise.list 企业版软件包仓库位置的配置文件

root@pve:~# nano /etc/apt/sources.list.d/pve-enterprise.list  

Bash

Copy

将系统默认的内容 deb https://enterprise.proxmox.com/debian/pve buster pve-enterprise

修改为:

## deb https://enterprise.proxmox.com/debian/pve buster pve-enterprise  

Bash

Copy

编辑完成后,使用快捷键 Ctrl + O 回车保存文件,Ctrl + X 退出编辑器。

也可以直接执行 rm -rf /etc/apt/sources.list.d/pve-enterprise.list 命令删除企业源

或执行 mv /etc/apt/sources.list.d/pve-enterprise.list /etc/apt/sources.list.d/pve-enterprise.list.bak 命令将 pve-enterprise.list 文件更改为 pve-enterprise.list.bak 文件

Ceph源修改

输入 nano /etc/apt/sources.list.d/ceph.list 命令,编辑修改 /etc/apt/sources.list.d/ceph.list Ceph软件包仓库位置的配置文件

root@pve:~# nano /etc/apt/sources.list.d/ceph.list  

Bash

Copy

修改为:

## deb http://download.proxmox.com/debian/ceph-nautilus buster main  
deb http://mirrors.ustc.edu.cn/proxmox/debian/ceph-nautilus buster main  

Bash

Copy

编辑完成后,使用快捷键 Ctrl + O 回车保存文件,Ctrl + X 退出编辑器。

执行更新源

最后执行 apt update #更新源

**注:**下面命令请根据自己情况选择执行

apt update && apt dist-upgrade -y #如需升级pve,则执行该命令

apt upgrade #更新已安装的包

大家可以定期执行升级操作,也可以在Proxmox VE系统发布安全更新时执行升级。重大系统升级通知会通过 Proxmox VE Community Forum [https://forum.proxmox.com/]发布。随升级通知发布的还会有具体的升级细节。

文章作者: 辣比丶小新
本文链接:
版权声明: 本站所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 Y丶Zon
linux vps PVE
喜欢就支持一下吧