Linux: How to install certain old version of a software via apt-get

10,693

If apt tracks the specific version you are looking for, (like Kyle said) then its pretty easy.

sudo apt-get install <pkg_name>=<pkg_version>

OR

sudo apt-get -t=<target_version> <pkg_name>

To see which packages are tracked, run

apt-cache showpkg <package_name> 

Unfortunately though, if a particular version is not managed by the apt, then you are out of luck using apt. It might be managed by some of the other package managers out there.

Share:
10,693
Hookstark
Author by

Hookstark

Updated on June 04, 2022

Comments

  • Hookstark
    Hookstark almost 2 years

    I am trying to install in my Linux PC (Raspberry Debian) the same versions of Apache, MySQL and PHP as installed in my remote public server.

    For instance, I'd like to install the last Legacy Release of the 2.2 Branch, Apache/2.2.31.

    $ apt-cache showpkg apache2
    Package: apache2
    Versions: 
    2.4.10-10+deb8u4 (/var/lib/apt/lists/mirrordirector.raspbian.org_raspbian_dists_jessie_main_binary-armhf_Packages)
    

    But there is no information about 2.2.31 version, neither in "Reverse Provides" section. I can do it by compiling from the sources, but it takes a lot of time. And I tried to find a reliable PPA or a reliable sources for deb packages, with no success.

    Any tip? Thank you very much.

  • Kyle Douglas
    Kyle Douglas almost 8 years
    sudo apt-get install pkg_name=version
  • Hookstark
    Hookstark almost 8 years
    Thank you very much for your answer. However: $ sudo apt-get update $ sudo apt-get install apache2=2.2.31 Reading package lists... Done Building dependency tree Reading state information... Done E: Version '2.2.31' for 'apache2' was not found