Debian

由於 libc6 版本,無法升級 certbot

  • June 7, 2020

我正在嘗試使用 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

終於找到了解決辦法:

apt install libc6/stretch libc6-dev/stretch libc-dev-bin/stretch libc-bin/stretch locales/stretch linux-libc-dev/stretch

另一個使用者也有同樣的問題,幸運的是有人在這裡找到了解決方案。

不建議混合和匹配適用於發行版不同主要版本的軟體包,因為有時會引入依賴關係,從而破壞整體。如果可能的話,我會在包源沒有混合的其他地方“重建”伺服器,因為 libc 是一件需要改變的主要事情……

正如其他人所建議的那樣,您是否可以在 docker 之類的東西中執行您的服務,以便每個人都可以擁有它想要的環境而不會污染主機的環境?這樣,如果事情發生橫向變化,您可以拆除容器並建構一個新的……

TLDR;我很擔心你的伺服器,因為聽起來你已經“越過了溪流”。

引用自:https://serverfault.com/questions/1018850