Page 1 of 1

Updating Palemoon using unattended-upgrades - how-to

Posted: 2018-08-04, 05:37
by robinc
Hello
I've always been a fan of unattended upgrades, but have had some fun and games getting Palemoon to update through that process.
So, I thought I would document it here in case anyone else is having the same problems with either Debian or Ubuntu and distros based on them.

With Debian the line needed in 50unattended-upgrades is

Code: Select all

"o=obs://build.opensuse.org/home:stevenpusser/Debian_8.0,n=Debian_8.0,l=home:stevenpusser";
that's all, obviously changing for Debian version.

With Ubuntu it gets a little more interesting due to the default Origin::Archive syntax.
Running

Code: Select all

egrep '^(Origin|Label|Suite|Codename)' /var/lib/apt/lists/*Release > repos.txt
we get:-
download.opensuse.org_repositories_home:_stevenpusser_xUbuntu%5f16.04_Release:Codename: xUbuntu_16.04
download.opensuse.org_repositories_home:_stevenpusser_xUbuntu%5f16.04_Release:Origin: obs://build.opensuse.org/home:stevenpusser/xUbuntu_16.04
download.opensuse.org_repositories_home:_stevenpusser_xUbuntu%5f16.04_Release:Label: home:stevenpusser

The resulting line for 50-unattended upgrades is therefore:-

Code: Select all

"build.opensuse.org/home:stevenpusser/xUbuntu_16.04";
In theory you should add home:stevenpusser for the Label, but that cannot work due to the double : split, so the shorter line with just the Origin is all you can use.

This does not retrieve updates from the repo. Having gone round the houses for a few days and running with debug I realised that it was never going to work.

The solution is to add the following to the start of 50-unattended-upgrades - marked as code. This broadens the scope of what u-a will accept by just using the Origin. You could go even further by using Site instead of Origin

// Automatically upgrade packages from these (origin:archive) pairs

Code: Select all

Unattended-Upgrade::Origins-Pattern {
        "origin=*";
};
Unattended-Upgrade::Allowed-Origins {
"${distro_id}:${distro_codename}";
"${distro_id}:${distro_codename}-security";
// Extended Security Maintenance; doesn't necessarily exist for
// every release and this system may not have it installed, but if
// available, the policy for updates is such that unattended-upgrades
// should also install from here by default.
"${distro_id}ESM:${distro_codename}";
"${distro_id}:${distro_codename}-updates";
"${distro_id}:${distro_codename}-proposed";
"${distro_id}:${distro_codename}-backports";
"build.opensuse.org/home:stevenpusser/xUbuntu_16.04";
};

Actually getting unattended upgrades to work in what I call a predictable fashion on a single user laptop with Ubuntu 16.04 was a bit of a pain too.
The short answer which does work is to modify the content of /lib/systemd/system/apt-daily.timer as follows

Code: Select all

[Unit]
Description=Daily apt download activities
DefaultDependencies=yes

[Timer]
#OnCalendar=*-*-* 6,18:00
#RandomizedDelaySec=12h
#Persistent=true
OnBootSec=5min
OnUnitActiveSec=1d

[Install]
WantedBy=timers.target
and /lib/systemd/system/apt-daily-upgrade.timer

Code: Select all

[Unit]
Description=Daily apt upgrade and clean activities
After=apt-daily.timer

[Timer]
#OnCalendar=*-*-* 6:00
#RandomizedDelaySec=10m
OnBootSec=15min
Persistent=true

[Install]
WantedBy=timers.target
It may not be pretty, but it works.

Hope this is of some help to someone.

Re: Updating Palemoon using unattended-upgrades - how-to

Posted: 2018-08-04, 17:09
by stevepusser
OK, but users need to take note that your examples are for Debian 8 instead of the current Debian 9, and also that the Ubuntu example is for 16.04. I'm pretty sure that those builds will work on a newer distro release, but it's always better practice to try and use the native build repository.

Re: Updating Palemoon using unattended-upgrades - how-to

Posted: 2018-08-05, 05:48
by robinc
In fairness (and I have no desire to sound pedantic) - I did say:-
"obviously changing for Debian version"
underneath the Debian info.

I sort of assumed that anyone who is happy to tackle writing their own 50unattended file will have enough nous to change the version, but will amend the Ubuntu info as well for completeness - thank you.

UPDATE:-(Nope - cannot edit original post)