Proxmox镜像站收集及相关更新代码(更新中)

最近发现Proxmox的虚拟化平台,VE(Virtual Environment ),即PVE比较火,他目前是开源(免费)的虚拟化平台,很适合中小企业、小微企业使用,而且不仅仅是测试用途,性能强劲且稳定,是可以作为生产环境的。

本文收集整理一些Proxmox Virtual Environment 国内的镜像站点,并附上更新相关代码,力争亲自测试后再贴出来,并持续更新中,便于大家快速部署、便捷更新。

1、http类镜像站点

http://mirrors.tuna.tsinghua.edu.cn/help/proxmox/

这个是清华大学的镜像站点,浏览器http方式可以访问,似乎自动跳转到https

http://download.proxmox.wiki/

这个是Proxmox中文社区源,镜像站机房机房好像在境外,但是使用了阿里云、华为云的CDN加速服务,速度也是很快的。

2、https类镜像站点

1)https://mirrors.ustc.edu.cn/proxmox/

这个是中国科学技术大学的。

3、相关更新代码

修改系统更新配置文件

核心配置文件其实就两个,分别是

(1)/etc/apt/sources.list.d/pve-enterprise.list

以使用中国科学技术大学的镜像站为例,此文件原来内容为:

cat /etc/apt/sources.list.d/pve-enterprise.list
deb https://enterprise.proxmox.com/debian/pve bullseye pve-enterprise

更改配置可以使用vi编辑器,也可以粘贴如下代码:

sed -i.bak "s/^/#/" /etc/apt/sources.list.d/pve-enterprise.list
echo "deb https://mirrors.ustc.edu.cn/proxmox/debian/pve bullseye pve-no-subscription" > /etc/apt/sources.list.d/pve-no-subscription.list 

粘贴后分别通过ls、cat命令,可以发现原来的文件内容被修改,源文件已备份,并生成了一个新文件pve-no-subscription.list,把Proxmox VE 的软件仓库切换为非订阅模式,就可以随意升级了。

root@pve:~#
root@pve:~# ls /etc/apt/sources.list.d/
pve-enterprise.list  pve-enterprise.list.bak  pve-no-subscription.list
root@pve:~#
root@pve:~# cat /etc/apt/sources.list.d/pve-enterprise.list
#deb https://enterprise.proxmox.com/debian/pve bullseye pve-enterprise
root@pve:~#
root@pve:~# cat /etc/apt/sources.list.d/pve-no-subscription.list
deb https://mirrors.ustc.edu.cn/proxmox/debian/pve bullseye pve-no-subscription

(2)/etc/apt/sources.list

此文件内容控制系统文件的更新路径,因为PVE是基于Debain开发的,升级文件指向任何一个Debain镜像站均可,例如阿里云(https://mirrors.aliyun.com/debian/)、网易镜像(https://mirrors.163.com/debian/)、搜狐镜像(https://mirrors.sohu.com/debian/)等等。
已网易镜像为例,代码如下:

更新之前:

root@pve:~# ls /etc/apt/sources.list
/etc/apt/sources.list
root@pve:~#
root@pve:~# cat /etc/apt/sources.list
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
root@pve:~#

更新代码:

sed -i.bak "s#http://ftp.debian.org/debian#https://mirrors.163.com/debian/#g" /etc/apt/sources.list
sed -i "s#http://security.debian.org#https://mirrors.163.com/debian-security#g" /etc/apt/sources.list

更新之后确认(看到多了一个sources.list.bak的源文件备份):

root@pve:~# ls /etc/apt/
apt.conf.d   listchanges.conf    preferences.d  sources.list.bak  trusted.gpg.d
auth.conf.d  listchanges.conf.d  sources.list   sources.list.d
root@pve:~# cat /etc/apt/sources.list
deb https://mirrors.163.com/debian/ bullseye main contrib

deb https://mirrors.163.com/debian/ bullseye-updates main contrib

# security updates
deb https://mirrors.163.com/debian-security bullseye-security main contrib
root@pve:~# cat /etc/apt/sources.list.bak
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
root@pve:~#

执行更新

修改配置文件后,执行更新的代码有两个,功能分别是查找更新和执行更新

apt-get update
apt-get dist-upgrade 

更改ceph更新源

如果需要在pve平台上安装分布式存储ceph,也需要修改相关的更新源

修改前(之前 /etc/apt/sources.list.d/ 路径下并没有ceph相关的配置文件):
注:源文件 /usr/share/perl5/PVE/CLI/pveceph.pm 是一大段代码,此处不列出全文了。

root@pve:~#
root@pve:~# ls /usr/share/perl5/PVE/CLI/
ha_manager.pm  pve6to7.pm  pveceph.pm  pvenode.pm  pvesm.pm  pvesubscription.pm  qm.pm         vzdump.pm
pct.pm         pveam.pm    pvecm.pm    pvesh.pm    pvesr.pm  pveum.pm            qmrestore.pm
root@pve:~#
root@pve:~#
root@pve:~# ls /etc/apt/sources.list.d/
pve-enterprise.list  pve-enterprise.list.bak  pve-no-subscription.list
root@pve:~#

修改代码

sed -i.bak "s#http://download.proxmox.com/debian#https://mirrors.ustc.edu.cn/proxmox/debian#g" /usr/share/perl5/PVE/CLI/pveceph.pm
echo "deb https://mirrors.ustc.edu.cn/proxmox/debian/ceph-pacific bullseye main" > /etc/apt/sources.list.d/ceph.list 

修改后(看到多了一个ceph.list 文件):
注:修改后的 /usr/share/perl5/PVE/CLI/pveceph.pm 文件内容不列出了,其实就是有三处网址,都修改成科技大学的镜像网址了。

root@pve:~#
root@pve:~# ls /etc/apt/sources.list.d
ceph.list  pve-enterprise.list  pve-enterprise.list.bak  pve-no-subscription.list
root@pve:~#
root@pve:~# cat /etc/apt/sources.list.d/ceph.list
deb https://mirrors.ustc.edu.cn/proxmox/debian/ceph-pacific bullseye main
root@pve:~#

4、后记 目前能找到的境外镜像站也收藏一下(速度很慢)

https://mirrors.apqa.cn/

这个是一个热心认识自建的镜像站,服务器在境外,速度慢,不推荐。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值