Following the 'sudo apt update', permissions are reset:
ls -l /var/lib/command-not-found
-rw-r----- 1 root root 3108864 Jun 30 19:31 commands.db
-rw-r----- 1 root root 3239 Jun 30 19:31 commands.db.metadata
My sudo sessions have UMASK 0027 (checked with "sudo /bin/bash -c 'umask'"), I believe it may be part of my system's security settings.
A more permanent fix that seems to work for me is setting SGID bit on '/var/lib/command-not-found' directory as such:
sudo chmod 2755 /var/lib/command-not-found/
Database files in that directory now seem to remain chmod 644 following apt updates and installs.
But this feels like a hack - will this issue be more permanently addressed?
Same problem on Ubuntu 20.04 LTS
Manually fixing permissions with: command- not-found/ commands. db*
sudo chmod ugo+r /var/lib/
# sets chmod to 644
..gets undone by running:
sudo apt update
Following the 'sudo apt update', permissions are reset: command- not-found db.metadata
ls -l /var/lib/
-rw-r----- 1 root root 3108864 Jun 30 19:31 commands.db
-rw-r----- 1 root root 3239 Jun 30 19:31 commands.
My sudo sessions have UMASK 0027 (checked with "sudo /bin/bash -c 'umask'"), I believe it may be part of my system's security settings.
A more permanent fix that seems to work for me is setting SGID bit on '/var/lib/ command- not-found' directory as such: command- not-found/
sudo chmod 2755 /var/lib/
Database files in that directory now seem to remain chmod 644 following apt updates and installs.
But this feels like a hack - will this issue be more permanently addressed?