Starting in Ubuntu 21.04, when user trying to open file or path via GVfs admin daemon it outputs an error and refuses to work.
This usually happens when you use “Open as Administrator” or “Edit as Administrator” to open folder or edit file via root. Or when you trying to access another user folder in system, and even using
gedit admin://, or other commands in your script or console.
It usually outputs an error look like this:
GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: Unix process subject does not have uid set
Method 1: Install old GVfs from Ubuntu 20.10 repository:
You can download & install the gvfs .deb packages for the previous Ubuntu 20.10. And here are the links for 64-bit system:
Grab the 6 packages, then open terminal (Ctrl+Alt+T) and run command to install all of them:
sudo apt install ./Downloads/gvfs*.deb
Method 2: upgrade GVfs via PPA (recommend):
Upstream has fixed the issue by releasing GVfs 1.48.1. Ubuntu somehow stuck at v1.47.91 in Ubuntu 21.10 & 21.04.
Besides building from the source, I’ve uploaded it into this PPA to make life easier.
1. Open terminal either by searching from activities overview screen or by pressing Ctrl+Alt+T on keyboard. When it opens, run command to add the PPA:
sudo add-apt-repository ppa:ubuntuhandbook1/gvfs
2. Then either upgrade GVfs via “Software Updater” or run the apt command in terminal:
sudo apt install gvfs
After installing the new packages, Log out and back in to apply change.
How to Restore GVfs to stock version:
If you change mind, and want to revert it back, simply run command in terminal to purge the PPA which will downgrade the installed packages:
sudo apt install ppa-purge && sudo ppa-purge ppa:ubuntuhandbook1/gvfs
That’s all. Enjoy!