You are not logged in.

#1 2012-06-13 09:21:26

r1pp3rj4ck
Member
From: Budapest, Hungary
Registered: 2011-12-06
Posts: 18
Website

[SOLVED] Accidentally changed /usr to 755, how to fix?

I was a bit too tired and when pacman was giving me warnings for some files about being 775 in filesystem and 755 in package, so I thought it would be a good idea to chmod -R 755 /usr. I was wrong. But now I'd like to fix it. I changed the whole stuff to +s, but the GTK+ stuff are not working now. I changed everything back to -s and give +s only to sudo which is now working fine, but the startx still won't start my Xfce. I guess there are more problems. I've been Googled around for some time now, but I didn't find anything useful and it's a bit hard to search with elinks. Could you post how to fix startx/startxfce4/GTK+ apps and maybe which apps need setuid by default? (I know sudo does, it's already done).

Thanks for your help,
r1pp3rj4ck

Last edited by r1pp3rj4ck (2012-06-13 11:49:56)

Offline

#2 2012-06-13 09:41:49

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,404
Website

Re: [SOLVED] Accidentally changed /usr to 755, how to fix?

Easiest way is to reinstall all packages.

Online

#3 2012-06-13 11:09:48

Awebb
Member
Registered: 2010-05-06
Posts: 6,311

Re: [SOLVED] Accidentally changed /usr to 755, how to fix?

Won't pacman just complain about permissions being different than the package suggests?

Offline

#4 2012-06-13 11:49:07

r1pp3rj4ck
Member
From: Budapest, Hungary
Registered: 2011-12-06
Posts: 18
Website

Re: [SOLVED] Accidentally changed /usr to 755, how to fix?

Thanks Allan and Awebb smile
This is what I did:

# chmod -R 0755 /usr
# chmod -R -s /usr
# pacman -S `pacman -Q | awk '{FS=" "; print $1}'`

(actually I wrote it in a file first so I could remove the packages from the file which were installed from AUR - I don't know what the inverse for pacman -Qm is, I haven't found it in the manpage of Pacman).

Last edited by r1pp3rj4ck (2012-06-13 11:49:31)

Offline

#5 2012-06-13 12:07:57

r1pp3rj4ck
Member
From: Budapest, Hungary
Registered: 2011-12-06
Posts: 18
Website

Re: [SOLVED] Accidentally changed /usr to 755, how to fix?

Oh and I also managed to re-install the AUR stuff too (only those ones which I haven't deleted yet):

# for pkg in `pacman -Qm | awk '{FS=" "; print $1}'`; do if [ -d $pkg ]; then pacman -U $pkg/*.xz; fi; done;

Last edited by r1pp3rj4ck (2012-06-13 12:08:48)

Offline

#6 2012-06-13 12:34:31

Awebb
Member
Registered: 2010-05-06
Posts: 6,311

Re: [SOLVED] Accidentally changed /usr to 755, how to fix?

Sometimes I wish we had a counterpart to -Qm, a -Q!m to filter packages NOT manually installed.

Last edited by Awebb (2012-06-13 12:35:14)

Offline

#7 2012-06-13 12:48:39

Pres
Member
Registered: 2011-09-12
Posts: 423

Re: [SOLVED] Accidentally changed /usr to 755, how to fix?

diff <(pacman -Q) <(pacman -Qm) | grep "<" | awk '{print $2}'

Not pretty, but it works.

Offline

#8 2012-06-13 12:56:39

r1pp3rj4ck
Member
From: Budapest, Hungary
Registered: 2011-12-06
Posts: 18
Website

Re: [SOLVED] Accidentally changed /usr to 755, how to fix?

Awebb, me too big_smile Pres, I actually like it, it's creative smile I guess I'll write a blog post about this, with the extension suggested by Pres, referencing all you guys. Thanks for the help once more smile

Offline

#9 2012-06-13 23:07:02

Awebb
Member
Registered: 2010-05-06
Posts: 6,311

Re: [SOLVED] Accidentally changed /usr to 755, how to fix?

Pres wrote:
diff <(pacman -Q) <(pacman -Qm) | grep "<" | awk '{print $2}'

Yes, that's the way we roll. That's also why I have not bothered asking for this feature in a bug yet, it's not hard to solve.

Offline

#10 2012-06-13 23:26:00

progandy
Member
Registered: 2012-05-17
Posts: 5,203

Re: [SOLVED] Accidentally changed /usr to 755, how to fix?

Awebb wrote:
Pres wrote:
diff <(pacman -Q) <(pacman -Qm) | grep "<" | awk '{print $2}'

Yes, that's the way we roll. That's also why I have not bothered asking for this feature in a bug yet, it's not hard to solve.

I use a slightly different command

(pacman -Q ; pacman -Qm) | sort | uniq -u
#Without versioninfo
(pacman -Qq ; pacman -Qqm) | sort | uniq -u

Last edited by progandy (2012-06-13 23:29:07)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#11 2012-06-14 01:36:58

Pres
Member
Registered: 2011-09-12
Posts: 423

Re: [SOLVED] Accidentally changed /usr to 755, how to fix?

Nice. Usually there are several solutions to problems like these. Your's looks like a neater solution than mine.

Offline

Board footer

Powered by FluxBB