[SOLVED]"Automatic Updates" in Update Manager, haven't been automatic..

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Post Reply
TriggerDingus
Level 1
Level 1
Posts: 30
Joined: Wed Feb 28, 2024 12:33 am

[SOLVED]"Automatic Updates" in Update Manager, haven't been automatic..

Post by TriggerDingus »

According to what I've read, I have auto-updates turned on but I'm still having to do them manually.

Some may chime in and say "it isn't good practice to let your machine be updated automatically." To those, I would respectfully say "you do you and I'll do me."

I'm a recent convert to LMDE and I would really like this to work so I don't have to waste time in Update Manager every day. Any advice?

Screenshot from 2024-03-23 20-31-44.png
Last edited by TriggerDingus on Sun Mar 24, 2024 11:00 am, edited 1 time in total.
bin
Level 4
Level 4
Posts: 249
Joined: Wed Nov 22, 2006 12:12 pm
Location: Wiltshire UK

Re: "Automatic Updates" in Update Manager, haven't been automatic..

Post by bin »

In the standard format the automated update is subject to a random delay which can make it look like it isn't going to happen.
There is also the added bonus that mintupdate cannot update itself.

The solution which I have working happily on LMDE (and is a variation of what I have been using for about 15 years) is as follows

Terminal -

Code: Select all

sudo crontab -e
Go to the empty bottom row of the screen and put in

Code: Select all

@reboot sleep 40 && sudo apt update && sudo apt install mintupdate mint-upgrade-info
and save it. If it has opened in nano that would be Ctrl+O then Ctrl+X
What this does is to wait 40 seconds after booting and then goes off and tries to update mintupdate.

Terminal -

Code: Select all

sudo systemctl edit --full mintupdate-automation-upgrade.timer
Make it look like this -

Code: Select all

[Unit]
Description=Update Manager automatic upgrades

[Timer]
##OnCalendar=daily
OnBootSec=4m
##RandomizedDelaySec=60m
Persistent=true

[Install]
WantedBy=timers.target
Save it via Ctrl+O Ctrl+X

This creates an override file in /etc/systemd/system/ which will not be altered even if the original in /lib/... is updated.

What this does is to wait 4 minutes after boot and then runs mintupdate

Finally I set my Options screen in the update settings as this
options.png
So the whole sequence becomes:-
Boot + 40 seconds - apply any update to mintupdate
Boot + 2 minutes mintupdate looks for any updates
Boot + 4 minutes minyupdate runs and applies any updates

Mintupdate then goes away until it finds any new updates every 4 hours or until next reboot if sooner.

Mintupdate logs in /var/log/mintupdate.log

Do be aware that if you are using a disk with legacy MSDOS structure as opposed to GPT then Grub updates will not complete. I used to exclude updates to grub-pc and check manually once in a while. Got fed up with that and swapped to GPT and that made life a lot easier.
TriggerDingus
Level 1
Level 1
Posts: 30
Joined: Wed Feb 28, 2024 12:33 am

Re: "Automatic Updates" in Update Manager, haven't been automatic..

Post by TriggerDingus »

Thank You!
TriggerDingus
Level 1
Level 1
Posts: 30
Joined: Wed Feb 28, 2024 12:33 am

Re: "Automatic Updates" in Update Manager, haven't been automatic..

Post by TriggerDingus »

bin wrote: Sun Mar 24, 2024 3:18 am In the standard format the automated update is subject to a random delay which can make it look like it isn't going to happen.
There is also the added bonus that mintupdate cannot update itself.

The solution which I have working happily on LMDE (and is a variation of what I have been using for about 15 years) is as follows

Terminal -

Code: Select all

sudo crontab -e
Go to the empty bottom row of the screen and put in

Code: Select all

@reboot sleep 40 && sudo apt update && sudo apt install mintupdate mint-upgrade-info
and save it. If it has opened in nano that would be Ctrl+O then Ctrl+X
What this does is to wait 40 seconds after booting and then goes off and tries to update mintupdate.

Terminal -

Code: Select all

sudo systemctl edit --full mintupdate-automation-upgrade.timer
Make it look like this -

Code: Select all

[Unit]
Description=Update Manager automatic upgrades

[Timer]
##OnCalendar=daily
OnBootSec=4m
##RandomizedDelaySec=60m
Persistent=true

