防止 apt-get 使用特定镜像

防止 apt-get 使用特定镜像

我在用古巴X1,一个定制的 Debian wheezy 发行版,位于我的 Cubietruck ARM 板上。

跑步apt-get 更新失败,因为它尝试连接到mirror.isoc.org.il在伊朗境内过滤的镜像以及以色列托管的其他域/IP。

以下是 的内容/etc/apt/sources.list

deb http://http.debian.net/debian/ wheezy main contrib non-free
deb http://http.debian.net/debian/ wheezy-updates main contrib non-free
deb http://http.debian.net/debian wheezy-backports main
deb http://security.debian.org/ wheezy/updates main contrib non-free
deb http://packages.cubian.org/ wheezy main non-free
deb http://repo.ajenti.org/debian main main debian

我已经注释掉了isoc.org.il这两个文件中也有引用:

  • /usr/share/python-apt/templates/Ubuntu.mirrors
  • /usr/share/python-apt/templates/Debian.mirrors

apt-get 更新仍然失败并显示以下消息:

W: Failed to fetch http://http.debian.net/debian/dists/wheezy/Release.gpg  Could not connect to mirror.isoc.org.il:80 (192.115.211.70). - connect (110: Connection timed out)

W: Failed to fetch http://http.debian.net/debian/dists/wheezy-updates/Release.gpg  Unable to connect to mirror.isoc.org.il:http:

W: Failed to fetch http://http.debian.net/debian/dists/wheezy-backports/Release.gpg  Unable to connect to mirror.isoc.org.il:http:

我不知道为什么 apt-get 仍然尝试使用像mirror.isoc.org.il 这样的镜像。也许它被认为是最近的镜子。有没有办法引导 apt-get 连接到另一个镜像?

以下是全文apt-get 更新输出:

cubie@Cubian:~$ sudo apt-get update
Get:1 http://repo.ajenti.org main Release.gpg [490 B]
Get:2 http://packages.cubian.org wheezy Release.gpg [316 B]
Hit http://repo.ajenti.org main Release
Get:3 http://security.debian.org wheezy/updates Release.gpg [836 B]
Hit http://packages.cubian.org wheezy Release
Hit http://repo.ajenti.org main/main armhf Packages
Hit http://packages.cubian.org wheezy/main armhf Packages
Hit http://security.debian.org wheezy/updates Release
Hit http://packages.cubian.org wheezy/non-free armhf Packages
Hit http://repo.ajenti.org main/debian armhf Packages
Hit http://security.debian.org wheezy/updates/main armhf Packages
Get:4 http://http.debian.net wheezy Release.gpg [1,655 B]
Hit http://packages.cubian.org wheezy/main Translation-en_US
Hit http://security.debian.org wheezy/updates/contrib armhf Packages
Hit http://packages.cubian.org wheezy/main Translation-en
Get:5 http://http.debian.net wheezy-updates Release.gpg [836 B]
Hit http://packages.cubian.org wheezy/non-free Translation-en_US
Hit http://security.debian.org wheezy/updates/non-free armhf Packages
Get:6 http://http.debian.net wheezy-backports Release.gpg [836 B]
Hit http://packages.cubian.org wheezy/non-free Translation-en
Hit http://security.debian.org wheezy/updates/contrib Translation-en
Hit http://http.debian.net wheezy Release
Hit http://security.debian.org wheezy/updates/main Translation-en
Hit http://http.debian.net wheezy-updates Release
Hit http://security.debian.org wheezy/updates/non-free Translation-en
Hit http://http.debian.net wheezy-backports Release
Hit http://http.debian.net wheezy/main armhf Packages
Hit http://http.debian.net wheezy/contrib armhf Packages
Hit http://http.debian.net wheezy/non-free armhf Packages
Hit http://http.debian.net wheezy/contrib Translation-en
Hit http://http.debian.net wheezy/main Translation-en
Hit http://http.debian.net wheezy/non-free Translation-en
Hit http://http.debian.net wheezy-updates/main armhf Packages/DiffIndex
Hit http://http.debian.net wheezy-updates/contrib armhf Packages
Hit http://http.debian.net wheezy-updates/non-free armhf Packages
Hit http://http.debian.net wheezy-updates/contrib Translation-en
Ign http://repo.ajenti.org main/debian Translation-en_US
Hit http://http.debian.net wheezy-updates/main Translation-en/DiffIndex
Ign http://repo.ajenti.org main/debian Translation-en
Ign http://repo.ajenti.org main/main Translation-en_US
Ign http://repo.ajenti.org main/main Translation-en
Hit http://http.debian.net wheezy-updates/non-free Translation-en
Hit http://http.debian.net wheezy-backports/main armhf Packages/DiffIndex
Hit http://http.debian.net wheezy-backports/main Translation-en/DiffIndex
Fetched 4,969 B in 18s (268 B/s)
Reading package lists... Done
cubie@Cubian:~$ sudo apt-get update
Get:1 http://repo.ajenti.org main Release.gpg [490 B]
Hit http://security.debian.org wheezy/updates Release.gpg
Get:2 http://repo.ajenti.org main Release [11.1 kB]
Hit http://packages.cubian.org wheezy Release.gpg
Hit http://security.debian.org wheezy/updates Release
Hit http://repo.ajenti.org main/main armhf Packages
Hit http://packages.cubian.org wheezy Release
Hit http://packages.cubian.org wheezy/main armhf Packages
Hit http://security.debian.org wheezy/updates/main armhf Packages
Get:3 http://repo.ajenti.org main/debian armhf Packages [1,468 B]
Hit http://packages.cubian.org wheezy/non-free armhf Packages
Hit http://security.debian.org wheezy/updates/contrib armhf Packages
Hit http://packages.cubian.org wheezy/main Translation-en_US
Hit http://security.debian.org wheezy/updates/non-free armhf Packages
Hit http://packages.cubian.org wheezy/main Translation-en
Hit http://security.debian.org wheezy/updates/contrib Translation-en
Hit http://packages.cubian.org wheezy/non-free Translation-en_US
Hit http://security.debian.org wheezy/updates/main Translation-en
Hit http://packages.cubian.org wheezy/non-free Translation-en
Hit http://security.debian.org wheezy/updates/non-free Translation-en
Ign http://repo.ajenti.org main/debian Translation-en_US
Ign http://repo.ajenti.org main/debian Translation-en
Ign http://repo.ajenti.org main/main Translation-en_US
Ign http://repo.ajenti.org main/main Translation-en
Err http://http.debian.net wheezy Release.gpg
  Could not connect to mirror.isoc.org.il:80 (192.115.211.70). - connect (110: Connection timed out)
