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 nautilus admin://
, 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
The issue is caused by a gvfs commit to fix flatpak app network permission requirement problem. To get rid of the error (see bug), reverting just that one commit could be a workaround.
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:
gvfs_1.46.1-1ubuntu1_amd64.deb
gvfs-libs_1.46.1-1ubuntu1_amd64.deb
gvfs-fuse_1.46.1-1ubuntu1_amd64.deb
gvfs-daemons_1.46.1-1ubuntu1_amd64.deb
gvfs-common_1.46.1-1ubuntu1_all.deb
gvfs-backends_1.46.1-1ubuntu1_amd64.deb
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!
I used this to restore the admin nautilus right-click, but it didn’t work.
When I tried to revert, I got:
sudo apt install gvfs=1.47.91-1ubuntu1
[sudo] password for ME:
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
gvfs : Depends: gvfs-common (= 1.47.91-1ubuntu1) but 1.47.91-2ubuntu1 is to be installed
Depends: gvfs-daemons (< 1.47.91-1ubuntu1.1~)
Depends: gvfs-libs (= 1.47.91-1ubuntu1) but 1.47.91-2ubuntu1 is to be installed
E: Unable to correct problems, you have held broken packages.
Try purging the PPA with the updated command. If you have already removed the PPA, install and open Synaptic package manager. Then search gvfs via the tool, highlight it and go to menu Package -> Force Version.
I ended up removing gvfs via “sudo apt remove gvfs” command and reinstalling gvfs and nautilus. Not sure if I recommend it, but it worked for me.
I tried this both ways and it didn’t work for me.
This worked for me when I was using my lacie on pop os. Thanks very much.
All of this, so that I can right click on a text file and be able to save it for a samba setup. Holy shit linux is a hot mess.
No it’s not, only the Ubuntu non-LTS releases are messy. But that’s OK, they are mainly used for testing purposes.
This worked for me. Thank you very much.
It worked for me in a VM with Ubuntu 21.04 with Windows 10 Pro as a host.
After I had tried at least half a dozen distros …