[Install]
WantedBy=timers.target
Save it via Ctrl+O Ctrl+X

This creates an override file in /etc/systemd/system/ which will not be altered even if the original in /lib/... is updated.

What this does is to wait 4 minutes after boot and then runs mintupdate

Finally I set my Options screen in the update settings as this options.png

So the whole sequence becomes:-
Boot + 40 seconds - apply any update to mintupdate
Boot + 2 minutes mintupdate looks for any updates
Boot + 4 minutes minyupdate runs and applies any updates

Mintupdate then goes away until it finds any new updates every 4 hours or until next reboot if sooner.

Mintupdate logs in /var/log/mintupdate.log

Do be aware that if you are using a disk with legacy MSDOS structure as opposed to GPT then Grub updates will not complete. I used to exclude updates to grub-pc and check manually once in a while. Got fed up with that and swapped to GPT and that made life a lot easier.

My updates haven't been working automatically. I've gone over all instructions above a few times and it appears I have everything done exactly as described, but still I'm nagged daily by mint updater. I'd post anything helpful here that might describe where I've failed, but there's no error messages or anything, so I don't even know where to begin troubleshooting. Any ideas?
bin
Level 4
Level 4
Posts: 249
Joined: Wed Nov 22, 2006 12:12 pm
Location: Wiltshire UK

Re: "Automatic Updates" in Update Manager, haven't been automatic..

Post by bin »

TriggerDingus wrote: Fri Apr 12, 2024 7:50 pm My updates haven't been working automatically. I've gone over all instructions above a few times and it appears I have everything done exactly as described, but still I'm nagged daily by mint updater. I'd post anything helpful here that might describe where I've failed, but there's no error messages or anything, so I don't even know where to begin troubleshooting. Any ideas?
Sorry to hear that.

First thing is go back and look for typo(s) in sudo systemctl edit --full mintupdate-automation-upgrade.timer

Next /var/log/mintupdate.log

For example this is the start of the log for this morning

Code: Select all

-- Automatic Upgrade starting Sat 13 Apr 2024 06:32:59 BST:
Reading package lists...
Building dependency tree...
Reading state information...
Recommended packages:
  xcvt
The following packages will be upgraded:
  xserver-common xserver-xephyr xserver-xorg-core xserver-xorg-legacy
4 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 11.8 MB of archives.
After this operation, 4,096 B of additional disk space will be used.
Get:1 http://security.debian.org bookworm-security/main amd64 xserver-common all 2:21.1.7-3+deb12u7 [2,383 kB]
Get:2 http://security.debian.org bookworm-security/main amd64 xserver-xephyr amd64 2:21.1.7-3+deb12u7 [3,293 kB]
Get:3 http://security.debian.org bookworm-security/main amd64 xserver-xorg-legacy amd64 2:21.1.7-3+deb12u7 [2,388 kB]
Get:4 http://security.debian.org bookworm-security/main amd64 xserver-xorg-core amd64 2:21.1.7-3+deb12u7 [3,720 kB]
Preconfiguring packages ...
You're looking for the Automatic Upgrade starting.... line.

The log may also show you if there is an issue with an update.

The update manager will show you which packages are due to update - are there lots or just one or two?

It occurs to me you might never or rarely actually reboot your machine - in which case you'd need to remove the ## in front of OnCalendar=daily in the timer edit.
TriggerDingus
Level 1
Level 1
Posts: 30
Joined: Wed Feb 28, 2024 12:33 am

Re: [SOLVED]"Automatic Updates" in Update Manager, haven't been automatic..

Post by TriggerDingus »

I checked the log you mentioned and there were no paragraphs describing Auto Upgrade, so the upgrade hasn't been running.

I suspect your last suggestion might fix the OS auto-updates, though. You are correct in guessing I might not reboot often: the machine runs several backup schedules and is also my Syncthing hub and so it gets rebooted quite sparingly.

-----Update:

I just rebooted to try and trigger the updates and to re-inspect the log file. There are some peculiar logs from the test run today (see April 13):

Code: Select all

-- Automatic Removal Mon Apr  1 12:21:34 AM EDT 2024:

Reading package lists...
Building dependency tree...
Reading state information...
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

