auto update setting

Hi

I have one Pie with PiVPN installed and it is installing all the Linux updates automatically.
Another one just displays the new updates in the banner and I have to run the update command manually.

Where is the setting to auto-update? Can’t find or remember where. I think when I installed PiVPN there was a question to enable auto-update.

Thx in advance

The setting is in dietpi.txt. To enable it, run:

G_CONFIG_INJECT 'CONFIG_CHECK_APT_UPDATES=' 'CONFIG_CHECK_APT_UPDATES=2' /boot/dietpi.txt

Great, thx. And to disable it?

Just to avoid a misunderstanding. PiVPN will install software package unattended-upgrades in addition! This is a behaviour of PiVPN and has no relation to DietPi functions https://wiki.debian.org/UnattendedUpgrades

On DietPi we use our own script to check for updates. It’s more lightweight as no additional software component will be needed. This as well explains why it is active on one system but not on the other.

And to disable it?

Simply uninstall unattended-upgrades if it is the software package installed by PiVPN

OK. This is it then!

Joulinar, we disable the installation of unattended-upgrades on PiVPN, and also ask if the DietPi automatic upgrades should be enabled.

I did the install via the original PiVPN script…

Should I leave this or change it? If positive pls give me the steps.

Remove unattended-upgrades with:

apt purge unattended-upgrades

and enable the DietPI automatic upgrades with the command I mentioned earlier.

Did get this:

Package ‘unattended-upgrades’ is not installed, so not removed

P.S: I just realized that I DID install PiVPN via dietpi-software… sorry

So the auto-update command is already in dietpi.txt ??

EDIT:

Just checked:

CONFIG_CHECK_APT_UPDATES=2 is NOT in dietpi.txt

Can you check

ls -la /etc/apt/apt.conf.d/



drwxr-xr-x 2 root root 4096 Jul 30 01:28 .
drwxr-xr-x 7 root root 4096 Nov 26  2020 ..
-r--r--r-- 1 root root  440 Jul 30 01:28 01autoremove-kernels
-rw-r--r-- 1 root root  182 Dec 27  2020 70debconf
-rw-r--r-- 1 root root 1370 Jul 25 09:25 97dietpi
-rw-r--r-- 1 root root  212 Dec 27  2020 99-dietpi-cache

Both your systems are on latest release 7.4?

Let’s check as well following

ls -la /var/tmp/dietpi/logs/

Yes, they are.

drwxrwxr-x 3 dietpi dietpi    4096 Jun  4 11:49 .
drwxrwxr-x 3 dietpi dietpi    4096 Sep 10  2020 ..
-rw-r--r-- 1 root   root      5473 Sep 10  2020 dietpi-firstboot.log
-rw-r--r-- 1 root   root   1284625 Oct 20  2020 dietpi-firstrun-setup.log
-rw-r--r-- 1 root   root       322 Jul 30 19:52 dietpi-ramlog.log
-rw-r--r-- 1 root   root       156 May  8 10:15 dietpi-ramlog_disable_debug.log
drwxr-xr-t 7 root   root      4096 Jul 16 10:12 dietpi-ramlog_store
-rw-r--r-- 1 root   root      4853 Jul 25 09:25 dietpi-update.log
-rw-r--r-- 1 root   root     69524 Jul 30 01:28 dietpi-upgrade_apt.log
-rw-r--r-- 1 root   root      1073 Dec 18  2020 fs_partition_resize.log

I see dietpi-upgrade_apt.log present. This indicates automatic apt package update is active via DietPi scripts. Can you share the file?

Let’s verify config settings

cat /boot/dietpi.txt | grep CONFIG_CHECK_APT_UPDATES
root@DietPi:~# cat /boot/dietpi.txt | grep CONFIG_CHECK_APT_UPDATES
CONFIG_CHECK_APT_UPDATES=2

(Guess I did miss this line previously, sorry)

Actually a bit above is the line: CONFIG_CHECK_APT_UPDATES=1
dietpi.txt (12.7 KB)

Changed this:

# DietPi checks for updates: Allows DietPi to check for updates on a daily basis and boot using a less 1 KiB file download.
CONFIG_CHECK_DIETPI_UPDATES=1

to:

# DietPi checks for updates: Allows DietPi to check for updates on a daily basis and boot using a less 1 KiB file download.
CONFIG_CHECK_DIETPI_UPDATES=1

# Daily check for APT package updates: 0=disable | 1=check only | 2=check and upgrade automatically
# - Upgrade logs can be found at: /var/tmp/dietpi/logs/dietpi-update_apt.log
CONFIG_CHECK_APT_UPDATES=2

and deleted CONFIG_CHECK_APT_UPDATES=2 from the end of the file.

Seems OK now and I now how to disable :wink:


THX!!!

not sure what you mean but in the file shared, there was just a single line containing CONFIG_CHECK_APT_UPDATES=2. Which is totaly fine if you like to update apt packages automatically. Doesn’t matter if it is at the end of the file or somewhere in the middle.

I just edited the file and put

Daily check for APT package updates: 0=disable | 1=check only | 2=check and upgrade automatically

- Upgrade logs can be found at: /var/tmp/dietpi/logs/dietpi-update_apt.log

CONFIG_CHECK_APT_UPDATES=2

after

DietPi checks for updates: Allows DietPi to check for updates on a daily basis and boot using a less 1 KiB file download.

CONFIG_CHECK_DIETPI_UPDATES=1


And deleted the line near the end.


Cleaner now with the comments I have on the other pie.

So all good!

ok good