【问题标题】:apt-get fails Debianapt-get 失败 Debian
【发布时间】:2017-03-11 14:13:05
【问题描述】:

我有一台运行 Debian Squeeze 的 Linux 服务器,我无法在其上运行 apt-get update。我收到如下错误:

W: Failed to fetch http://ftp.us.debian.org/debian/dists/squeeze/main/binary-i386/Packages.gz
Unable to connect to 10.197.3.5:3142:

我可以成功ping ftp.us.debian.org,但是它显示的ip地址与无法连接消息显示的ip地址不同。

我认为这是 DNS 翻译的问题,所以我将我的 DNS 服务器 更改为 google's 8.8.8.8 server 运行dig google.com

表明 DNS 服务器 实际上是我指定的 google 服务器。 我难住了。可能需要注意的是,我将 port 22port 80 转发到我的 router 以便我的队友可以ssh 并查看相关的网页与这台服务器。我认为这不是问题,因为即使我停止转发也会发生这种情况。

【问题讨论】:

  • 我认为您的sourcs.list 可能有问题,请分享您使用的版本。
  • 您是否定义了代理?如果 conf 文件不存在,可能在 /etc/apt/conf/etc/apt/apt.conf.d/70debconf 中。
  • 这是代理问题!这台服务器是其他公司搭建的,没想到他们设置了代理

标签: dns debian portforwarding apt-get


【解决方案1】:

原来这台服务器的原始持有者在 /etc/apt/apt.conf 中设置了一个代理,但它不起作用,(我不知道为什么会这样) 我从该文件中删除了这一行 获取::http::Proxy "PROXYIP/apt-cacher/";

【讨论】:

    【解决方案2】:

    我已经修复了类似的问题,应用了一条关于您的问题的评论:

    我的环境是:

    Linux debianlpi 3.16.0-4-amd64 #1 SMP Debian 3.16.39-1 (2016-12-30) x86_64 GNU/Linux
    

    我遇到的问题是:

    root@debianlpi:~# apt-get install vim
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    The following extra packages will be installed:
      vim-runtime
    Suggested packages:
      ctags vim-doc vim-scripts
    The following NEW packages will be installed:
      vim vim-runtime
    0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
    Need to get 5,999 kB of archives.
    After this operation, 28.5 MB of additional disk space will be used.
    Do you want to continue? [Y/n] y
    WARNING: The following packages cannot be authenticated!
      vim-runtime vim
    Install these packages without verification? [y/N] y
    0% [Connecting to idcproxy.compabc.com (432.1.2.20)]
    

    已修复删除 /etc/apt/apt.conf 中的行:

    root@debianlpi:~# cat /etc/apt/apt.conf
    #Acquire::http::Proxy "http://idcproxy.compabc.com:80";
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-01-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-06-21
      • 2019-08-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多