尝试在 Debian Jessie 上安装 libssl-dev 时 apt-get install 未连接到服务器

尝试在 Debian Jessie 上安装 libssl-dev 时 apt-get install 未连接到服务器

我以 root 身份运行此命令:

apt-get install libssl-dev

这是回应:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  libssl-doc libssl1.0.0 zlib1g-dev
The following NEW packages will be installed:
  libssl-dev libssl-doc zlib1g-dev
The following packages will be upgraded:
  libssl1.0.0
1 upgraded, 3 newly installed, 0 to remove and 129 not upgraded.
Need to get 3,656 kB of archives.
After this operation, 8,570 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
0% [Connecting to security.debian.org (2607:ea00:101:3c0b::1deb:215)] [Connecting to ftp.us.debian.org (2610:148:1f10:3::89)]

然后什么也没有发生。事情就这么悬着。我可以从服务器 ping 通,所以我肯定有互联网连接。

这是我的sources.list文件:

deb http://ftp.us.debian.org/debian/ jessie main contrib
deb-src http://ftp.us.debian.org/debian/ jessie main

deb http://security.debian.org/ jessie/updates main
deb-src http://security.debian.org/ jessie/updates main

# jessie-updates, previously known as 'volatile'
deb http://ftp.us.debian.org/debian/ jessie-updates main
deb-src http://ftp.us.debian.org/debian/ jessie-updates main

deb http://www.deb-multimedia.org jessie main non-free
deb-src http://www.deb-multimedia.org jessie main non-free

deb http://packages.linuxmint.com debian import

编辑#1 我最近IO::Socket::SSL通过 cpanm 安装了 perl 模块。我怀疑这会产生影响,但请记下这一点以防万一。

编辑#2 发现问题了。这是路由器设置问题:https://superuser.com/questions/1174054/cant-ping-ipv6-server-on-internet-from-debian-running-on-virtualbox/1174093#1174093

答案1

强制apt-get使用 IPv4:

apt-get install -o Acquire::ForceIPv4=true libssl-dev

使其永久化:

echo 'Acquire::ForceIPv4 "true";' > /etc/apt/apt.conf.d/42ipv4

答案2

libssl1.0.0来自安全存储库,但您的行

deb http://security.debian.org/ jessie/updates main

deb-src http://security.debian.org/ jessie/updates main

看起来还不错

Debian 有一个经常被人们提及的页面 -

 https://wiki.debian.org/DontBreakDebian/

我会非常怀疑你使用

deb http://packages.linuxmint.com debian import

deb-multimedia is not recommended by Debian, but it seems to be Ok for the moment

如果您不需要源代码,则不需要以 deb-src 开头的行。

您可以尝试 Debian Redirector,而不是使用静态存储库

反而。它会切换到更快的速度。

您可以将源列表更改为

deb http://httpredir.debian.org/debian jessie main contrib non-free
deb-src http://httpredir.debian.org/debian jessie main contrib non-free

deb http://httpredir.debian.org/debian jessie-updates main contrib non-free
deb-src http://httpredir.debian.org/debian jessie-updates main contrib non-free

deb http://security.debian.org/ jessie/updates main contrib non-free
deb-src http://security.debian.org/ jessie/updates main contrib non-free

deb http://www.deb-multimedia.org jessie main non-free

...然后做(作为根)

apt update
apt-upgrade

...然后再试一次

答案3

我在这里贡献了一篇文章https://askubuntu.com/questions/993609/error-installing-zlib1g-dev/1376130#1376130

在底部,我有正确的 jesse 链接,并显示您需要输入 apt-get 升级和更新的正确命令。一旦您按照这些说明进行操作,apt 安装将变得轻而易举。

相关内容