New issue
Advanced search Search tips

Issue 660145 link

Starred by 2 users

Issue metadata

Status: Duplicate
Merged: issue 663069
Owner: ----
Closed: Nov 2016
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

handle_distro_upgrade cronjob is broken on Ubuntu 16.10 and Debian Testing, preventing updates for the google-chrome package after a distro upgrade

Reported by oconnor...@gmail.com, Oct 27 2016

Issue description

Chrome Version : 54.0.2840.71

What steps will reproduce the problem?
(1) Install google-chrome.deb on Ubuntu 16.04.
(2) Upgrade in place to Ubuntu 16.10 (for example with `do-release-upgrade`, after enabling non-LTS versions in the updater settings)

What is the expected result?
The repo line in /etc/apt/sources.list.d/google-chrome.list gets commented out by the distro upgrade, preventing further google-chrome updates. A cronjob at /etc/cron.daily/google-chrome should uncomment it to reenable updates.

What happens instead?
The cronjob is a no-op. The list file remains commented, and `apt-get update` does not fetch updates for google-chrome.

Please provide any additional information below. Attach a screenshot if
possible.
At Keybase we've adapted the cronjob from google-chrome to solve the same issue for our own package (https://github.com/keybase/client/blob/master/packaging/linux/deb/cron.template), so we're also affected by this issue.

The cause is that in prior versions of Ubuntu/Debian the Dir::Etc apt-config variable contained a trailing slash by default. That cronjob was concatenating that variable into a path, assuming the trailing slash. But in Ubuntu 16.10, the trailing slash is gone. That breaks the path to the list file, and the cronjob fails to fix it.

The fix for chrome could be identical to our proposed fix here: https://github.com/keybase/client/pull/4733/files It looks like it needs to happen in the file `chrome/installer/linux/common/apt.include`.

Note that apt-config supports a "shell" command which can output complete directories when variable names are suffixed with "/d". That seems to be the intended way to obtain these paths according to https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=836427. However it requires evaluating (or otherwise parsing) shell code output from the command, which feels kind of dirty, and anyway it would be a bigger change than inserting these slashes.
 
A quick way to see the way Ubuntu has changed is to run a docker command in several different images. Something like this:

for i in 12.04 14.04 16.04 16.10; do
  echo -n "Ubuntu $i: "
  docker run -ti ubuntu:$i apt-config dump Dir::Etc | grep "Dir::Etc "
done

gives (ignoring the image download progress bar and stuff):

Ubuntu 12.04: Dir::Etc "etc/apt/";
Ubuntu 14.04: Dir::Etc "etc/apt/";
Ubuntu 16.04: Dir::Etc "etc/apt/";
Ubuntu 16.10: Dir::Etc "etc/apt";
The GitHub PR above isn't showing a diff anymore, not sure why, but here's the fix we landed in the Keybase project: https://github.com/keybase/client/commit/7894c1f57f3ca5ecb3b5fc87e4496769103b7fd4
Labels: TE-NeedsTriageHelp
Mergedinto: 663069
Status: Duplicate (was: Unconfirmed)
thanks oconnor for the explanation and link to the patch!

Sign in to add a comment