-- Automatic Removal Mon Apr  8 12:01:35 AM EDT 2024:

Reading package lists...
Building dependency tree...
Reading state information...
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

-- Automatic Upgrade starting Sat 13 Apr 2024 11:43:35 EDT:
-- Power supply not connected, abort automatic update.

-- Automatic Upgrade starting Sat 13 Apr 2024 11:47:08 EDT:
-- Power supply not connected, abort automatic update. 
Strange thing is, the machine is never not connected to a power supply (E.G. A/C wall power).
bin
Level 4
Level 4
Posts: 249
Joined: Wed Nov 22, 2006 12:12 pm
Location: Wiltshire UK

Re: [SOLVED]"Automatic Updates" in Update Manager, haven't been automatic..

Post by bin »

Curious - without knowing more about the machine it's hard to comment. Not a laptop running without a battery is it??

On my desktop machine the log ends

Code: Select all

/sys/class/power_supply/AC/online not found. Ignore power supply check.-- Automatic Upgrade completed
Maybe that will help point you in the right direction?
TriggerDingus
Level 1
Level 1
Posts: 30
Joined: Wed Feb 28, 2024 12:33 am

Re: [SOLVED]"Automatic Updates" in Update Manager, haven't been automatic..

Post by TriggerDingus »

My machine is a laptop with an installed battery, however, it's a big beast of a thing and it's plugged into desktop speakers, monitor etc etc. It's essentially my desktop system.

It's interesting how your log ends, deciding to ignore the power supply check altogether. I'll have to try and figure out how I might be able to configure mine to do that.
bin
Level 4
Level 4
Posts: 249
Joined: Wed Nov 22, 2006 12:12 pm
Location: Wiltshire UK

Re: [SOLVED]"Automatic Updates" in Update Manager, haven't been automatic..

Post by bin »

Just checked on a Thinkpad that has Mint 21.3 clean install.

If the machine is connected to charger which is switched on, or the battery is removed and it is just running on mains, then it just ends

Code: Select all

-- Automatic Upgrade completed
Yesterday I forgot to switch on the charger and the log says

Code: Select all

-- Power supply not connected, abort automatic update.
So, I wonder if you might just want to pop the battery out and just run on mains - see what happens? Possible battery issue?
TriggerDingus
Level 1
Level 1
Posts: 30
Joined: Wed Feb 28, 2024 12:33 am

Re: [SOLVED]"Automatic Updates" in Update Manager, haven't been automatic..

Post by TriggerDingus »

Thanks so much for experimenting with that!
That sounds very promising! I'm removing the battery now - will report results soon!
TriggerDingus
Level 1
Level 1
Posts: 30
Joined: Wed Feb 28, 2024 12:33 am

Re: [SOLVED]"Automatic Updates" in Update Manager, haven't been automatic..

Post by TriggerDingus »

Well, this is confounding. I pulled the battery on the 18th and it's been sitting on my desk since then. I rebooted a few times but the mysterious power supply error messages continue. See log entries from 19th and 20th below.
I'm not expecting you would be able to explain or assist, but I wanted to provide the info for posterity!

Code: Select all

Reading package lists...
Building dependency tree...
Reading state information...
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

-- Automatic Upgrade starting Tue 16 Apr 2024 00:00:00 EDT:
-- Power supply not connected, abort automatic update.

-- Automatic Upgrade starting Wed 17 Apr 2024 00:00:21 EDT:
-- Power supply not connected, abort automatic update.

-- Automatic Upgrade starting Thu 18 Apr 2024 00:00:10 EDT:
-- Power supply not connected, abort automatic update.

-- Automatic Upgrade starting Fri 19 Apr 2024 00:00:00 EDT:
-- Power supply not connected, abort automatic update.

-- Automatic Upgrade starting Fri 19 Apr 2024 10:10:27 EDT:
-- Power supply not connected, abort automatic update.

-- Automatic Removal Fri Apr 19 01:25:17 PM EDT 2024:

Reading package lists...
Building dependency tree...
Reading state information...
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

-- Automatic Upgrade starting Sat 20 Apr 2024 00:00:09 EDT:
-- Power supply not connected, abort automatic update.
Skal_dB
Level 1
Level 1
Posts: 33
Joined: Fri Feb 23, 2024 6:33 am
Location: Bruxsel

