• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
Source Digit

Source Digit

Linux, Ubuntu Tutorials & News, Technology, Gadgets & Gizmos

  • Home
  • How To
  • Ubuntu
  • Instagram
  • Blogging
  • Android
  • WordPress
  • +More
    • Cloud Computing
    • Gadgets
    • Social Media
    • Technology
  • Write for Us
Home / How To / Use Apt-Get to Install Specific Version of Package

Use Apt-Get to Install Specific Version of Package

By Sourabh / August 4, 2020 Category: How To, Ubuntu

Using apt-get command to install specific version of package in Ubuntu Linux. Ubuntu users can install package from previous release or install a specific version of a package.

A specific version of a package can be selected for installation by following the package name with an equals and the version of the package to select. This will cause that version to be located and selected for install. Alternatively a specific distribution can be selected by following the package name with a slash and the version of the distribution or the Archive name (stable, frozen, unstable).

For example, you could do:

sudo apt-get update
sudo apt-get install apache2=2.2.20-1ubuntu1

Note that you may need to do some dependency resolution on your own in this case, but if there are any problems apt-get will tell you what is causing them.

Check all the available version of a package

Use the apt-cache command to check the version of the package installed on your system plus all available packages in the Ubuntu repository. You can either run “apt-cache policy firefox” or “apt-cache madiosn firefox”. Please note that the firefox in the said command is the name of the package. if ypu are looking for some other package, name it there.


apt-cache policy firefox


apt-cache madison firefox

This is the output on my system

sourcedigit@SD:~$ apt-cache madison firefox
firefox | 59.0~b14+build1-0ubuntu0.16.04.1 | http://ppa.launchpad.net/mozillateam/firefox-next/ubuntu xenial/main i386 Packages
firefox | 45.0.2+build1-0ubuntu1 | http://archive.ubuntu.com/ubuntu xenial/main i386 Packages
sourcedigit@SD:~$ apt-cache policy firefox
firefox:
Installed: 59.0~b9+build1-0ubuntu0.16.04.1
Candidate: 59.0~b14+build1-0ubuntu0.16.04.1
Version table:
59.0~b14+build1-0ubuntu0.16.04.1 500
500 http://ppa.launchpad.net/mozillateam/firefox-next/ubuntu xenial/main i386 Packages
*** 59.0~b9+build1-0ubuntu0.16.04.1 100
100 /var/lib/dpkg/status
45.0.2+build1-0ubuntu1 500
500 http://archive.ubuntu.com/ubuntu xenial/main i386 Packages

Install a specific version of a package

Run the following command to install a specific version of a package {Firefox in our example}.

apt-get install package=version -V

So the code becomes “sudo apt install firefox=45.0.2+build1-0ubuntu1” which needs to be executed.

apt-get install -s package

-s is the parameter to simulate the installation so that no erroe is encountered during the installation process.

Tags: Apt-Get Install Specific Version Of Package, Apt-Get Install Version Greater Than, Git Install Specific Version, Install A Specific Version Of A Package Debian, Pip Install Specific Version, Ubuntu Apt-Get List Versions, Ubuntu Install Package From Previous Release, Ubuntu Packages

Primary Sidebar

Latest Posts

Re Execute The Previous Command In Linux Ubuntu Command Line

How Much RAM Is Needed For Ubuntu PC

How To Find Large Files And Directories In Linux Command Line

How To Use Clear Command History In Linux Terminal

Linux Command To Check RAM Size In Ubuntu Terminal In GB

How To Install Proprietary Drivers In Linux Ubuntu Using Terminal

How To Shutdown Linux With A 15 Minute Delay And Message

Free AI Courses With Certificate For Beginners In India

Best AI Plugins For WordPress To Use In 2026

3 Commands To Check USB Connection In Linux Terminal

© 2026 Source Digit • Linux, Ubuntu Tutorials & News, Technology, Gadgets & Gizmos

  • Home
  • About
  • Privacy Policy
  • Terms & Conditions
  • Contact Us
  • Sitemap