Zend certified PHP/Magento developer

How to debug: Failed to connect to bus: No such file or directory (systemctl –user status)?

I am trying to run systemctl --user status from a user account in order to not run services from root.

The way I do it is as follows:

  1. loginctl enable-linger $USER
  2. export XDG_RUNTIME_DIR="/run/user/$UID"

Then when I run systemctl --user status I get the following error: Failed to connect to bus: No such file or directory

What I tried to debug this.

  1. Setting the DBUS_SESSION_BUS_ADDRESS env variable by: export DBUS_SESSION_BUS_ADDRESS="unix:path=${XDG_RUNTIME_DIR}/bus" This did not fix it. (source)
  2. Rebooting the server after every change.
  3. Reinstalling dbus by sudo apt reinstall dbus-user-session

I am not sure what else to try or how to learn more about this problem in order for me to able to address it in a more informed manner.

Any info that can help me debug and understand this is very welcome.

P.S. I am running Ubuntu 20.04.5 and the problem likely happened after a sudo apt-get upgrade I ran. Before that it was working well.