Re: [SOLVED]"Automatic Updates" in Update Manager, haven't been automatic..

Post by Skal_dB »

I have the same issue but I don't read anything here that seems to work.

Did I miss something ?
Ubuntu 6.06 Dapper Drake ... Windows ... Linux Mint 21.3 Cinnamon
bin
Level 4
Level 4
Posts: 249
Joined: Wed Nov 22, 2006 12:12 pm
Location: Wiltshire UK

Re: [SOLVED]"Automatic Updates" in Update Manager, haven't been automatic..

Post by bin »

TriggerDingus wrote: Sat Apr 20, 2024 11:20 am Well, this is confounding. I pulled the battery on the 18th and it's been sitting on my desk since then. I rebooted a few times but the mysterious power supply error messages continue. See log entries from 19th and 20th below.
I'm not expecting you would be able to explain or assist, but I wanted to provide the info for posterity!
Last gasp..... did you try a different power supply?
TriggerDingus
Level 1
Level 1
Posts: 30
Joined: Wed Feb 28, 2024 12:33 am

Re: [SOLVED]"Automatic Updates" in Update Manager, haven't been automatic..

Post by TriggerDingus »

We may have made a step forward!

I'm not sure why (probably had given up) but I didn't think to try another power supply and so I just swapped another power supply at your suggestion and did a reboot and nothing changed (see log below at time stamp 00:00:13 EDT).

I did some research to see if there's something in the BIOS that is causing this and since I have Coreboot found I don't have all the potential proprietary settings I might otherwise have for power management. After finding that out, I then powered the machine back on and checked the log again, and as you see Automatic Upgrade eventually completed!

My incredible speculation of why it might be working now is maybe while I was fooling around with the BIOS, I had it powered off for an extended period and maybe that allowed a 'cold boot' of the BIOS. While removing the battery and switching power supplies all the previous times, perhaps it wasn't offline long enough for a complete power-down? It's the only explanation I can invent, anyway..

I'll monitor it over the next several days and see if it's solved for real! Thanks!

LATEST LOG:

-- Automatic Upgrade starting Sat 04 May 2024 00:00:13 EDT:
-- Power supply not connected, abort automatic update.

-- Automatic Upgrade starting Sat 04 May 2024 10:03:52 EDT:
Reading package lists...
Building dependency tree...
Reading state information...
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
-- Automatic Upgrade completed

-- Automatic Upgrade starting Sat 04 May 2024 10:25:31 EDT:
Error: mint-refresh-cache could not update the cache.
Failed to lock directory /var/lib/apt/lists/: E:Could not get lock /var/lib/apt/lists/lock. It is held by process 3745 (mint-refresh-ca)
Reading package lists...
Building dependency tree...
Reading state information...
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
-- Automatic Upgrade completed
bin
Level 4
Level 4
Posts: 249
Joined: Wed Nov 22, 2006 12:12 pm
Location: Wiltshire UK

Re: [SOLVED]"Automatic Updates" in Update Manager, haven't been automatic..

Post by bin »

TriggerDingus wrote: Sat May 04, 2024 10:42 am We may have made a step forward!
.......
I'll monitor it over the next several days and see if it's solved for real! Thanks!

LATEST LOG:

-- Automatic Upgrade starting Sat 04 May 2024 10:25:31 EDT:
Error: mint-refresh-cache could not update the cache.
Failed to lock directory /var/lib/apt/lists/: E:Could not get lock /var/lib/apt/lists/lock. It is held by process 3745 (mint-refresh-ca)
That's great news - bizarre!!!

The line in the log "Failed to lock directory..." indicates that the timings which I use and suggested may be a little short for your system for whatever reason.

It may be worth stretching the OnBootSec line in mintupdate-automation-upgrade.timer to 6 or 8 minutes as it looks like it is running before mintupdate has completed it's refresh.
TriggerDingus
Level 1
Level 1
Posts: 30
Joined: Wed Feb 28, 2024 12:33 am

Re: [SOLVED]"Automatic Updates" in Update Manager, haven't been automatic..

Post by TriggerDingus »

I adjusted the timing and have let it bake a few days - it seems to be working.
I appreciate your patience and attention to helping out with this. Kudos to you!
Post Reply

Return to “Software & Applications”