How to install a specific version of a Debian package using apt-get

At work we use a backported version of Subversion as the stable package is 1.1.4 and I wanted to install the latest one we could get a package for which was version 1.3.2. Along with the backported Subversion package is a package that contains a number of useful hook scripts called subversion-tools.

When I did an apt-get install subversion-tools Debian wanted to install the 1.1.4 stable release not the 1.3.2 backported release. By doing an apt-cache show subversion-tools I was able to see the two available packages.

These are the steps I went through to install the backported version of subversion-tools, although these steps will work when installing any specific version of a Debian package.

Before you install a specific version of a package you need it's complete version.
This will be displayed when you run:
apt-cache showpkg <package name>

apt-cache showpkg subversion-tools

> Package: subversion-tools
> Versions:
> 1.3.2-5~bpo1(/var/lib/dpkg/status)
> 1.1.4-2 (/var/lib/apt/lists/

To install the specific version simply run run:
apt-get install <package name>=<version>

apt-get install subversion-tools=1.3.2-5~bpo1

Technorati Tags: , , , , , , ,


Deepak Mittal said...

Thanks Andrew. This is probably the second time your blog has helped me.

abeacock said...


Glad to be of some help! :)

adam said...

Thanks for this. What google couldnt easily find in the official docs (buried too deep) your blog supplied :)

It leaves me speechless that tools so thoroughly critical to running Debian as apt-get and aptitude are still so horrendously user-unfriendly. I've been using apt for almost 10 years now and it's still a nightmare of having to memorize huge amounts of obscure knowledge (and I also just had to manually up my apt cache to defeat the dreaded MMap error - an error which should be avoidable anyway, but at the very least ought to tell you what to do!).

abeacock said...


I know exactly how you feel! That is one of the main reasons for my blog, so that I can capture stuff that I couldn't find out on the web how to do.

Anonymous said...

Thanks! This helped me quickly and rather painlessly. :)

V!W! said...

THANKS, having problem with fMMS of N900. This helped me to install previous version to try my luck again!

Kasper said...

Nice to know about this, but what does one do when apt-cache showpkg only shows one version? I have a buggy package installed, and I know older versions don't have this bug, but with showpkg they don't show up.

VMR Global Solutions said...

Thanks Andrew !!

Anonymous said...

thanks, its usefull for me!

Sebastian Kruse said...

Thanks for the nice tutoral to add older packages to my system. So I could fix the latest mercurial issue see:

Sebastian Kruse said...

Thanks for the nice tutoral to add older packages to my system. So I could fix the latest mercurial issue see:

Piotr Szeptynski said...
This comment has been removed by the author.
Piotr Szeptynski said...

I would go for apt-cache policy package_name for a less cluttered screen :)

Anonymous said...

AAARGH .. Why Debilan is debil-like .. Othen distros normaly use more specific definition .. name or name-version ..
name = version is mad idea.. too many googling for this .. shit .. die debilan, die ..

MrMixALot said...

Thank you Andrew, your explanation enabled me to start sshd on a remote server, where openssl got updated and sshd then didn't want to restart because of version mismatch. If I got disconnected I couldn't get back in, so I used your instructions to downgrade openssl and libssl to version before the upgrade, it worked and sshd wanted to start again! Lovely!

James Burnett said...

Andrew - you are the MAN for posting this! Thanks. NFSen wouldn't work with rrdtool 1.4008 under Debian Jessie..

Tip for anyone else - if you need an older version that isn't in the apt-cache, you can add an older source to your /etc/apt/sources.list file and run apt-get update

Thanks again Andrew