Debian

Debian Sid:將單個軟體包降級到“以前的版本”

  • April 28, 2022

我很高興地執行著一個最先進的 Debian Sid 工作站。

不幸的是,我發生了“上游回歸”(network-manager-vpnc 破壞了 1.2.7 -> 1.2.8)

因此,我需要“降級”到以前的版本。

我知道我應該能夠做到這一點:

sudo apt install network-manager-vpnc=1.2.7

但這似乎對 Sid 不起作用:

sudo apt policy network-manager-vpnc
network-manager-vpnc:
 Installed: 1.2.8-3
 Candidate: 1.2.8-3
 Version table:
*** 1.2.8-3 500
       500 http://deb.debian.org/debian sid/main amd64 Packages
       100 /var/lib/dpkg/status

這意味著只有一個版本可用,因此錯誤不足為奇:

sudo apt install network-manager-vpnc=1.2.7
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package network-manager-vpnc is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Version '1.2.7' for 'network-manager-vpnc' was not found

我能做些什麼?

**更新:**正如@Stephen-Kitt 正確指出的那樣,“以前的版本”(1.2.7)從未上傳到 Debian 檔案庫,所以“解決方案”是降級到 1.2.6-3。

進入工作系統的程序(對我來說)是:

mcon@cinderella:/tmp/t$ wget http://ftp.it.debian.org/debian/pool/main/n/network-manager-vpnc/network-manager-vpnc_1.2.6-3_amd64.deb
--2022-04-28 19:34:27--  http://ftp.it.debian.org/debian/pool/main/n/network-manager-vpnc/network-manager-vpnc_1.2.6-3_amd64.deb
Resolving ftp.it.debian.org (ftp.it.debian.org)... 85.94.199.210, 2001:4b78:2000:1::1
Connecting to ftp.it.debian.org (ftp.it.debian.org)|85.94.199.210|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 125812 (123K) [application/vnd.debian.binary-package]
Saving to: ‘network-manager-vpnc_1.2.6-3_amd64.deb’

network-manager-vpnc_1.2.6-3_am 100%[====================================================>] 122.86K  --.-KB/s    in 0.05s   

2022-04-28 19:34:27 (2.29 MB/s) - ‘network-manager-vpnc_1.2.6-3_amd64.deb’ saved [125812/125812]

mcon@cinderella:/tmp/t$ wget http://ftp.it.debian.org/debian/pool/main/n/network-manager-vpnc/network-manager-vpnc-gnome_1.2.6-3_amd64.deb
--2022-04-28 19:34:56--  http://ftp.it.debian.org/debian/pool/main/n/network-manager-vpnc/network-manager-vpnc-gnome_1.2.6-3_amd64.deb
Resolving ftp.it.debian.org (ftp.it.debian.org)... 85.94.199.210, 2001:4b78:2000:1::1
Connecting to ftp.it.debian.org (ftp.it.debian.org)|85.94.199.210|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 35592 (35K) [application/vnd.debian.binary-package]
Saving to: ‘network-manager-vpnc-gnome_1.2.6-3_amd64.deb’

network-manager-vpnc-gnome_1.2. 100%[====================================================>]  34.76K  --.-KB/s    in 0.02s   

2022-04-28 19:34:56 (1.69 MB/s) - ‘network-manager-vpnc-gnome_1.2.6-3_amd64.deb’ saved [35592/35592]
mcon@cinderella:~$ sudo apt remove --purge network-manager-vpnc network-manager-vpnc-gnome 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following package was automatically installed and is no longer required:
 vpnc
Use 'sudo apt autoremove' to remove it.
The following packages will be REMOVED:
 network-manager-vpnc* network-manager-vpnc-gnome*
0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
After this operation, 1,026 kB disk space will be freed.
Do you want to continue? [Y/n] 
(Reading database ... 244048 files and directories currently installed.)
Removing network-manager-vpnc-gnome (1.2.8-3) ...
Removing network-manager-vpnc (1.2.8-3) ...
Processing triggers for dbus (1.14.0-1) ...
mcon@cinderella:~$ sudo dpkg -i /tmp/t/network-manager-vpnc_1.2.6-3_amd64.deb 
Selecting previously unselected package network-manager-vpnc.
(Reading database ... 243969 files and directories currently installed.)
Preparing to unpack .../network-manager-vpnc_1.2.6-3_amd64.deb ...
Unpacking network-manager-vpnc (1.2.6-3) ...
Setting up network-manager-vpnc (1.2.6-3) ...
Processing triggers for dbus (1.14.0-1) ...
mcon@cinderella:~$ sudo dpkg -i /tmp/t/network-manager-vpnc-gnome_1.2.6-3_amd64.deb 
Selecting previously unselected package network-manager-vpnc-gnome.
(Reading database ... 244039 files and directories currently installed.)
Preparing to unpack .../network-manager-vpnc-gnome_1.2.6-3_amd64.deb ...
Unpacking network-manager-vpnc-gnome (1.2.6-3) ...
Setting up network-manager-vpnc-gnome (1.2.6-3) ...
mcon@cinderella:~$ 

然後,在檢查它確實有效之後:

mcon@cinderella:/tmp/t$ sudo apt-mark hold network-manager-vpnc
network-manager-vpnc set on hold.
mcon@cinderella:/tmp/t$ sudo apt-mark hold network-manager-vpnc-gnome
network-manager-vpnc-gnome set on hold.

非常感謝@Stephen

如果您使用的是 Debian,我懷疑舊版本是 1.2.7,因為它從未上傳到檔案中。請注意,對於apt’s=語法,您需要指定完整的包版本,例如“1.2.8-3”。

無論如何,您可以在 snapshot.debian.org 上找到過去 15 年上傳到檔案的軟體包的所有版本;這包括network-manager-vpnc. 在那裡下載適當的軟體包,安裝它(使用dpkg -i),然後暫停它(apt-mark hold network-manager-vpnc),這樣它就不會再次升級。

您可以apt為特定快照配置源;有關詳細資訊,請參閱Debian 10:升級到特定的次要版本 (10.10)。您可能還會發現為什麼以前版本的 Debian 軟體包會在軟體包儲存庫中消失?(與版本控制的系統配置高度相關)相關。

還請送出一個錯誤(reportbug network-manager-vpnc),以便其他人可以了解回歸併希望它可以修復。

引用自:https://unix.stackexchange.com/questions/700754