My questions are divided into two parts:
- How to know the version of installed package?
- How to install a specific package version?
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.
Sign up to join this communityMy questions are divided into two parts:
apt-cache policy <package name>
The above command will shows installed package version and also all the available versions in the repository according to the version of Ubuntu in which you are running.It doesn't display the package version which was intended for another version of Ubuntu(not your's).
$ apt-cache policy gparted
gparted:
Installed: 0.16.1-1
Candidate: 0.16.1-1
Version table:
*** 0.16.1-1 0
500 http://ubuntu.inode.at/ubuntu/ saucy/main amd64 Packages
100 /var/lib/dpkg/status
So the installed gparted version is 0.16.1-1
.
sudo apt-get install <package name>=<version>
$ sudo apt-get install gparted=0.16.1-1
Reading package lists... Done
Building dependency tree
Reading state information... Done
gparted is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 265 not upgraded.
The following packages have unmet dependencies:
, followed by a list of packages. Any way to make it resolve that automatically?
sudo dkpg -i <package-file>
. Dependency errors need to be resolved by downloading and installing (also with dkpg
) all missing packages (this can take many iterations). Alternatively you can download the program source code, compile it and install it (this also requires manual dependency resolution).
Jan 3, 2017 at 9:16
madison
? I found apt list -a <packagename>
works (apt list
even hints the -a
switch when more than one package version is available)
madison
as a <packagename>, so it does nothing if that package does not exist (You can test it with apt list asdasdas <packagename>
). Your command is the correct one -> apt list -a <packagename>
There is no general way to check the version of installed packages, but most of them can be checked using the command:
command -v
for example to know the version of apache2:
apache2 -v
But this may not work with other packages so the best practice is to search the manual.
man XXX
and search for the option of showing the version.
To install a specific version of a package:
sudo apt-get install package=version
For example:
sudo apt-get install apache2=2.3.35-4ubuntu1
2.3.35-4ubuntu1
when specifying the version?
May 23, 2016 at 15:32
apt-cache madison packagename
- it will display all versions that can be seen by whatever repos you have installed/configured (including PPAs)