shell apt-get尝试连接到未知IP

r55awzrz  于 2022-11-16  发布在  Shell
关注(0)|答案(4)|浏览(145)

坦白:我只是一个有 shell 和网络的菜鸟,如果这是一个错误,我很抱歉!
apt-get在我的shell中似乎不起作用。它似乎试图连接到一个IP(10.6.1.57),而这个IP甚至对ping都没有响应。
这是我尝试apt-update时发生的情况:0% [连接到10.6.1.57(10.6.1.57)] [连接到10.6.1.57(10.6.1.57)] {这似乎持续了很长时间}
下面是我的/etc/apt/sources.list文件:

# deb cdrom:[Ubuntu 14.04 LTS _Trusty Tahr_ - Release amd64 (20140417)]/ trusty main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://archive.ubuntu.com/ubuntu trusty main restricted
deb-src http://archive.ubuntu.com/ubuntu trusty main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://archive.ubuntu.com/ubuntu trusty-updates main restricted
deb-src http://archive.ubuntu.com/ubuntu trusty-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://archive.ubuntu.com/ubuntu trusty universe
deb-src http://archive.ubuntu.com/ubuntu trusty universe
deb http://archive.ubuntu.com/ubuntu trusty-updates universe
deb-src http://archive.ubuntu.com/ubuntu trusty-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://archive.ubuntu.com/ubuntu trusty multiverse
deb-src http://archive.ubuntu.com/ubuntu trusty multiverse
deb http://archive.ubuntu.com/ubuntu trusty-updates multiverse
deb-src http://archive.ubuntu.com/ubuntu trusty-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse

deb http://archive.ubuntu.com/ubuntu trusty-security main restricted
deb-src http://archive.ubuntu.com/ubuntu trusty-security main restricted
deb http://archive.ubuntu.com/ubuntu trusty-security universe
deb-src http://archive.ubuntu.com/ubuntu trusty-security universe
deb http://archive.ubuntu.com/ubuntu trusty-security multiverse
deb-src http://archive.ubuntu.com/ubuntu trusty-security multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
deb http://archive.canonical.com/ubuntu trusty partner
deb-src http://archive.canonical.com/ubuntu trusty partner

## Uncomment the following two lines to add software from Ubuntu's
## 'extras' repository.
## This software is not part of Ubuntu, but is offered by third-party
## developers who want to ship their latest software.
deb http://extras.ubuntu.com/ubuntu trusty main
deb-src http://extras.ubuntu.com/ubuntu trusty main
slsn1g29

slsn1g291#

也检查此文件:/etc/apt/apt.conf.d/00apt-cacher-proxy可能有一些代理,就像我的例子一样。

yhived7q

yhived7q2#

在/etc/apt/sources.list.d/中检查包含该ip的文件列表。

jckbn6z7

jckbn6z73#

我只做了一点改动,8.8.8.8在/etc/resolve.conf中添加了“nameserverwww.example.com“,效果很好

nbnkbykc

nbnkbykc4#

这可以是自定义存储库地址和APT代理覆盖配置。它们可以在/etc/apt/下的多个位置设置。
将地址www.example.com解析10.6.1.57为主机名(例如,使用host 10.6.1.57),然后在整个/etc/apt/目录中搜索IP和主机名。

grep -r 10.6.1.57 /etc/apt/

在我的例子中,它是/etc/apt/apt.conf中的自定义Acquire::http::Proxy设置。

相关问题