如何安装以前版本的 .deb 包并固定它?

如何安装以前版本的 .deb 包并固定它?

我正在尝试安装最新版本的subversionon Sid,但由于它有错误,我收到警告并中止安装。如何找到以前的版本、安装它并固定直到错误得到解决?

root@server01:~# apt-get install subversion  
Reading package lists... Done                                                                                                                                                                                 
Building dependency tree                                                                                                                                                                                      
Reading state information... Done                                                                                                                                                                             
Suggested packages:                                                                                                                                                                                           
  db5.3-util subversion-tools                                                                                                                                                                                 
The following NEW packages will be installed:                                                                                                                                                                 
  subversion                                                                                                                                                                                                  
0 upgraded, 1 newly installed, 0 to remove and 205 not upgraded.                                                                                                                                              
Need to get 0 B/981 kB of archives.                                                                                                                                                                           
After this operation, 4,844 kB of additional disk space will be used.                                                                                                                                         
Retrieving bug reports... Done                                                                                                                                                                                
Parsing Found/Fixed information... Done                                                                                                                                                                       
critical bugs of subversion (-> 1.9.2-2) <Outstanding>                                                                                                                                                        
 b1 - #803725 - subversion: dump-load of a repository modifies verbose log output: M line lost
serious bugs of subversion (-> 1.9.2-2) <Outstanding>
 b2 - #803589 - FTBFS with ruby2.2 (only)
Summary:
 subversion(2 bugs)
Are you sure you want to install/upgrade the above packages? [Y/n/?/...] n
**********************************************************************
****** Exiting with an error in order to stop the installation. ******
**********************************************************************
E: Sub-process /usr/sbin/apt-listbugs apt returned an error code (10)
E: Failure running script /usr/sbin/apt-listbugs apt

答案1

您可以指示apt-get安装特定版本的软件包。对于你的例子:

apt-get install subversion

您可以将版本附加到包名称中,例如

apt-get install subversion=1.9.2-1

寻找软件包版本,Debian wiki 页面回滚更新显示了一个可以在其中找到该信息的示例

http://www.debian.org/distrib/packages, IE,
https://www.debian.org/distrib/packages#search_packages

或(旧版本)通过

http://snapshot.debian.org/
http://snapshot.debian.org/package/subversion/

节目
http://snapshot.debian.org/package/subversion/1.9.2-2/
http://snapshot.debian.org/package/subversion/1.9.2-1/
http://snapshot.debian.org/package/subversion/1.9.1-1/

等等。

/etc/apt/preferences最后,Debian 页面显示了(作为示例)要进行的更改别针包裹。

答案2

这才是问题的最终解决方案。重要的是,sources.list 中存储库的 URL 应该是包含所需包的存储库的完整 URL,在本例中http://snapshot.debian.org/archive/debian/20150924T154447Z/。有一篇很好的文章写在http://mindref.blogspot.co.uk/2012/02/apt-revert-upgrade.html并在相关问题中也进行了解释 -将 Debian 包固定到存储库和版本的正确语法是什么?

/etc/apt/sources.list.d/snapshots.list

# snapshot.debian.org
# added for subversion 1.9.2 subversion bug #803725
deb http://snapshot.debian.org/archive/debian/20150924T154447Z/ unstable main

/etc/apt/preferences.d/subversion

Package: subversion libsvn1
Pin: version 1.9.2-1
Pin-Priority: 700

apt-cache 策略颠覆

subversion:
  Installed: 1.9.2-1
  Candidate: 1.9.2-1
  Package pin: 1.9.2-1
  Version table:
     1.9.2-3+b1 700
        500 http://http.debian.net/debian/ unstable/main amd64 Packages
 *** 1.9.2-1 700
        500 http://snapshot.debian.org/archive/debian/20150924T154447Z/ unstable/main amd64 Packages
        100 /var/lib/dpkg/status

相关内容