Skip to main content
Topic: How to setup auto updates (Read 632 times) previous topic - next topic
0 Members and 3 Guests are viewing this topic.

How to setup auto updates

Hi how would I setup auto updates for artix runit, for security reasons I want to be on the latest versions of everything.

Re: How to setup auto updates

Reply #1
I give you my little personal cooking recipe.

On Artix OpenRC XFCE, I installed pamac-gtk after enabling the universe repository :
https://wiki.artixlinux.org/Main/Repositories#Universe

Code: [Select]
sudo pacman -Sy pamac-gtk

I therefore automatically receive an alert as soon as an update is available.

As a precautionary principle, I use pacman to proceed with the updates.

Thanks to the help received on this forum, I created a launcher that points to a small bash script :
Code: [Select]
#!/bin/sh
exec xfce4-terminal --maximize -H -x sh -c 'sudo pacman -Syu; sudo paccache -vrk2; exec bash'

You can easily adapt everything for another environment (plasma, cinnamon etc.).


Re: How to setup auto updates

Reply #2
I would not recommend running an update automatically on any rolling distro. Updates sometimes need manually intervention to complete successfully. One could be surprised when problems occur seemingly without a clue what went wrong. Running the updates manually allows one to view the process and observe the information as the update occurs. This provides one with an idea that you know that application ran before the update and now it does not type of situation.
Distros with a fixed release schedule are pretty static in the library major version updates thus automatic updates are quite pain free but then one has to reinstall the whole distro when the libraries do get a major version update.

How to automatically run a periodic task on a schedule without systemd timers:
To run a task on a schedule look at a cron application.
The basic steps are to create a script file with the commands you wish to run, make it executable then schedule the time to run the script with the cron's setting application (varies with the one you select to use).
If the system is not running all the time like most user's systems then a cron that can run tasks in a delayed fashion due the system being off when it was suppose to run is a good idea. This may led to slight slow downs on boot up process if the delayed tasks start immediately on boot up but it is a small price to pay.

For example: Configuring a cron task is a great way to automate the updating of the clam's anti-virus definitions or the spamassassin's database and IMHO a best practice.

Re: How to setup auto updates

Reply #3
Running the updates manually allows one to view the process and observe the information as the update occurs. This provides one with an idea that you know that application ran before the update and now it does not type of situation.
Exactly, with enough experience one can "sense" if an update will be incomplete and postpone it until the other needed packages are ready. This is what I do.

Re: How to setup auto updates

Reply #4
Updates are best done before shutting down, otherwise occasionally you get apps or services that are already running crash. Manually running the update in a terminal when you shut down is a good way to keep completely up to date I think. If you did it automatically you would want to be well prepared to fix it if it breaks, and perhaps also have some automated backup. Reading /var/log/pacman.log would tell you something of what you had missed. It's probably not advisable to automate updates unless you are quite competent, although I imagine there are scenarios such as a machine that is difficult to access or located remotely or one set up for another user that you manage but do not use yourself where it might be worthwhile trying, but then updating every month or two could be OK for those situations too. But if you don't update for a very long time like months or years it can cause big problems, and be very difficult to resolve the issues. A stable release model like a Debian based system would be more suitable there, but of course you are free to try what you wish, and you could probably manage OK if you don't mind doing the occasional manual emergency fix when it goes wrong.

Re: How to setup auto updates

Reply #5
 
 I would go with the crontab command to solve this and add a weekly cronjob. I think an update once/week or once/2 weeks should be just fine but of course you can use whatever time frame you'd like. Check this crontab short how to here  or search for crontab.

But if you set a cronjob with the help of crontab you better make sure to restart your system cos when you upgrade your kernel you might get nasty surprises. But I for one I'm restarting my system no matter what upgrades I made, except firefox and other couple more obviously not that sensitive packages, but even those it's better to restart them so upgrades start producing their effects the sooner the better.