Downgrade a package with its dependencies


#1

Debian package manager supports installing packages with version numbers. Using this feature, you can downgrade a package to stable version if you install a package from test or unstable repository before.

dpkg:
  Installed: 1.18.2
  Candidate: 1.18.2
  Version table:
*** 1.18.2 0
       500 http://ftp.uk.debian.org/debian/ unstable/main amd64 Packages
       100 /var/lib/dpkg/status
     1.17.25 0
        500 http://ftp.uk.debian.org/debian/ jessie/main amd64 Packages

But when you downgrade a package, apt doesn’t downgrade dependencies automatically. And it usually lists lots of broken dependencies. In that case, you can use pinning feature of apt to downgrade package with its all dependencies.

Pinning is a process that allows you to remain on a version for a package or remain on a release of Debian for specified packages. Apt choose candidate package according to priority of a release/version/repository set in pinning options. So you should pin all packages to stable version to downgrade a package. Add following lines to /etc/apt/preferences file.

Package: *
Pin: release a=jessie
Pin-Priority: 1001

Using 1001 as priority is trick here. Apt ignores values below 1000 for downgrade operations. So you have to use a number above 1000 for this scenario.

After you setup pinning and set priority as 1001 for stable release, apt will choose stable versions of package and its dependencies when you install it.

dpkg:
  Installed: 1.18.2
  Candidate: 1.17.25
  Version table:
 *** 1.18.2 0
       500 http://ftp.uk.debian.org/debian/ unstable/main amd64 Packages
       100 /var/lib/dpkg/status
     1.17.25 0
       1001 http://ftp.uk.debian.org/debian/ jessie/main amd64 Packages