当前位置:   article > 正文

debain 、pve虚拟化平台修改国内源并修改dns_pve dns设置

pve dns设置

pve 是基于debain的一个linux 虚拟化平台,可以实现创建虚拟机。

问题:
Failed to fetch xxxxxxx

E: Failed to fetch http://ftp.debian.org/debian/pool/main/p/postfix/postfix_3.5.13-0%2bdeb11u1_amd64.deb  Temporary failure resolving 'ftp.debian.org'
E: Failed to fetch http://ftp.debian.org/debian/pool/main/p/procmail/procmail_3.22-26%2bdeb11u1_amd64.deb  Temporary failure resolving 'ftp.debian.org'
E: Failed to fetch http://ftp.debian.org/debian/pool/main/t/tcpdump/tcpdump_4.99.0-2%2bdeb11u1_amd64.deb  Temporary failure resolving 'ftp.debian.org'
E: Failed to fetch http://security.debian.org/pool/updates/main/libx/libxslt/xsltproc_1.1.34-4%2bdeb11u1_amd64.deb  Temporary failure resolving 'ftp.debian.org'
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
  • 1
  • 2
  • 3
  • 4
  • 5

1、 先修改国内源

vi /etc/apt/sources.list
  • 1

需要自己更具当前的PVE版本切换源的版本
如下 buster为版本

deb http://security.debian.org buster/updates main contrib
  • 1

则需要将 bullseye改为buster

deb http://mirrors.aliyun.com/debian-security/ bullseye-security main
  • 1

加入下边更新源,自行更改版本号


# 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

deb http://mirrors.aliyun.com/debian/ bullseye main non-free contrib

deb-src http://mirrors.aliyun.com/debian/ bullseye main non-free contrib

deb http://mirrors.aliyun.com/debian-security/ bullseye-security main

deb-src http://mirrors.aliyun.com/debian-security/ bullseye-security main

deb http://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib

deb-src http://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib

deb http://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib

deb-src http://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29

如果你没有订阅 Proxmox VE 企业版,可以将企业版软件源配置信息在软件源配置文件中注释掉(在该行开头插入一个 # 字符),以避免系统发出错误提示信息。这种情况下可以配置使用 pve-no-subscriptin 软件源。因为没有订阅 Proxmox VE 企业版服务,所以这里对Proxmox VE 企业版更新源进行注释操作。

vi /etc/apt/sources.list.d/pve-enterprise.list
  • 1

注释掉下边代码


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

2、 配置DNS 服务器

vi /etc/resolv.conf
  • 1

写入下边dns服务器

#设置首选dns
nameserver 114.114.114.114  
#设置备用dns
nameserver 8.8.8.8   
  • 1
  • 2
  • 3
  • 4

重启网络配置让其生效。

sudo service networking restart
  • 1

3、 执行更新或者安装软件依赖

执行更新源

apt update
  • 1

若是仍然报错,不能更新或安装;先删除 /var/lib/apt/lists/partial 目录下的所有文件,然后运行apt-get update。

cd /var/lib/apt/lists/partial
rm ./* 
apt-get update
  • 1
  • 2
  • 3

如需升级pve,则执行该命令

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

更新已安装的包

apt upgrade
  • 1

安装软件或依赖

apt-get install vim -y 
  • 1
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Gausst松鼠会/article/detail/209187
推荐阅读
相关标签
  

闽ICP备14008679号