0

I am installing a bunch of applications via apt-get by just copying and pasting commands, but I want to understand how do people come up with the list of which packages to install? Say for example, I'm installing "java8". The command would be:

sudo apt-get install oracle-java8-installer

Where can I get a list of all the available "java" versions that i can choose from? And how about other applications? How do I list out what can be installed in a particular apt-repository?

  • 1
    Too many questions. Also, that list is potentially infinite for the different packages that can be installed - a full packages list is HUGE (the compressed Packages list in gzip form seems to be almost 2MB - that could easily expand to be huge). Typically, we use synaptic or the web page at packages.ubuntu.com for specific searches and such. – Thomas Ward Jan 27 '15 at 22:32
  • try apt-cache <word> to see a list of packages mentioning <word>. – roadmr Jan 27 '15 at 22:33
1

First you need to update the local repository cache by the following command:

sudo apt-get update

Now lets say you want to search for all java related packages. The command for that is:

apt-cache search "java"

Consider that you want to install the vim editor and by doing apt-cache search vim you have found the package you are looking for and the package is vim-common, now you can simply install the latest version of the package along with the dependencies by:

sudo apt-get install vim-common

That's it. Now if you want to check for other versions available of vim-common as you are willing to go for an older version, then you need to do:

apt-cache showpkg vim-common

this will show the available versions along with the dependencies. here is a sample output:

$apt-cache showpkg vim-common

Package: vim-common
Versions: 
2:7.3.429-2ubuntu2.1 (/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise-updates_main_binary-amd64_Packages) (/var/lib/dpkg/status)
 Description Language: 
                 File: /var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise_main_binary-amd64_Packages
                  MD5: dc8579ec9ee0dc36b43d271645170c36
 Description Language: en
                 File: /var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise_main_i18n_Translation-en
                  MD5: dc8579ec9ee0dc36b43d271645170c36

2:7.3.429-2ubuntu2 (/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise_main_binary-amd64_Packages)
 Description Language: 
                 File: /var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise_main_binary-amd64_Packages
                  MD5: dc8579ec9ee0dc36b43d271645170c36
 Description Language: en
                 File: /var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise_main_i18n_Translation-en
                  MD5: dc8579ec9ee0dc36b43d271645170c36


Reverse Depends: 
  vim-common:i386,vim-common
  vim-nox,vim-common 2:7.3.429-2ubuntu2.1
  vim-gtk,vim-common 2:7.3.429-2ubuntu2.1
  vim-athena,vim-common 2:7.3.429-2ubuntu2.1
  vim-tiny,vim-common 2:7.3.429-2ubuntu2.1
  vim-gnome,vim-common 2:7.3.429-2ubuntu2.1
  vim-dbg,vim-common 2:7.3.429-2ubuntu2.1
  vim,vim-common 2:7.3.429-2ubuntu2.1
  vim-common:i386,vim-common
  vim-nox,vim-common 2:7.3.429-2ubuntu2
  vim-latexsuite,vim-common 1:7.1.314
  vim-gtk,vim-common 2:7.3.429-2ubuntu2
  vim-athena,vim-common 2:7.3.429-2ubuntu2
  vim-addon-manager,vim-common
  vim-tiny,vim-common 2:7.3.429-2ubuntu2
  vim-gnome,vim-common 2:7.3.429-2ubuntu2
  vim-dbg,vim-common 2:7.3.429-2ubuntu2
  vim,vim-common 2:7.3.429-2ubuntu2
Dependencies: 
2:7.3.429-2ubuntu2.1 - libc6 (2 2.3.4) vim (16 (null)) vim-gnome (16 (null)) vim-gtk (16 (null)) vim-athena (16 (null)) vim-nox (16 (null)) vim-tiny (0 (null)) vim-common:i386 (0 (null)) 
2:7.3.429-2ubuntu2 - libc6 (2 2.3.4) vim (16 (null)) vim-gnome (16 (null)) vim-gtk (16 (null)) vim-athena (16 (null)) vim-nox (16 (null)) vim-tiny (0 (null)) vim-common:i386 (0 (null)) 
Provides: 
2:7.3.429-2ubuntu2.1 - 
2:7.3.429-2ubuntu2 - 
Reverse Provides: 

As you can see there are two versions available, one is 2:7.3.429-2ubuntu2.1 (latest) and the other is 2:7.3.429-2ubuntu2 (old). Now to install the older version you need to issue the following command:

sudo apt-get install vim-common=2:7.3.429-2ubuntu2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.