Solved Attempting to run "sudo updatedb" for the locate command - getting a permission denied error.

Solved issue

Priest_Apostate

Active Member
Joined
Nov 7, 2023
Messages
135
Reaction score
31
Credits
1,546
My username is able to run sudo commands on other services - but I cannot do so with the locate command:
$sudo updatedb
/usr/bin/find: '/run/user/1000/gvfs': Permission denied
/usr/bin/find: '/run/user/1000/doc': Permission denied

Checking online seems to pull confusing info regarding this. Any suggestions?
 


Neofetch data is as follows:


_,met$$$$$gg. XXXXXXXX@XXXXXXXX
,g$$$$$$$$$$$$$$$P. ------------------------
,g$$P" """Y$$.". OS: Debian GNU/Linux 12 (bookworm) x86_64
,$$P' `$$$. Host: 82XF IdeaPad Slim 5 16IRL8
',$$P ,ggs. `$$b: Kernel: 6.7.12+bpo-amd64
`d$$' ,$P"' . $$$ Uptime: 8 mins
$$P d$' , $$P Packages: 2616 (dpkg)
$$: $$. - ,d$$' Shell: bash 5.2.15
$$; Y$b._ _,d$P' Resolution: 1920x1200
Y$$. ."Y$$$$P"' DE: Plasma 5.27.5
`$$b "-.__ WM: kwin
`Y$$ Theme: [Plasma], Breeze [GTK2/3]
`Y$$. Icons: [Plasma], breeze [GTK2/3]
`$$b. Terminal: konsole
`Y$$b. CPU: 13th Gen Intel i7-1355U (12) @ 5.000GHz
`"Y$b._ GPU: Intel Raptor Lake-P [Iris Xe Graphics]
`""" Memory: 3156MiB / 15725MiB
 

Attachments

  • ksnip_20240621-094456.png
    ksnip_20240621-094456.png
    67.7 KB · Views: 234
Can you share the output of the following?
Code:
id
ls -l run/user/1000/gvfs /run/user/1000/doc
 
priestapostate@XXXXXX$ ls -l /run/user/1000/gvfs /run/user/1000/doc
/run/user/1000/doc:
total 0
dr-x------ 2 priestapostate priestapostate 0 Dec 31 1969 by-app

/run/user/1000/gvfs:
total 0
priestapostate@XXXXXX:~$
 
You missed the output of the "id" command?
 
$ id
uid=1000(priestapostate) gid=1000(priestapostate) groups=1000(priestapostate),27(sudo),100(users)

$ ls -l /run/user/1000/gvfs /run/user/1000/doc
/run/user/1000/doc:
total 0
dr-x------ 2 priestapostate priestapostate 0 Dec 31 1969 by-app

/run/user/1000/gvfs:
total 0
 
/run is a special directory, not something you'll find on your hard drive. sudo gives you root euid, not root uid. Try sudo bash instead. Then run whatever you need. I would not recommend cataloging files in /proc, /run, or /sys as these are special directories. You should not tell aide to check there either as doing so can crash your system. While you're at it you probably shouldn't catalog /dev either.

Signed,

Matthew Campbell
 
/run is a special directory, not something you'll find on your hard drive. sudo gives you root euid, not root uid. Try sudo bash instead. Then run whatever you need. I would not recommend cataloging files in /proc, /run, or /sys as these are special directories. You should not tell aide to check there either as doing so can crash your system. While you're at it you probably shouldn't catalog /dev either.

Signed,

Matthew Campbell
I might be a bit confused here: I'm using Konsole - which is using bash.
The only command I inputted (which generated those error messages), was "sudo updatedb." I'm just wanting to get that command to properly function.
 
I might be a bit confused here: I'm using Konsole - which is using bash.
The only command I inputted (which generated those error messages), was "sudo updatedb." I'm just wanting to get that command to properly function.
It doesn't matter what terminal program you're running or the command shell running in that terminal. sudo updatedb will run updatedb with an euid of root and a uid of whoever you normally are. Run sudo bash and then run updatedb as root. This way it will run updatedb as euid(0) and uid(0).

Signed,

Matthew Campbell
 
$ id
uid=1000(priestapostate) gid=1000(priestapostate) groups=1000(priestapostate),27(sudo),100(users)

$ ls -l /run/user/1000/gvfs /run/user/1000/doc
/run/user/1000/doc:
total 0
dr-x------ 2 priestapostate priestapostate 0 Dec 31 1969 by-app

/run/user/1000/gvfs:
total 0
That looks good, I can't replicate your problem. What Gnome application did you install that uses gvfs? What happens when you run it directly as the root user?

You should not tell aide to check there either as doing so can crash your system. While you're at it you probably shouldn't catalog /dev either.
OP is not using aide but mlocate/plocate, that uses updatedb to update the file database.
 
That looks good, I can't replicate your problem. What Gnome application did you install that uses gvfs? What happens when you run it directly as the root user?
I was fairly certain that I avoided installing Gnome on my last install attempt, as its appearance didn't appeal to me. I use KDE Plasma on Wayland.
 
OP is not using aide but mlocate/plocate, that uses updatedb to update the file database.

Thanks: no offense to anyone - but I was confused about why was aide mentioned (I don't know what that is exactly), or how it pertained to my issue of just trying to get the updatedb command to work.

Slight aside, I will mention that this isn't the first time I've had a sudo command return with a "Permission Denied" error. While I can't remember the particulars (as it doesn't happen often), has anyone else run into that?
 
Last edited:
I was fairly certain that I avoided installing Gnome on my last install attempt, as its appearance didn't appeal to me. I use KDE Plasma on Wayland.
Can you share the output of the following?
Code:
dpkg --list | grep gvfs
And can you still answer the question about what happens when your run "updatedb" directly as root user?

Slight aside, I will mention that this isn't the first time I've had a sudo command return with a "Permission Denied" error. While I can't remember the particulars (as it doesn't happen often), has anyone else run into that?
No, with what other commands has that happened?
 
priestapostate@XXXXXXX:~$ dpkg --list | grep gvfs
ii gvfs:amd64 1.50.3-1 amd64 userspace virtual filesystem - GIO module
ii gvfs-backends 1.50.3-1 amd64 userspace virtual filesystem - backends
ii gvfs-common 1.50.3-1 all userspace virtual filesystem - common data files
ii gvfs-daemons 1.50.3-1 amd64 userspace virtual filesystem - servers
ii gvfs-fuse 1.50.3-1 amd64 userspace virtual filesystem - fuse server
ii gvfs-libs:amd64 1.50.3-1 amd64 userspace virtual filesystem - private libraries



Regarding the other times it occurred, I don't remember the exact commands that generated said error. Because they didn't occur very often (last time occurred prior to me creating an account here), I'd get enmeshed with some other task while researching as to why they occurred with said command.

priestapostate@XXXXXX:~$ sudo bash
[sudo] password for priestapostate:
root@XXXXXX:/home/priestapostate# updatedb
/usr/bin/find: '/run/user/1000/gvfs': Permission denied
/usr/bin/find: '/run/user/1000/doc': Permission denied
root@XXXXXX:/home/priestapostate#



priestapostate@XXXXXX:~$ su -
Password:
root@XXXXXX:~# updatedb
/usr/bin/find: '/run/user/1000/gvfs': Permission denied
/usr/bin/find: '/run/user/1000/doc': Permission denied
root@XXXXXX:~#
 
Last edited:
priestapostate@XXXXXXX:~$ dpkg --list | grep gvfs
ii gvfs:amd64 1.50.3-1 amd64 userspace virtual filesystem - GIO module
ii gvfs-backends 1.50.3-1 amd64 userspace virtual filesystem - backends
ii gvfs-common 1.50.3-1 all userspace virtual filesystem - common data files
ii gvfs-daemons 1.50.3-1 amd64 userspace virtual filesystem - servers
ii gvfs-fuse 1.50.3-1 amd64 userspace virtual filesystem - fuse server
ii gvfs-libs:amd64 1.50.3-1 amd64 userspace virtual filesystem - private libraries
What other packages get removed when you try to remove them without actually pressing "y" to verify to remove them. So what other packages will get removed?

What happens when you run "updatedb" as the root user, so when not using "sudo"?
 
What other packages get removed when you try to remove them without actually pressing "y" to verify to remove them. So what other packages will get removed?

What happens when you run "updatedb" as the root user, so when not using "sudo"?

Edited previous response to add in the su - and sudo bash attempts.

Sorry - but I don't understand your question about other packages getting removed: I am fairly certain that whenever I remove said packages (with either nala or any of the apt commands), I receive a confirmation prompt before doing so.
 
The oddest part about this is that the same command works without an issue on my Rocky Linux desktop.
 
Sorry - but I don't understand your question about other packages getting removed: I am fairly certain that whenever I remove said packages (with either nala or any of the apt commands), I receive a confirmation prompt before doing so.
I forgot if Debian lists the the packages and dependencies that will get removed or not when you remove a dependency. I'm trying to figure out what package on your system uses those installed packages, so these ones: gvfs gvfs-backends gvfs-common gvfs-daemons gvfs-fuse gvfs-libs. That way you will see what program uses those and if you actually installed it yourself and then you will know if you use it yourself, if you don't you can remove it and then try again by using "sudo" with "updatedb"

priestapostate@XXXXXX:~$ su -
Password:
root@XXXXXX:~# updatedb
/usr/bin/find: '/run/user/1000/gvfs': Permission denied
/usr/bin/find: '/run/user/1000/doc': Permission denied
root@XXXXXX:~#
Seems like "gvfs" is causing the problems and not "sudo" since you have the same with th root account.
 
Top