In the configs I see option

  • To set up the informative mail about this (Unattended-Upgrade::Mail in /etc/apt/apt.conf.d/50-unattended-upgrades)
  • I can also turn the automatic package update on or off, in /etc/apt/apt.conf.d/20auto-upgrade.

However, what I want:

  1. If there is something to upgrade, I want to get the warning mails for that.
  2. However, I don't want the software to upgrade anything. Only I want to upgrade anything, with my own hands.

Could this somehow be set up?

  • Have you tried PT::Periodic::Unattended-Upgrade "0"; together with APT::Periodic::Update-Package-Lists "1";? – Rui F Ribeiro Sep 12 '18 at 11:19
  • @RuiFRibeiro My impression is that it would turn the whole mechanism off, and not only the actual package updates, but the docs aren't very clear, more exactly here the results are essentially nothing. – peterh Sep 12 '18 at 11:22
  • You can always mail yourself the result of apt-get update ; apt-get -s -o Debug::NoLocking=true upgrade | grep ^Inst and not install an extra package. – Rui F Ribeiro Sep 12 '18 at 11:26

You don’t need unattended-upgrades for this, apt can take care of updates and downloads by itself. See /usr/lib/apt/apt.systemd.daily for details (this is called either by a cron job, or by a systemd timer); you can configure the following, in a file in /etc/apt/apt.conf.d/, e.g. /etc/apt/apt.conf.d/10periodic:

  • APT::Periodic::Enable "1"; to enable the script;
  • APT::Periodic::Update-Package-Lists "1"; to run apt-get update every day (0 disables, n > 1 runs it every n days);
  • APT::Periodic::Download-Upgradeable-Packages "1"; to run apt-get upgrade --download-only every day (as above);
  • APT::Periodic::Verbose "1"; sends a progress report to root.

cron-apt is another tool which can do this, along with emails with command outputs; however for basic scenarios such as the above it doesn’t add anything to the features now available in apt.

Both of these send emails with any output, not just when there are packages to upgrade. To get that behaviour, you could disable those emails (except on error), and supplement them with a cron job running apt --list upgradable.

apticron is yet another tool which does this, but more closely fits your requirements: it sends email only when it determines that upgrades are available. It can also be configured to list only new upgrades (since the previous email), and it will use apt-listchanges to include the changelogs.

  • 1
    Finally apticron won. Tyvm! – peterh Sep 12 '18 at 14:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.