Ubuntu – Install a specific version version not listed using madison


I'm trying to install a specific version of CrateDB, for example:

$sudo apt-get -s install crate=2.1.8-1~wheezy

but this package is not found.

Running 'apt-cache madison' only shows the latest version:

$sudo apt-cache madison crate
     crate | 2.2.3-1~wheezy | https://cdn.crate.io/downloads/apt/stable wheezy/main amd64 Packages
     crate | 2.2.3-1~wheezy | https://cdn.crate.io/downloads/apt/stable wheezy/main i386 Packages

Crate.io repository in sources.list:

deb https://cdn.crate.io/downloads/apt/stable/ wheezy main
deb-src https://cdn.crate.io/downloads/apt/stable/ wheezy main

All versions that are actually available (including 2.1.8-1~wheezy ):

How can I make apt see all the available packages and not just the latest one?

(I'm on Ubuntu 16.04.1 LTS)

Best Answer

Debian repositories (including Ubuntu) are designed to have only one candidate available for a package. By default, that's the newest version available for that release. You cannot change that - it's upstream, and the version is designated in the repository's Release file.

Warning: It's usually unwise to use Debian packages in Ubuntu unless you really know what you are doing. There are many reasons for this.

Warning: Downgrading a package is possible, but is unsupported. If you try it, and it doesn't work for whatever reason, then the best advice you will get is to revert to the correct version for your release of Ubuntu. A wrong-version package may cause all kinds of dependency problems. (That's why Debian repos don't play that game)

Step 1: Download the package to a location where you will find it again. In this case, let's put in the Downloads dir:

wget -o ~/Downloads/ https://cdn.crate.io/downloads/apt/stable/pool/main/c/crate/crate_2.1.8-1~wheezy_all.deb

Step 2: Uninstall the newer crate, install the older crate:

sudo apt remove crate
sudo apt install ~/Downloads/crate_2.1.8-1~wheezy_all.deb

Step 3: Prevent apt from upgrading crate automatically

sudo apt-mark hold crate
sudo apt-mark unhold crate <---- Someday (not today) you will need this to undo the hold