【已解决】 ubuntu apt-get update连不上dl.google.com

在终端使用apt-get update时,连接dl.google.com超时,一直卡在0%,原因是当前ip无法ping到google(墙)。

解决方法:

dl.google.com国内可用IP

选一个,然后按以下命令操作:

cd ~
vim /etc/hosts

在hosts文件下面添加一下内容:

#Download 下载
180.163.151.161 dl.google.com
180.163.151.161 dl-ssl.google.com

 #Groups
180.163.151.161 groups.google.com

 #Google URL Shortener
180.163.151.161 goo.gl

 #Google App Engine
180.163.151.161 appengine.google.com


修改完成后,使ping命令来测试,结果如下图:

再重新 apt-get update就好了

sudo apt-get update sudo apt-get install ubuntu-make [sudo] password for sqa: Hit:1 http://cn.archive.ubuntu.com/ubuntu jammy InRelease Get:2 http://cn.archive.ubuntu.com/ubuntu jammy-updates InRelease [128 kB] Hit:3 https://typora.io/linux ./ InRelease Get:4 http://cn.archive.ubuntu.com/ubuntu jammy-backports InRelease [127 kB] Get:5 http://cn.archive.ubuntu.com/ubuntu jammy-updates/main amd64 DEP-11 Metadata [103 kB] Get:6 http://cn.archive.ubuntu.com/ubuntu jammy-updates/main amd64 c-n-f Metadata [18.5 kB] Get:7 http://cn.archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 DEP-11 Metadata [212 B] Get:8 http://cn.archive.ubuntu.com/ubuntu jammy-updates/universe amd64 DEP-11 Metadata [359 kB] Get:9 http://cn.archive.ubuntu.com/ubuntu jammy-updates/multiverse amd64 DEP-11 Metadata [940 B] Get:10 http://cn.archive.ubuntu.com/ubuntu jammy-backports/main amd64 DEP-11 Metadata [7,080 B] Get:11 http://cn.archive.ubuntu.com/ubuntu jammy-backports/restricted amd64 DEP-11 Metadata [212 B] Get:12 http://cn.archive.ubuntu.com/ubuntu jammy-backports/universe amd64 DEP-11 Metadata [22.9 kB] Get:13 http://cn.archive.ubuntu.com/ubuntu jammy-backports/multiverse amd64 DEP-11 Metadata [212 B] Hit:15 https://download.docker.com/linux/ubuntu jammy InRelease Hit:16 https://dl.google.com/linux/chrome/deb stable InRelease Get:17 http://security.ubuntu.com/ubuntu jammy-security InRelease [129 kB] Get:18 http://security.ubuntu.com/ubuntu jammy-security/main amd64 DEP-11 Metadata [43.1 kB] Get:19 http://security.ubuntu.com/ubuntu jammy-security/restricted amd64 DEP-11 Metadata [208 B] Get:20 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 DEP-11 Metadata [125 kB] Get:21 http://security.ubuntu.com/ubuntu jammy-security/multiverse amd64 DEP-11 Metadata [208 B] Get:14 https://packagecloud.io/rabbitmq/rabbitmq-server/ubuntu jammy InRelease [29.9 kB] Err:14 https://packagecloud.io/rabbitmq/rabbitmq-server/ubuntu jammy InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY F6609E60DC62814E Reading package lists... Done W: GPG error: https://packagecloud.io/rabbitmq/rabbitmq-server/ubuntu jammy InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY F6609E60DC62814E E: The repository 'https://packagecloud.io/rabbitmq/rabbitmq-server/ubuntu jammy InRelease' is not signed. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. Reading package lists... Done Building dependency tree... Done Reading state information... Done E: Unable to locate package ubuntu-make sqa@sqa-Precision-3480:~$ umake android Command 'umake' not found, but can be installed with: sudo snap install ubuntu-make
最新发布
03-29
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值