loginctl enable-linger error Could not enable linger: Access denied

I have 2 Ubuntu 20.04 servers. One of them gives me this error.

Could not enable linger: Access denied

when running

loginctl enable-linger

The other server doesn’t raise any errors. I did a bit of research, but I could not find a solution to my problem. Checking the version of the system installed on the servers I found out that the server that is raising the error has systemd 245 (245.4-4ubuntu3.23) (newer) and the one that is working fine has systemd 245 (245.4-4ubuntu3.22) (older).

I tried to verbose the command loginctl, but I didn’t find out how to do it.

I found the package of the older version here, but I don’t know how to downgrade if it’s actually possible to downgrade.

Asked By: microweb10

||

Thanks to steeldriver for the help!

I found out that I was missing one package, since the command pkaction returned an error command not found.

I fixed it by running.

sudo apt-get install policykit-1
Answered By: microweb10
Categories: Answers Tags: , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.