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

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

root3年前 (2021-06-21)linux649


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

分享给朋友:

相关文章

apach 启动失败 可能因为安全策略

apach 启动失败 可能因为安全策略

执行 setenforce 0再次启动systemctl restart httpdOK 搞定...

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

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

curl 的请求 和几个参数

-X [POST GET PUT DELETE]参数执行http请求的方法-d参数用于发送post的请求的数据体$curl -d'login=emma&password=123'-X POST https://google....

zookeeper安装

Zookeeper 是一个分布式应用程序协调服务,主要用来写到分布式服务的上下线,主从问题,选举主节点等。下载新版 zookeeper:apache-zookeeper-3.7.0-bin1、解压后修改配置文件,进入 conf 目录,将 z...

永久更改Linux系统主机名hostname

1)sudo vim /etc/hostname如果你不更新/etc/hosts文件,那么有的程序,如sudo,不知道如何解析新的主机名。所以如果更改个人电脑的主机名,那么新的主机名应该解析为127.0.0.1。2)sudo hostnam...

境内网络访问境外网络,境外网络访问境内网络

境内网络访问境外网络,境外网络访问境内网络

境内网络访问境外网络总所周知,出国是需要护照的,出网同样也是需要一定的审核的。访问的网站是否合法当你访问一些国外的网站时(少量),能发现访问速度很慢。会出现下面的连接超时的错误同时还有访问速度的限制,经过测试大概100次/s(部分网站,尤其...