Thursday, April 28, 2016

ubuntu: Install a package from a different repository

In this case network-manager-openconnect came bad in the 16.04 first release, see bug https://bugs.launchpad.net/ubuntu/+source/network-manager-openconnect/+bug/1571300 for details.

16.04 is xenial and the fixed version was released in the yakkety repository, so had to do this:
sudo vi /etc/apt/sources.list
and add
deb http://mx.archive.ubuntu.com/ubuntu/ yakkety universe
right below the xenial universe line, then
sudo apt-get update
and now you should be able to see the available versions like this:
$ apt-cache policy network-manager-openconnect
network-manager-openconnect:
  Installed: (none)
  Candidate: 1.2.0-1build1
  Version table:
     1.2.0-1build1 500
        500 http://mx.archive.ubuntu.com/ubuntu yakkety/universe amd64 Packages
     1.0.2-1build1 500
        500 http://mx.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages
Cool, 1.2.0-1 is the one containing the fix from the bug report, how do I specify I want that version and not the xenial one? well, candidate points to the version which gets installed by default, but if for some reason we'd like to install the other version we could do it with
sudo apt-get install network-manager-openconnect=1.0.2-1build1
for this case the candidate points to the fixed version, so a simple
sudo apt-get install network-manager-openconnect
will do.

Running apt-cache policy again will show the installed package marked with the ***:
$ apt-cache policy network-manager-openconnect
network-manager-openconnect:
  Installed: 1.2.0-1build1
  Candidate: 1.2.0-1build1
  Version table:
 *** 1.2.0-1build1 500
        500 http://mx.archive.ubuntu.com/ubuntu yakkety/universe amd64 Packages
        100 /var/lib/dpkg/status
     1.0.2-1build1 500
        500 http://mx.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages

No comments:

Post a Comment