Contents
Challenge
This documentation page is about resolving a specific challenge. Which is if you installed a package. After the installation, if somehow the permissions were changed on the packaged installed folder(s) or file(s). In turn, the package is no longer work properly, or no longer work at all, or its security is weaker. How to restore the package permissions to their default? This is the challenge.
One easy, fast, and stable way to resolve this challenge is this command below. Which automatically sets all the package permissions back to their default. Including both the package folder(s) & file(s). The end result is as if the package was freshly installed for the first time with its default permission.
Resolution 1
Step 1
Using Terminal/Console, connect into the appropriate Linux. This is important because in both step 2 & 3 below all commands will be executed as this user.
Step 2
If not already done, using Terminal execute this command to install Sudo
apt install sudo
Note: For those not familiar with Sudo, allow a Linux user(s) limited super user privileges
If not already done, using Terminal execute this command to install Aptitude
sudo apt install aptitude
Note: For those not familiar with Aptitude, it is a package manager. Which is similar to Apt. Aptitude has more functionality than Apt-Get. Aptitude includes both an interactive UI and a text-only interface/CLI. In comparison, APT lacks an interactive UI. Aptitude is a high-level package manager while APT is lower-level package manager.
Step 3
Choose one of the four options below. Which will reset the package permissions to their default. And keep the package(s) configuration:
Option 1: ONE package. WITHOUT Backport.
Format:
sudo aptitude reinstall <PACKAGE NAME>
Example:
sudo aptitude reinstall jami
Option 2: ALL packages. WITHOUT Backport.
Example: sudo aptitude reinstall '~i'
Note
WARNING: This option above will both reinstall ALL already installed packages and reset their permissions to their default. Including your operating system (OS). Before executing this command, it is suggested to complete the appropriate actions. Such as, but not limited to, create a backup, check that you have enough available locale storage. Time needed for this command is similar to installing a new OS.
Option 3: ONE package. WITH Backport.
Format:
sudo aptitude -t <CODE NAME DEBIAN>-backports reinstall <PACKAGE NAME>
Example:
sudo aptitude -t buster-backports reinstall jami
Note
This option above is for Debian 10 Buster. If you use Ubuntu, you would need to adapt this command. Related documentation at https://help.ubuntu.com/community/UbuntuBackports
Option 4: ALL packages. WITH Backport.
Format:
sudo aptitude -t <CODE NAME DEBIAN>-backports reinstall '~i'
Example:
sudo aptitude -t buster-backports reinstall '~i'
Note
This option above is for Debian 10 Buster. If you use Ubuntu, you would need to adapt this command. Related documentation at https://help.ubuntu.com/community/UbuntuBackports
Note
WARNING: This option above will both reinstall ALL already installed packages and reset their permissions to their default. Including your operating system (OS). Before executing this command, it is suggested to complete the appropriate actions. Such as, but not limited to, create a backup, check that you have enough available locale storage. Time needed for this command is similar to installing a new OS.
Notes about all four options above
Depending on the package, most of the time, those commands above will reset the permissions only on the package folder(s) & file(s). Other files, such as configuration file(s) may not be affected. In other words, the configuration file will remains unaffected. If needed, and if appropriate you could manually reset the permissions on the configuration file(s) only. Often those configurations file(s) are stored at a different location. For example, but not limited to, somewhere into the user home folder. If unsure, find each package documentation.
Resolution 2
Do you know any other way to resolve this challenge? You are welcome to add it here.