![尝试在 Debian Jessie 上安装 libssl-dev 时 apt-get install 未连接到服务器](https://linux22.com/image/104491/%E5%B0%9D%E8%AF%95%E5%9C%A8%20Debian%20Jessie%20%E4%B8%8A%E5%AE%89%E8%A3%85%20libssl-dev%20%E6%97%B6%20apt-get%20install%20%E6%9C%AA%E8%BF%9E%E6%8E%A5%E5%88%B0%E6%9C%8D%E5%8A%A1%E5%99%A8.png)
我以 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 安装将变得轻而易举。