2

Using Xubuntu 16.04, I set the automatic updates silently for all packages. But, the unattended-upgrades don't start and /etc/cron.daily/apt is missing. How to fix this issue ?

Here the following procedure I used to enable the automatic updates silently :

My settings for updates: tous les jours = every day télécharger et installer automatiquement = download and install automatically

enter image description here

Then, with terminal :

sudo apt-get install unattended-upgrades
sudo dpkg-reconfigure unattended-upgrades #Yes for questions

#edit /etc/apt/apt.conf.d/50unattended-upgrades :
Unattended-Upgrade::Allowed-Origins {
        "${distro_id} ${distro_codename}-security";
        "${distro_id} ${distro_codename}-updates";
//      "${distro_id} ${distro_codename}-proposed";
//      "${distro_id} ${distro_codename}-backports";
"LP-PPA-webupd8team-sublime-text-3:xenial";
};

#edit /etc/apt/apt.conf.d/10periodic :
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Download-Upgradeable-Packages "1";
APT::Periodic::AutocleanInterval "7";
APT::Periodic::Unattended-Upgrade "1";

# edit /etc/apt/apt.conf.d/20auto-upgrades :
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";

#restart cron and anacron :
sudo service anacron stop
sudo service cron stop
sudo rm -rf /var/run/unattend* /var/run/cron* /var/run/anacron*
sudo rm -rf /var/lib/apt/periodic/*
sudo service cron start
sudo anacron -fn

I get the information that packages can be upgrade :

$ sudo apt update
[...]
Lecture des informations d'état... Fait
41 packages can be upgraded. Run 'apt list --upgradable' to see them.

I used sudo unattended-upgrades --dry-run –debug to simulate a silent update and the return is fine, everything was updated « not really ». The real issue is that the automatic updates silently didn't start. I check the log every day since one month and still no update in /var/log/unattended-upgrades/unattended-upgrades.log

After investigated, I think that the root cause is /etc/cron.daily/apt is missing.

$ dpkg --search /etc/cron.daily/apt
dpkg-query: no path matches /etc/cron.daily/apt
$ ls /etc/cron.daily
0anacron    bsdmainutils  logrotate  passwd                  upstart
apport      dpkg          man-db     popularity-contest
apt-compat  fstrim        mlocate    update-notifier-common

How to fix this issue to begin the start of unattended-upgrades silently ?

Linked:

https://help.ubuntu.com/community/AutomaticSecurityUpdates#Using_the_.22unattended-upgrades.22_package

https://help.ubuntu.com/lts/serverguide/automatic-updates.html

How do I enable automatic updates?

How to enable silent automatic updates for any repository?

NicolasSmith
  • 1,031
  • 1
    I don't have a /etc/cron.daily/apt on my system either: AFAIK in 16.04, periodic updates are run from /etc/cron.daily/apt-compat via a script /usr/lib/apt/apt.systemd.daily – steeldriver May 13 '17 at 12:58
  • The file /etc/cron.daily/apt-compat is provided by the apt package, not unattended-upgrades. Reinstall the apt package. – user535733 May 13 '17 at 14:04

0 Answers0