AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 882495
Accepted
Run
Run
Asked: 2017-02-13 02:12:39 +0800 CST2017-02-13 02:12:39 +0800 CST 2017-02-13 02:12:39 +0800 CST

ubuntu 16.10 konsole 连接到 gb.archive.ubuntu.com 的速度非常慢 [重复]

  • 772
这个问题在这里已经有了答案:
IPv6 sudo apt-get update/upgrade 问题 1 个回答
5年前关闭。

为什么apt-get install下面这条线总是很慢?

0% [Connecting to gb.archive.ubuntu.com (2001:67c:1560:8001::14)]

有时需要长达 5 到 10 分钟。它大部分时间都卡在那里。

例如:

$ sudo apt-get install php-pgsql
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  gyp libjs-inherits libjs-node-uuid libuv1 libuv1-dev linux-headers-4.8.0-22 linux-headers-4.8.0-22-generic linux-image-4.8.0-22-generic linux-image-extra-4.8.0-22-generic
  node-abbrev node-ansi node-ansi-color-table node-archy node-async node-block-stream node-combined-stream node-cookie-jar node-delayed-stream node-forever-agent node-form-data
  node-fstream node-fstream-ignore node-github-url-from-git node-glob node-graceful-fs node-gyp node-inherits node-ini node-json-stringify-safe node-lockfile node-lru-cache
  node-mime node-minimatch node-mkdirp node-mute-stream node-node-uuid node-nopt node-normalize-package-data node-npmlog node-once node-osenv node-qs node-read
  node-read-package-json node-request node-retry node-rimraf node-semver node-sha node-sigmund node-slide node-tar node-tunnel-agent node-underscore node-which
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  php7.0-pgsql
The following NEW packages will be installed
  php-pgsql php7.0-pgsql
0 to upgrade, 2 to newly install, 0 to remove and 1 not to upgrade.
Need to get 57.7 kB of archives.
After this operation, 223 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
0% [Connecting to gb.archive.ubuntu.com (2001:67c:1560:8001::14)]
Get:1 http://gb.archive.ubuntu.com/ubuntu yakkety-updates/main amd64 php7.0-pgsql amd64 7.0.13-0ubuntu0.16.10.1 [55.8 kB]
Get:2 http://gb.archive.ubuntu.com/ubuntu yakkety/main amd64 php-pgsql all 1:7.0+44 [1,920 B]                                                                                     
Fetched 57.7 kB in 8min 4s (118 B/s)                                                                                                                                              
Selecting previously unselected package php7.0-pgsql.                                                                                                                             
(Reading database ... 258311 files and directories currently installed.)                                                                                                          
Preparing to unpack .../0-php7.0-pgsql_7.0.13-0ubuntu0.16.10.1_amd64.deb ...                                                                                                      
Unpacking php7.0-pgsql (7.0.13-0ubuntu0.16.10.1) ...
Selecting previously unselected package php-pgsql.
Preparing to unpack .../1-php-pgsql_1%3a7.0+44_all.deb ...
Unpacking php-pgsql (1:7.0+44) ...
Processing triggers for libapache2-mod-php7.0 (7.0.13-0ubuntu0.16.10.1) ...
Setting up php7.0-pgsql (7.0.13-0ubuntu0.16.10.1) ...

Creating config file /etc/php/7.0/mods-available/pgsql.ini with new version

Creating config file /etc/php/7.0/mods-available/pdo_pgsql.ini with new version
Setting up php-pgsql (1:7.0+44) ...
Processing triggers for libapache2-mod-php7.0 (7.0.13-0ubuntu0.16.10.1) ...

我在 ubuntu/kubuntu 16.10 上。

编辑:

$ ping -c4 gb.archive.ubuntu.com
PING gb.archive.ubuntu.com(steelix.canonical.com (2001:67c:1560:8001::11)) 56 data bytes

--- gb.archive.ubuntu.com ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 3056ms

对比

$ ping6 -c4 gb.archive.ubuntu.com
PING gb.archive.ubuntu.com(steelix.canonical.com (2001:67c:1560:8001::11)) 56 data bytes

--- gb.archive.ubuntu.com ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 3073ms

编辑2:

$ which ping
/bin/ping

$ ping -V
ping utility, iputils-s20150815
apt
  • 1 1 个回答
  • 1999 Views

1 个回答

  • Voted
  1. Best Answer
    Yaron
    2017-02-13T02:20:20+08:002017-02-13T02:20:20+08:00

    注意:您似乎已连接到 Ubuntu 镜像,IPv6这可能会导致响应缓慢

    为了仅使用,您可以使用此处建议IPv4的以下方法 :

    -o Acquire::ForceIPv4=true运行时添加apt-get。

    如果你想让设置持久化,只需创建 /etc/apt/apt.conf.d/99force-ipv4并放入Acquire::ForceIPv4 "true";它:

    echo 'Acquire::ForceIPv4 "true";' | sudo tee /etc/apt/apt.conf.d/99force-ipv4
    

    一些链接可以帮助您获得更快的镜像:

    使用 GUI:https ://blog.kmonsoor.com/ubuntu-update-apt-get-server-to-use-fastest-mirror/

    使用命令行:http ://tuxdiary.com/2015/06/13/find-fastest-ubuntu-mirror-cmdline/

    使用 apt-select:https://github.com/jblakeman/apt-select

    • 2

相关问题

  • 如何编写 shell 脚本来安装应用程序列表?

  • 如何查看存档中可用的软件包的所有版本?

  • 是否可以说出我安装的哪些软件包不在原版安装中?

  • 如何删除 PPA?

  • 使用 apt-get upgrade 时如何强制安装内核更新?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve