Comment 13 for bug 1824000

Revision history for this message
Jean Monet (jeanmonet) wrote :

Same problem on Ubuntu 20.04 LTS

Manually fixing permissions with:
  sudo chmod ugo+r /var/lib/command-not-found/commands.db*
  # sets chmod to 644

..gets undone by running:
  sudo apt update

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?