当前位置:首页 > linux > 正文内容

sudo apt-get update会失败,修改主机的dns的地址和更换源

root5年前 (2021-06-21)linux1531


ping google.com 不同

看本机的DNS配置信息是在:/etc/resolv.conf

发现是保留ip

修改直接vim /etc/resolv.conf

写入:

nameserver 8.8.8.8


保存之后重启一下网络服务

sudo /etc/init.d/networking restart


接下来就是修改apt的源

vim /etc/apt/sources.list

将里面的内容替换为下面的:

deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse


保存


然后去执行

sudo apt-get update


扫描二维码推送至手机访问。

版权声明:本文由一叶知秋发布,如需转载请注明出处。

本文链接:https://www.zhiqiu.top/?id=133

分享给朋友:

相关文章

linux 安装某些C源码程序,出现的依赖问题

configure:error:no acceptable C compiler found in $PATH这里提示是缺少C的编译器这个时候需要安装C的编译器但是我冬日大神告诉我还要点别的省的出问题。执行下面搞定:apt ins...

Cannot uninstall 'ipaddress'. It is a distutils installed project and thus

强制升级:sudo pip install --ignore-installed +模块名...

zabbix 中文乱码

zabbix 中文乱码

原因是因为zabbix没有支持中文的字体,在win找到一个中文字体文件名是:simkai.ttf把这个文件复制到服务器的/usr/share/zabbix/fonts  路径下然后修改zabbix的配置文件vim /us...

shell获取当前文件路径

curPath=$(readlink -f "$(dirname "$0")") echo $curPath    #或者 curPath=$(dirname $(readli...

办公室千兆服务器之间scp的传输速度被限制在3MB/s

服务器之间拷贝文件是十分常见的操作但是有时候会遇见一个问题,拷贝的速度是相当的缓慢。遇见问题就开始分析问题影响网络网络传输有:服务器a和b、服务器网卡A和B、网线、交换机、路由器由于服务器a和b在同一台交换机不考虑路由器的因素查看服务器网卡...

git 忽略文件不起作用 .gitignore

git rm -r --cached . git add .   git commit -m "update .gitignore"  git status查看是否是"working di...