How to Fix “the name org freedesktop policykit1 was not provided by any service files”?

Policykit is an application tool kit for defining and controlling the policy which gives access to the privileged packages. The old name of this tool is polkit. While restarting any systemctl services in Linux, such as PostgreSQL, users can face this error. This post will fix the error “the name org freedesktop policykit1 was not provided by any service files” by demonstrating the reasons and solutions. 

Reason 1: Policykit1 Package is Not Installed

The first possible reason for this error is that the policyKit1 package is not installed in the operating system. So check your system; if it is not installed, install it.

Solution: Installing the policykit1 package

To install the policykit1 in the Linux operating system, use the below-given command according to your Linux distribution:

$ sudo apt install policykit-1     #For Debian/ Ubuntu Distributions
$ sudo dnf install policykit-1     #For Fedora/Red hat Distribution
$ sudo pacman -S policykit-1       #For Arch Distribution

If you are using a Linux distribution other than Ubuntu, use the below command according to your Linux distributions.

Reason 2: Sudo Privileges are Not Given

The second possible reason that generates this error is that you must log in as a root user or add the “sudo” keyword before the command to give the sudo (root) permissions.

Solution: Using sudo Permissions

Sometimes, the user forgets to give the root permissions, which will display the error. Start any systemctl services with root permissions:

$ sudo systemctl start <service name>

In this way; you can resolve your problem.

Conclusion 

To resolve this error, first, check whether the “policy kit-1” package is installed. If it is not installed, then install it using the given command. Secondly, check if you log in as a root user or add “sudo” in the command to allow permissions. This post has demonstrated all the reasons and solutions for the given error.