Ubuntu – find where will a package be installed from

Ubuntu apt-cache policy can be used to find the sources of a package and their order. This can be helpful in case we are downloading/installing a package from a custom repository. Here are some examples on Ubuntu Linux.

To check where will docker-engine be installed from:

$ apt-cache policy docker-engine
docker-engine:
  Installed: 1.9.1-0~trusty
  Candidate: 1.10.0-0~trusty
  Version table:
     1.10.0-0~trusty 0
        500 https://apt.dockerproject.org/repo/ ubuntu-trusty/main amd64 Packages
 *** 1.9.1-0~trusty 0
        500 https://apt.dockerproject.org/repo/ ubuntu-trusty/main amd64 Packages
        100 /var/lib/dpkg/status
     1.9.0-0~trusty 0
        500 https://apt.dockerproject.org/repo/ ubuntu-trusty/main amd64 Packages
...
...


To check where will nodejs be installed from:

$ apt-cache policy nodejs
nodejs:
  Installed: 5.3.0-1nodesource1~trusty1
  Candidate: 5.5.0-1nodesource1~trusty1
  Version table:
     5.5.0-1nodesource1~trusty1 0
        500 https://deb.nodesource.com/node_5.x/ trusty/main amd64 Packages
 *** 5.3.0-1nodesource1~trusty1 0
        100 /var/lib/dpkg/status
     0.10.25~dfsg2-2ubuntu1 0
        500 http://us-west-1.ec2.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages

Note that here nodejs is getting installed from https://deb.nodesource.com/node_5.x/ instead of ubuntu default location.

Share this article: share on Google+ share on facebook share on linkedin tweet this submit to reddit

Comments

Click here to write/view comments