[juju-2.0] trusty package doesn't install juju-2.0 commands via update-alternatives
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
juju-release-tools |
Fix Released
|
Critical
|
Nicholas Skaggs |
Bug Description
In some cases /usr/bin/juju is juju 2.0 when upgrading a trusty environment that has ppa:juju/stable PPA enabled.
[Impact]
Users may end up inadvertently using the juju command from 2.0 and without the option to manage their juju-1.x deployed environments.
[Test]
lxc launch ubuntu:14.04 juju
lxc exec juju /bin/bash
$ sudo apt-get update
$ sudo apt-get install -y juju
$ juju --version
1.25.6-trusty-amd64
$ sudo add-apt-repository -y ppa:juju/stable
$ sudo apt-get update
$ sudo apt-get upgrade
Expected result:
/usr/bin/juju points to juju 1.25
Actual result:
In some cases /usr/bin/juju may be actually juju-2.0, because the juju-2.0 package doesn't use update-alternatives
$ dpkg -L juju-2.0
/.
...
/usr/bin/juju
/usr/bin/
/usr/bin/jujud
/usr/bin/
...
Related branches
tags: | added: sts |
Changed in juju-release-tools: | |
status: | New → Triaged |
importance: | Undecided → High |
Changed in juju-release-tools: | |
assignee: | nobody → Nicholas Skaggs (nskaggs) |
importance: | High → Critical |
I can confirm this.
I installed trusty, added juju stable ppa, and installed latest 1.25 from the ppa. This is the situation most of the long-time juju users will be at.
After doing dist-upgrade /usr/bin/juju points to juju2, rendering existing juju1 deployment inaccessible.
To remedy this one needs to run 'dpkg-reconfigure juju-core'.
Here is the shortlog:
ubuntu@jujutest:~$ apt-cache policy juju 0ubuntu1~ 14.04.1~ juju1 0ubuntu1~ 14.04.2~ juju1 2.0.0-0ubuntu1~ 14.04.2~ juju1 0 ppa.launchpad. net/juju/ stable/ ubuntu/ trusty/main amd64 Packages 25.6-0ubuntu1. 14.04.1 0 archive. ubuntu. com/ubuntu/ trusty- updates/ universe amd64 Packages 0ubuntu1~ 14.04.1~ juju1 0 ppa.launchpad. net/juju/ stable/ ubuntu/ trusty/main amd64 Packages dpkg/status 18.1-0ubuntu1 0 archive. ubuntu. com/ubuntu/ trusty/universe amd64 Packages es/juju
juju:
Installed: 1.25.6-
Candidate: 1:2.0.0-
Version table:
1:
500 http://
1.
500 http://
*** 1.25.6-
500 http://
100 /var/lib/
1.
500 http://
ubuntu@jujutest:~$ which juju
/usr/bin/juju
ubuntu@jujutest:~$ ls -al /usr/bin/juju
lrwxrwxrwx 1 root root 22 Oct 14 20:35 /usr/bin/juju -> /etc/alternativ
After the 'apt-get dist-upgrade':
ubuntu@jujutest:~$ apt-cache policy juju 0ubuntu1~ 14.04.2~ juju1 0ubuntu1~ 14.04.2~ juju1 0ubuntu1~ 14.04.2~ juju1 0 ppa.launchpad. net/juju/ stable/ ubuntu/ trusty/main amd64 Packages dpkg/status 25.6-0ubuntu1. 14.04.1 0 archive. ubuntu. com/ubuntu/ trusty- updates/ universe amd64 Packages 25.6-0ubuntu1~ 14.04.1~ juju1 0 ppa.launchpad. net/juju/ stable/ ubuntu/ trusty/main amd64 Packages 18.1-0ubuntu1 0 archive. ubuntu. com/ubuntu/ trusty/universe amd64 Packages juju-2. 0/bin/juju
juju:
Installed: 1:2.0.0-
Candidate: 1:2.0.0-
Version table:
*** 1:2.0.0-
500 http://
100 /var/lib/
1.
500 http://
1.
500 http://
1.
500 http://
ubuntu@jujutest:~$ ls -al /usr/bin/juju
lrwxrwxrwx 1 root root 24 Oct 13 23:59 /usr/bin/juju -> ../lib/
Then the fix:
ubuntu@jujutest:~$ sudo dpkg-reconfigure juju-core alternatives: using /usr/lib/ juju-1. 25.6/bin/ juju to provide /usr/bin/juju (juju) in auto mode es/juju
update-
ubuntu@jujutest:~$ ls -al /usr/bin/juju
lrwxrwxrwx 1 root root 22 Oct 14 20:42 /usr/bin/juju -> /etc/alternativ
ubuntu@jujutest:~$ juju --version
1.25.6-trusty-amd64
ubuntu@jujutest:~$