I use Fedora (GNOME Workstation, n-1 version) and it’s just perfect for my professional and personal computers . I’ve also installed it on my wife’s computer, and also friends and even relatives. They are not tech and Linux enthusiasts (as I am) but for our basic use (mainly web, mail, photo, videos), Fedora does the job nicely.
There is one problem I can’t solve : automatic offline updates.
I have two conditions :
updates must be transparent to the user (no dnf command, no CLI, no root or sudo use)
root/user password must not be asked to the user.
I can achieve this goal with Gnome-Software which is not bad (offline updates, notifications, one-clic install without root password and reboot) because it doesn’t require a complex interaction with the user (clck to install) but it’s half broken after sleep/wake up (no updates notification, no offline update when poweroff, and update page is spinning endlessly…).
Once, I realized that my wife’s laptop has tons of waiting updates but she doesn’t know about it because of the missing notification. I had to end/kill the “Gnome-software” process and restart the application to get it on track again… I have to do it again every time the laptop goes in sleep mode. It’s it’s not as user friendly as promised).
I’ve tried different workaround :
DNF automatic : it’s transparent for the user with a systemd service/timer but there is no offline update mode and I experienced random instabilities and crash when an updated software is running (e.g. Firefox). Moreover, the user is not warned at the end of the update process, nor invited to reboot. And, of course, I can’t force a reboot at the end of the process…
PackageKit : it’s nearly perfect as it searches for updates, prepares for offline update and shows a notification. I use this command :
But I can’t execute this command in a systemd service. With Flatpak, for example, I have system-wide systemd service and timer to get automatic updates once a week and it’s working nicely. But I can not reproduce the same thing with these PackageKit commands…
How can I execute this command line in the background and make it run once a week ?
Maybe is there an alternative solution to acheive my goal ?
It would be helpful to have a bug report here for the problem with GNOME Software breaking after you suspend and resume your computer. That’s not normal and is not a complaint I’ve heard before.
Thanks for your answer.
I’ve just created an account on Gnome Gitlab, and I’ll write a bug report as soon as I got logs and screenshots to document it.
By the way, any idéa on how to do these updates with PackageKit through a script or a systemd service and without Gnome Software (so it could be useful too for KDE, Xfce and other DE) ?
Yes, I’ve tried cron job but it’s not working (just like systemd timers) and I don’t understand why!
Just for information, the upper update command does not require to be run as root, a simple user can run it from terminal and it works.
Test 1: crontab as root : # crontab -e
Then, I add the command to be executed every 5 minutes (for testing purpose) : */5 * * * * pkcon refresh force && pkcon update --only-download -y && pkcon offline-get-prepared && pkcon offline-trigger
Save and quit, but nothing happens
The log file is not very informative : # journalctl | grep cron
I have the script in a bin directory in my home directory … (/home/grumpey/bin)
The service and timer for a user service go under ~/.config/systemd/user/
To enable the timer. systemctl --user enable --now doupdates.timer
Is better to create a user service or a system service for this kind of job ?
On my computer there are 3 users, most of the time there is only one session opened, but at some moment of the day, 2 users can be connected. I assume a system service is more convinient in that case, isn’t it ? Or is it better to configure 3 scripts in each user session ?
About the location of the different files:
For a user script, I should store:
the script location in /home/user/bin
the systemd service and timer in /home/.config/systemd/user/
For a system-wide script, I should store:
the script location in /usr/local/bin/
the systemd service and timer in /etc/systemd/system/
I’m using a user service because I’m in the wheel group and I’m the only user of the computer. I’ve also enabled linger for that user.
It is probably more straight forward to use a system service in this case or just execute the script with a cron job.
If you did it as a user service you would just need one user setup who is in the wheel group and linger enabled for that user.
For the system scripts. /usr/local/bin/ is appropriate.
systemd system services can be in /etc/systemd/system/
The full list of paths is for system and user is here
For user scripts either
~/.local/bin or ~/bin
I use ~/bin
Remember you need to use the full path for the service or for a cron job.
Since I set my updates to be early in the morning I’m not sure how much of a notification users get.
One of my favorite things about Linux is the number of different ways a problem can be solved.