Having lost my mind I did chown -R root:root /usr on a Void Linux system

Would someone be so nice as to mail me the results of ls -lR /usr on a Void system. I'll go over the changes, make everything work again, and post my findings here in this question.

Based on the reply by msp9011, and realizing I need the info for an xfce4, networkmanager system, please post the results from:

find /usr/ \(  -perm -4000 \)  -exec ls -l {} +


find /usr/ \( ! -group root \)  -exec ls -l {} +

Could you share the results somewhere ?

P.S. just reinstalling Void is a pain, because I'm on an extended road trip, and my internet access is generally by cellular, or bad wifi.


hope this is what you require,

[root@localhost usr]# find /usr/ \(  ! -group root \)  -exec ls -l {} +
-rwx--s--x. 1 root slocate   38464 Mar 12  2015 /usr/bin/locate
-rwxr-sr-x. 1 root nobody   141384 Aug 31  2017 /usr/bin/ssh-agent
---s--x---. 1 root stapusr  183072 Jun 19  2018 /usr/bin/staprun
-r-xr-sr-x. 1 root tty       15224 Jul 24  2015 /usr/bin/wall
-rwxr-sr-x. 1 root tty       12016 Jan 26  2018 /usr/bin/write
-rwx--s--x. 1 root utmp      17160 May  9  2018 /usr/lib64/vte/gnome-pty-helper
-rwx--s--x. 1 root utmp       9808 Aug 18  2010 /usr/libexec/utempter/utempter
-rwx--s--x. 1 root lock      15808 Aug 19  2010 /usr/sbin/lockdev
-rwxr-sr-x. 1 root postdrop 189000 Mar 23  2017 /usr/sbin/postdrop
-rwxr-sr-x. 1 root postdrop 217832 Mar 23  2017 /usr/sbin/postqueue
-r-s--x---. 1 root apache    13984 Jun 19  2018 /usr/sbin/suexec

total 12
-rwx--s--x. 1 root utmp 9808 Aug 18  2010 utempter
  • Thanks! I'm running xfce, which includes stuff like dbus and gvfs, and am also running NetworkManager. I managed to get network-manager to run again via this: cd /usr/libexec chgrp dbus dbus-daemon-launch-helper chmod 4754 dbus-daemon-launch-helper So while I appreciate your reply, I'm not out of the woods yet! – bart van deenen Dec 27 '18 at 11:42

You can just reinstall the affected packages using xbps-install -f, it will preserve the configuration files unless you specify -f twice.

 -f, --force
     Force downgrade installation (if package version in repos is less
     than installed version), or reinstallation (if package version in
     repos is the same) to the target PKG, overwriting regular package
     files and symlinks (if they have been modified) but preserving
     configuration files.  If -f is specified twice all files will be
     unpacked, even configuration files.

xbps-pkgdb(1) is able to detect many issues with package files, but sadly not owner/modes at the moment, but that would be a nice feature to add.

  • Note that this will set the packages to manually installed, which may not be what you want. To correct this, run xbps-pkgdb -m auto [PACKAGE...] for any package which should not be set to manually installed. You can get a list of packages that are currently set to manually installed using xbps-query -m. – CameronNemo Dec 29 '18 at 4:44

I restored the permissions via an Void live usb stick! I did a find /usr -printf "0%m %u:%g %p\n" > permissions-all to generate a file with all the permissions in /usr. Then booting from the borked install I used a simple bash script to restore all permissions. The xbps-install -f is problematic if you have very poor connectivity and you want restore large parts of your system like xfce4. Thank you all for thinking along and I learned a lot!

head of /usr/permissions-all

0755 root:root /usr
0755 root:root /usr/lib
0755 root:root /usr/lib/libimobiledevice.so.6.0.0
0777 root:root /usr/lib/libsoxr.so.0
0777 root:root /usr/lib/libXvMCr600.so.1.0
0777 root:root /usr/lib/libwebpmux.so.3
0755 root:root /usr/lib/audit
0755 root:root /usr/lib/audit/sotruss-lib.so
0777 root:root /usr/lib/libfontenc.so.1
0755 root:root /usr/lib/libvulkan_radeon.so
0755 root:root /usr/lib/libthunarx-3.so.0.0.0
0777 root:root /usr/lib/libturbojpeg.so.0

script restore-permissions.sh

set -e
while read p ug f
    if [ -e "$f" ] ; then
        ug_=$(find "$f" -maxdepth 0 -printf "%u:%g")
        p_=$(find "$f" -maxdepth 0 -printf "0%m")
        if [ "$ug_" != "$ug"  ] ; then
            echo "$f wrong ug $ug_ should be $ug, fixing"
            chown $ug "$f"
        if [ "$p_" != "$p"  ] ; then
            echo "$f wrong perms $p_ should be $p, fixing"
            chmod $p "$f"
done < permissions-all

I've added my permissions-all and the restore-script to a public google-drive folder so anyone that has the same problem can try it. The file is from the most recent void xfce4 live disk. Here google-drive is the data.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.