Err http://http.debian.net wheezy-updates Release.gpg
  Unable to connect to mirror.isoc.org.il:http:
Err http://http.debian.net wheezy-backports Release.gpg
  Unable to connect to mirror.isoc.org.il:http:
Hit http://http.debian.net wheezy Release
Hit http://http.debian.net wheezy-updates Release
Hit http://http.debian.net wheezy-backports Release
Ign http://http.debian.net wheezy/main armhf Packages/DiffIndex
Ign http://http.debian.net wheezy/contrib armhf Packages/DiffIndex
Ign http://http.debian.net wheezy/non-free armhf Packages/DiffIndex
Hit http://http.debian.net wheezy/contrib Translation-en
Hit http://http.debian.net wheezy/main Translation-en
Hit http://http.debian.net wheezy/non-free Translation-en
Hit http://http.debian.net wheezy-updates/main armhf Packages/DiffIndex
Ign http://http.debian.net wheezy-updates/contrib armhf Packages/DiffIndex
Ign http://http.debian.net wheezy-updates/non-free armhf Packages/DiffIndex
Hit http://http.debian.net wheezy-updates/contrib Translation-en
Hit http://http.debian.net wheezy-updates/main Translation-en/DiffIndex
Hit http://http.debian.net wheezy-updates/non-free Translation-en
Hit http://http.debian.net wheezy-backports/main armhf Packages/DiffIndex
Hit http://http.debian.net wheezy-backports/main Translation-en/DiffIndex
Hit http://http.debian.net wheezy/main armhf Packages
Hit http://http.debian.net wheezy/contrib armhf Packages
Hit http://http.debian.net wheezy/non-free armhf Packages
Hit http://http.debian.net wheezy-updates/contrib armhf Packages
Hit http://http.debian.net wheezy-updates/non-free armhf Packages
Fetched 13.1 kB in 2min 9s (101 B/s)
W: Failed to fetch http://http.debian.net/debian/dists/wheezy/Release.gpg  Could not connect to mirror.isoc.org.il:80 (192.115.211.70). - connect (110: Connection timed out)

W: Failed to fetch http://http.debian.net/debian/dists/wheezy-updates/Release.gpg  Unable to connect to mirror.isoc.org.il:http:

W: Failed to fetch http://http.debian.net/debian/dists/wheezy-backports/Release.gpg  Unable to connect to mirror.isoc.org.il:http:

E: Some index files failed to download. They have been ignored, or old ones used instead.

答案1

我找不到删除 Replese.gpg 的方法马克说

尽管如此,我在apt-get installapt-get 仍然尝试连接到isoc.org.il.

为了解决这个问题,我使用固定镜像(美国镜像)生成了前 4 行debgen.simplylinux.ch。这是最终的工作sources.list

deb http://ftp.us.debian.org/debian wheezy main contrib non-free
deb http://ftp.debian.org/debian/ wheezy-updates main contrib non-free
deb http://ftp.debian.org/debian/ wheezy-backports main
deb http://security.debian.org/ wheezy/updates main contrib non-free
deb http://packages.cubian.org/ wheezy main non-free
deb http://repo.ajenti.org/debian main main debian

答案2

从仪表板上打开“软件和更新”。

选择“其他软件”选项卡。

找到这三行并取消选中或删除它们。

http://http.debian.net/debian/dists/wheezy/Release.gpg

http://http.debian.net/debian/dists/wheezy-backports/Release.gpg

http.debian.net/debian/dists/wheezy-updates/Release.gpg

现在你可以

sudo apt-get update

应该没事。

编辑:要通过终端删除存储库,请参阅广泛的答案

必须删除这些存储库,因为它们不再存在,当 apt 尝试更新您的软件包时,它找不到这些存储库并报告“无法获取”错误,在您的特定情况下,必须删除这些旧的存储库。

相关内容