• 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

Clear History In Linux Terminal Permanently

How To Create Zip File In Ubuntu Terminal With Password

How To Check Difference Between Two Files In Linux Ubuntu

How To Check Kernel Installed Date In Linux Command Line

Ubuntu 25.04 ‘Plucky Puffin’ Is Available To Download

How to Login as Root User in Linux Terminal

Install Firefox In Ubuntu Terminal Command Line

How To List All Kernel Modules That Are Loaded In Ubuntu

Enable Ubuntu Auto Login Without Password

Download Ubuntu 25.04 Official Default Wallpapers

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

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