ubuntu apt Cannot initiate the connection to packages.cloud.google.com:80 (2404:6800:4008:801::200e)

在执行 sudo apt updata 时,出现如下问题:

g@g:/tmp$ sudo apt update
Hit:1 http://mirrors.aliyun.com/ubuntu bionic InRelease
Hit:2 http://mirrors.aliyun.com/ubuntu bionic-security InRelease                                                                        
Ign:3 http://dl.google.com/linux/chrome/deb stable InRelease                                                                            
Hit:4 http://mirrors.aliyun.com/ubuntu bionic-updates InRelease                                                                         
Hit:5 http://archive.ubuntukylin.com:10006/ubuntukylin xenial InRelease                                                                 
Hit:6 http://packages.microsoft.com/repos/vscode stable InRelease                                                                       
Hit:7 http://mirrors.aliyun.com/ubuntu bionic-backports InRelease                                                                       
Hit:8 http://mirrors.aliyun.com/ubuntu bionic-proposed InRelease                                                                        
Get:9 http://linux.teamviewer.com/deb stable InRelease [9,388 B]                                                                  
Hit:10 http://dl.google.com/linux/chrome/deb stable Release                                                  
Err:12 http://packages.cloud.google.com/apt cloud-sdk-bionic InRelease                                                                  
  Cannot initiate the connection to packages.cloud.google.com:80 (2404:6800:4008:801::200e). - connect (101: Network is unreachable) Could not connect to packages.cloud.google.com:80 (216.58.200.46), connection timed out
Fetched 9,388 B in 30s (310 B/s)                                       
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up-to-date.
W: Failed to fetch http://packages.cloud.google.com/apt/dists/cloud-sdk-bionic/InRelease  Cannot initiate the connection to packages.cloud.google.com:80 (2404:6800:4008:801::200e). - connect (101: Network is unreachable) Could not connect to packages.cloud.google.com:80 (216.58.200.46), connection timed out
W: Some index files failed to download. They have been ignored, or old ones used instead.
g@g:/tmp$

遇到这个问题后,一般的做法就是换源了。

打开ubuntu软件中心,点击左上角(ubuntu面板)的编辑--软件源,输入密码。打开后,选择合适的源,我选的时sohu的,毕竟国内的下载快,也不用忍受国外8005B/S的下载速度,即使开着VPN速度也不是很快。(也可以打开新立得更新管理器,点击左下角的设置)

一般是软件源的问题,不管是国外还是国内阿里的数据源都会出现这个问题,换一下软件源(我选的是sohu),再删除/var/lib/apt/lists/文件夹下的文件重新update就好。

sudo rm /var/lib/apt/lists/* -vf 
sudo apt-get update

谷歌被墙了,当然无法更新.也可为 apt-get 使用 http 代理: 假设代理地址为 http://127.0.0.1:8118

sudo apt-get -o Acquire::http::proxy="http://127.0.0.1:8118" update