我正在尝试使用 Python 2.7.9 将 Certbot 从 0.10.2 更新到支持 Debian 9.1 中的 ACME 2 的某个版本。
apt-cache policy certbot
certbot:
Installed: 0.10.2-1
Candidate: 0.28.0-1~deb9u2
Version table:
0.28.0-1~deb9u2 500
500 http://deb.debian.org/debian oldstable/main amd64 Packages
500 http://deb.debian.org/debian oldstable-updates/main amd64 Packages
0.28.0-1~bpo9+1 100
100 http://ftp.debian.org/debian stretch-backports/main amd64 Packages
*** 0.10.2-1 100
100 /var/lib/dpkg/status
从这里开始,这就是我正在尝试的:
echo "deb http://ftp.debian.org/debian stretch-backports main">>/etc/apt/sources.list
apt-get update
apt-get install python-certbot-nginx -t stretch-backports
/etc/apt/sources.list
deb http://deb.debian.org/debian/ oldstable main contrib non-free
deb-src http://deb.debian.org/debian/ oldstable main contrib non-free
deb http://deb.debian.org/debian/ oldstable-updates main contrib non-free
deb-src http://deb.debian.org/debian/ oldstable-updates main contrib non-free
deb http://deb.debian.org/debian-security oldstable/updates main
deb-src http://deb.debian.org/debian-security oldstable/updates main
deb http://ftp.debian.org/debian stretch-backports main
deb-src http://ftp.debian.org/debian stretch-backports main
||/ Name Version Architecture Description
+++-===================================-======================-======================-============================================================================
ii libc6:amd64 2.24-11+deb9u1 amd64 GNU C Library: Shared libraries
错误:
apt-get install python-certbot-nginx -t stretch-backports
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
libc-dev-bin : Depends: libc6 (> 2.28) but 2.24-11+deb9u1 is to be installed
Recommends: manpages-dev but it is not going to be installed
libc6-dev : Depends: libc6 (= 2.28-10) but 2.24-11+deb9u1 is to be installed
locales : Depends: libc-bin (> 2.28) but 2.24-11+deb9u1 is to be installed
python-certbot-nginx : Depends: python3-certbot-nginx but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
libc6:
Installed: 2.24-11+deb9u1
Candidate: 2.24-11+deb9u4
Version table:
2.24-11+deb9u4 500
500 http://deb.debian.org/debian oldstable/main amd64 Packages
*** 2.24-11+deb9u1 500
500 http://deb.debian.org/debian-security oldstable/updates/main amd64 Packages
100 /var/lib/dpkg/status
libc6-dev:
Installed: 2.28-10
Candidate: 2.28-10
Version table:
*** 2.28-10 100
100 /var/lib/dpkg/status
2.24-11+deb9u4 500
500 http://deb.debian.org/debian oldstable/main amd64 Packages
2.24-11+deb9u1 500
500 http://deb.debian.org/debian-security oldstable/updates/main amd64 Packages
locales:
Installed: 2.28-10
Candidate: 2.28-10
Version table:
*** 2.28-10 100
100 /var/lib/dpkg/status
2.24-11+deb9u4 500
500 http://deb.debian.org/debian oldstable/main amd64 Packages
2.24-11+deb9u1 500
500 http://deb.debian.org/debian-security oldstable/updates/main amd64 Packages
libc-dev-bin:
Installed: 2.28-10
Candidate: 2.28-10
Version table:
*** 2.28-10 100
100 /var/lib/dpkg/status
2.24-11+deb9u4 500
500 http://deb.debian.org/debian oldstable/main amd64 Packages
2.24-11+deb9u1 500
500 http://deb.debian.org/debian-security oldstable/updates/main amd64 Packages
任何想法?这是一个生产服务器。
编辑:
所以显然我已经在 Debian 9 中安装了一些来自 Debian 10 的软件包。因为我不能用 apt 做任何事情,所以我试图用 aptitude 解决依赖关系。
(venv)root@deb64:/home/x/# aptitude -V -s install libc6-dev=2.24-11+deb9u4
The following packages will be DOWNGRADED:
libc6-dev{b} [2.28-10 -> 2.24-11+deb9u4]
The following packages will be REMOVED:
libc-dev-bin{u} [2.28-10]
The following packages will be upgraded:
libc6 [2.24-11+deb9u1 -> 2.24-11+deb9u4] linux-libc-dev [4.9.30-2+deb9u5 -> 4.9.210-1]
The following partially installed packages will be configured:
libc-l10n locales{b} man-db
2 packages upgraded, 0 newly installed, 1 downgraded, 1 to remove and 235 not upgraded.
Need to get 6,539 kB of archives. After unpacking 3,561 kB will be freed.
The following packages have unmet dependencies:
libc6-dev : Depends: libc-dev-bin (= 2.24-11+deb9u4) but it is not going to be installed
locales : Depends: libc-bin (> 2.28) but 2.24-11+deb9u1 is installed and it is kept back
The following actions will resolve these dependencies:
Remove the following packages:
1) locales [2.28-10 (now)]
2) task-english [3.39 (now, oldstable)]
Install the following packages:
3) locales-all [2.24-11+deb9u4 (oldstable)]
Upgrade the following packages:
4) postgresql-9.4 [9.4.13-0+deb8u1 (now) -> 9.4.26-2.pgdg90+1 (stretch-pgdg)]
5) postgresql-9.6 [9.6.4-0+deb9u1 (now) -> 9.6.18-1.pgdg90+1 (stretch-pgdg)]
6) postgresql-contrib-9.4 [9.4.13-0+deb8u1 (now) -> 9.4.26-2.pgdg90+1 (stretch-pgdg)]
7) postgresql-contrib-9.6 [9.6.4-0+deb9u1 (now) -> 9.6.18-1.pgdg90+1 (stretch-pgdg)]
Downgrade the following packages:
8) libc-dev-bin [2.28-10 (now) -> 2.24-11+deb9u4 (oldstable)]
Accept this solution? [Y/n/q/?] q
如果我接受此解决方案,系统是否安全?
ii libc6:amd64 2.24-11+deb9u1 amd64 GNU C Library: Shared libraries
iU libc6-dev:amd64 2.28-10 amd64 GNU C Library: Development Libraries and Header Files
我不建议混合和匹配适用于发行版不同主要版本的软件包,因为有时会引入依赖关系,从而破坏整体。如果可能的话,我会在包源没有混合的其他地方“重建”服务器,因为 libc 是一件需要改变的主要事情......
正如其他人所建议的那样,您是否可以在 docker 之类的东西中运行您的服务,以便每个人都可以拥有它想要的环境而不会污染主机的环境?这样,如果事情发生横向变化,您可以拆除容器并构建一个新的......
TLDR;我很担心你的服务器,因为听起来你已经“越过了溪流”。
终于找到了解决办法:
另一个用户也有同样的问题,幸运的是有人在这里找到了解决方案。
您的配置的第一个视图看起来不错:
stretch
oldstable
目前指向stretch
所有列出的配置都显示了应该一起工作的值。作为
/var/lib/dpkg/status
一些比所列版本更新的软件包版本的列表,必须假设在某些时候存在:正如
libc6
所涉及的那样,任何单个步骤都需要谨慎/注意。如果这个包被破坏/删除,系统将处于“不可操作”状态。我个人建议坚持使用一种工具来解决这种情况,并且只会
apt
使用dpkg
。apt-get install -f
建议执行什么?python-certbot-nginx
包dpkg
将恢复apt
功能。apt
再次运行,至少需要降级libc6-dev
和libc6-dev-bin
,理想情况下是从“其他”存储库中提取的所有其他软件包。清除这种情况后,可以通过执行以下操作手动构建
python-certbot-nginx
包的反向移植:deb-src
条目update
。apt-get build-dep python-certbot-nginx
它将为 certbot 安装所有必需的构建依赖项apt-get source python-certbot-nginx -b
从 Debian 10 获取源包并尝试使用之前从 Debian 9 安装的依赖项构建它.deb
文件dpkg