Sun Nov 20 20:15:08 2022 UTC

Update the distribution with upgrade-nutyx

Working

The update method used in this tutorial is transparent. This means that once the background task is set up and upgrade-nutyx is correctly configured, the user no longer needs to worry about updates. Although the update script is launched automatically by a background task, several criteria are necessary:
  • The download is done under the account of the user who installed the upgrade-nutyx package (jp) in this tutorial.
  • The download should complete successfully.
  • No package has been installed within the interval of 2 successive checks, in which case the update will not be done. The next update attempt is made at the next startup when the background task is triggered.
  • If all the previous conditions are fulfilled, the updates are carried out in the stop phase of the machine.
  • If one of the conditions is not met, a new cycle of searching, downloading updates starts again at the next start.

Install upgrade-nutyx

The package is named upgrade-nutyx.
sudo cards install upgrade-nutyx

Setting up the background task

To automatically launch the 'upgrade-nutyx' script, you must set up a background task that will automatically launch the script at a given time.

The fcron package is automatically installed as a dependency of the upgrade-nutyx package.

There are several methods to configure an automatic task.

Here the background task is configured to be launched at the 27th and 57th minute of every hour.

This tutorial offers 2 methods.

Method 1

Copy-Paste the lines below, taking care to replace the user's name (here jp) with yours:
echo "%hourly 27,57 DISPLAY=:0.0  /sbin/upgrade-nutyx" | sudo tee -a /var/spool/fcron/jp.orig"
[sudo] jp password :
sudo chown fcron:fcron /var/spool/fcron/jp.orig
sudo chmod 640 /var/spool/fcron/jp.orig
sudo fcrontab -z -u jp
2022-05-05 09:59:24  INFO reinstalling jp's fcrontab
2022-05-05 09:59:24  INFO installung file /tmp/fcr-Amshcy for user jp
fcron is not running :
  modifications will be taken into account at it's next execution.

Method 2

If you are familiar with the vi and fcrontab editor, you can use them together with the command below to create your automatic task:
sudo EDITOR=/sbin/vi fcrontab -u jp -e
Insert this line:
%hourly 27,57 DISPLAY=:0.0  /sbin/upgrade-nutyx
If you wish, you can also initiate an update search when starting the machine. There is very extensive documentation on the net for configuring fcrontab.

First launch of upgrade-nutyx

In order to have a functional update, it is important to run the 'upgrade-nutyx' command for the first and only time under your own account:
upgrade-nutyx
Wait for the command to complete or for the icon in the taskbar to appear to let you know that updates are available.

Config file

Since the downloading of the packages to be updated is done with your own account, the configuration file and archives are stored in your home folder.

The upgrade-nutyx configuration is in the file:

/home/jp/pkg/cards.conf
Archives are stored in the folder:
/home/jp/pkg/depot

Restarting the machine

To finalize the process, restart the PC. If updates are available, then they will be installed. The background task will then be active the next time the PC is started.

Conclusion

It is better to use this method rather than sudo cards upgrade:

  • The download is not done in the root account.
  • If the download is interrupted for any reason, no update will be made.
  • No risk of partial update.
  • The password is never requested to perform the update, it is done automatically when the machine is stopped.
  • A subsequent update can, if necessary, repair the last faulty one.