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

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

root4年前 (2021-06-21)linux893


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://zhiqiu.top/?id=133

分享给朋友:

相关文章

修改系统server文件需要加载一下配置

vim /usr/lib/systemd/system/*.service修改了server的配置需要执行一下systemctl daemon-reload让系统重新加载以下配置,尤其是server中的配置地址更换了分区...

FTP主动模式和被动模式的区别

基础知识:  FTP只通过TCP连接,没有用于FTP的UDP组件.FTP不同于其他服务的是它使用了两个端口, 一个数据端口和一个命令端口(或称为控制端口)。通常21端口是命令端口,20端口是数据端口。当混入主动/被动模式的概念时,...

git 忽略文件不起作用 .gitignore

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

linux创建用户和用户组

添加用户和组groupadd testuseradd -r -g test test删除用户和组userdel testgroupdel test给文件添加用户组和用户归属chown -R test:test test_file...

supervisor的安装使用

一、supervisor简介Supervisor是用Python开发的一套通用的进程管理程序,能将一个普通的命令行进程变为后台daemon,并监控进程状态,异常退出时能自动重启。它是通过fork/exec的方式把这些被管理的进程当作supe...

window设置socks代理

window设置socks代理

代理地址:socks=127.0.0.1 端口:11080...