You are not logged in.

#1 2020-11-15 04:53:26

fire100265
Member
Registered: 2020-10-05
Posts: 95

[SOLVED] I messed up permissions in /usr

I had a problem where installing packages will not add a start menu icon in Plasma. So, I ran

sudo chown -R root:root /usr
sudo chmod -R 755 /usr

sudo could not be run because uid was not 0. So I switched to tty and executed the latter command. I still could not sudo so I followed a guide and in tty, I executed the following commands:

chown -R root:root /usr
chmod -R 4755 /usr

. After this I could not even open applications. I tried reversing the damage with 755 but that did not work. stat /usr said that access was 4755. Can I fix this without reinstalling? Thank you for reading.

Last edited by fire100265 (2020-11-15 11:48:54)

Offline

#2 2020-11-15 04:58:30

GaKu999
Member
From: US/Eastern
Registered: 2020-06-21
Posts: 696

Re: [SOLVED] I messed up permissions in /usr

fire100265 wrote:

I had a problem where installing packages will not add a start menu icon in Plasma. So, I ran

sudo chown -R root:root /usr
sudo chmod -R 755 /usr

sudo could not be run because uid was not 0. So I switched to tty and executed the latter command. I still could not sudo so I followed a guide and in tty, I executed the following commands:

chown -R root:root /usr
chmod -R 4755 /usr

. After this I could not even open applications. I tried reversing the damage with 755 but that did not work. stat /usr said that access was 4755. Can I fix this without reinstalling? Thank you for reading.

You have screwed your system, what stupid guide did you follow?
Heck...let's see...from archiso, delete /usr, pacstrap, and it should be less painful (theorically)


My reposSome snippets

Heisenberg might have been here.

Offline

#3 2020-11-15 05:00:25

fire100265
Member
Registered: 2020-10-05
Posts: 95

Re: [SOLVED] I messed up permissions in /usr

Isn't /usr a very important directory? Is it safe to delete it?

Offline

#4 2020-11-15 05:06:45

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,523
Website

Re: [SOLVED] I messed up permissions in /usr

Yes it's important, but it's also already totally hosed.  I initially thought of suggesting that removing it shouldn't be necessary, but given the risks of executable setuid programs or scripts laying around, it really should be nuked first.

As for whether it's safe to delete it, of course it is if you are booting from an iso and are about to replace it with pacman/pacstrap.

But on that, there is no need for pacstrap as the pacman databases are still in place.  Just use pacman to reinstall all packages listed as installed after deleting /usr (assuming all relevant partitions are mounted under /mnt):

pacman -r /mnt -Qnq | pacman -r /mnt -S -

Last edited by Trilby (2020-11-15 05:08:57)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2020-11-15 05:10:08

GaKu999
Member
From: US/Eastern
Registered: 2020-06-21
Posts: 696

Re: [SOLVED] I messed up permissions in /usr

fire100265 wrote:

Isn't /usr a very important directory? Is it safe to delete it?


It's not safe, that's why I told you to pacstrap after wiping it.

Now, another alternative now that I think of it, maybe doing a full reinstall could do the trick, but pacman doesn't change permissions, just complains, so that's why I choose wipe-install first.

The non-efficient approach I would do.
1- create a packages list of current system
2- boot to archiso
3- remove /usr from system
4- pacstrap with the contents of the package list, hence a full reinstall

You could skip the list with an oneliner, querying the system's pacman database.

Wiki page https://wiki.archlinux.org/index.php/Pa … l_packages

EDIT: That parrot should have a ninja suit. tongue

Last edited by GaKu999 (2020-11-15 05:11:19)


My reposSome snippets

Heisenberg might have been here.

Offline

#6 2020-11-15 05:24:02

fire100265
Member
Registered: 2020-10-05
Posts: 95

Re: [SOLVED] I messed up permissions in /usr

Both of you seem to be suggesting the same thing. From what I understand, I first nuke /usr, chroot into /mnt and use

pacman -r /mnt -Qnq | pacman -r /mnt -S -

Willl I still have my userdata in all my applications? I don't need to add users, root password etc. right?

Offline

#7 2020-11-15 05:33:46

GaKu999
Member
From: US/Eastern
Registered: 2020-06-21
Posts: 696

Re: [SOLVED] I messed up permissions in /usr

fire100265 wrote:

Both of you seem to be suggesting the same thing. From what I understand, I first nuke /usr, chroot into /mnt and use

pacman -r /mnt -Qnq | pacman -r /mnt -S -

Willl I still have my userdata in all my applications? I don't need to add users, root password etc. right?

Yes, your data is safe.
Only /usr will get repopulated.


My reposSome snippets

Heisenberg might have been here.

Offline

#8 2020-11-15 05:43:19

fire100265
Member
Registered: 2020-10-05
Posts: 95

Re: [SOLVED] I messed up permissions in /usr

I tried what you guys said. I chrooted and removed /usr. After that pacman could not be found. So I tried to pacstrap base linux and linux-firmware. After that I got the error warning: could not get file information /usr

Edit: what do I do now?

Last edited by fire100265 (2020-11-15 05:43:38)

Offline

#9 2020-11-15 05:46:08

GaKu999
Member
From: US/Eastern
Registered: 2020-06-21
Posts: 696

Re: [SOLVED] I messed up permissions in /usr

fire100265 wrote:

I tried what you guys said. I chrooted and removed /usr. After that pacman could not be found. So I tried to pacstrap base linux and linux-firmware. After that I got the error warning: could not get file information /usr

Edit: what do I do now?

Umm, I guess english is not your main language.

The command is NOT inside chroot.
Get out of chroot and use the command...

The warning is normal.


My reposSome snippets

Heisenberg might have been here.

Offline

#10 2020-11-15 05:49:20

fire100265
Member
Registered: 2020-10-05
Posts: 95

Re: [SOLVED] I messed up permissions in /usr

Yeah it isn't my first language. Now I can't chroot in to reinstall everything. I get the error that /bin/bash does not exist. I manually checked and it does exist. What do I do now?

Offline

#11 2020-11-15 05:51:48

GaKu999
Member
From: US/Eastern
Registered: 2020-06-21
Posts: 696

Re: [SOLVED] I messed up permissions in /usr

fire100265 wrote:

Yeah it isn't my first language. Now I can't chroot in to reinstall everything. I get the error that /bin/bash does not exist. I manually checked and it does exist. What do I do now?

NOT IN CHROOT.
Command from / in archiso, not chroot.
Your system mounted on /mnt, you run command in archiso, not chroot, nothing else needed.


My reposSome snippets

Heisenberg might have been here.

Offline

#12 2020-11-15 05:53:53

fire100265
Member
Registered: 2020-10-05
Posts: 95

Re: [SOLVED] I messed up permissions in /usr

I mounted my installation in /mnt. What I'm saying is that arch-chroot /mnt does not work. I get the error that /bin/bash: no such file or directory. I don't know what to do now.

Offline

#13 2020-11-15 05:57:22

GaKu999
Member
From: US/Eastern
Registered: 2020-06-21
Posts: 696

Re: [SOLVED] I messed up permissions in /usr

fire100265 wrote:

I mounted my installation in /mnt. What I'm saying is that arch-chroot /mnt does not work. I get the error that /bin/bash: no such file or directory. I don't know what to do now.

Why do you keep trying arch-chroot?
Not needed, no chroot, run from archiso.

Installing base linux and linux-firmware only installed a metapackage, the kernel and the firmwares, bash is not there because you didn't install it.


My reposSome snippets

Heisenberg might have been here.

Offline

#14 2020-11-15 05:59:48

fire100265
Member
Registered: 2020-10-05
Posts: 95

Re: [SOLVED] I messed up permissions in /usr

Now I understand what you're trying to say. I get the error that there isn't enough disk space on my partition. How can I force the installation?

Edit: there's about 50 gigabytes of space left. The installation requires 10 gigabytes.

Last edited by fire100265 (2020-11-15 06:02:36)

Offline

#15 2020-11-15 06:02:21

GaKu999
Member
From: US/Eastern
Registered: 2020-06-21
Posts: 696

Re: [SOLVED] I messed up permissions in /usr

Is your rootfs mounted on /mnt?

Did you run:

pacman -r /mnt -Qnq | pacman -r /mnt -S -

?

Post output of:

df -h | grep /mnt

My reposSome snippets

Heisenberg might have been here.

Offline

#16 2020-11-15 06:15:36

fire100265
Member
Registered: 2020-10-05
Posts: 95

Re: [SOLVED] I messed up permissions in /usr

Output for first command:

packages
Total Download Size: 2344.55 MiB
Total Installed Size: 10133.03 MiB
Net Upgrade Size: 16.91 MiB

Output for second command:

/dev/sdb5 103G 28G 71G 29% /mnt

The first command gives me an error:

 error: Partition / too full: 604117 blocks needed, 63532 blocks free

Edit: My disk has more than enough space for the installation but my disk is apparently almost full.

Last edited by fire100265 (2020-11-15 07:06:36)

Offline

#17 2020-11-15 07:50:07

JJK
Member
Registered: 2013-10-24
Posts: 56

Re: [SOLVED] I messed up permissions in /usr

Where is pacstrap downloading the packages? It might be using the live filesystem, which is in your RAM.

Last edited by JJK (2020-11-15 07:50:16)

Offline

#18 2020-11-15 07:54:57

fire100265
Member
Registered: 2020-10-05
Posts: 95

Re: [SOLVED] I messed up permissions in /usr

The command states that /mnt is used but I don't know why RAM might be used.

Offline

#19 2020-11-15 08:26:44

GaKu999
Member
From: US/Eastern
Registered: 2020-06-21
Posts: 696

Re: [SOLVED] I messed up permissions in /usr

The command was a slight oversight, since you have a extremely bloated system, there's no way you can download that much into RAM.

Fixed command.

pacman -r /mnt -Qnq | pacman --sysroot /mnt -S -

This should operate as expected.


My reposSome snippets

Heisenberg might have been here.

Offline

#20 2020-11-15 08:27:23

seth
Member
Registered: 2012-09-03
Posts: 51,056

Re: [SOLVED] I messed up permissions in /usr

Use "--sysroot /mnt" instead of "-r /mnt"
"-r" only redirects the root directory for the packages but tries to use the live system (arch iso) as cache path and there's not enough space to hold the packages.

Edit: fuck.

Last edited by seth (2020-11-15 08:27:45)

Offline

#21 2020-11-15 08:49:34

fire100265
Member
Registered: 2020-10-05
Posts: 95

Re: [SOLVED] I messed up permissions in /usr

Thanks for the replies. I have another error. This happens:

...
Proceed with installation? [Y/n] #

Why is there a hash there? I can't install the packages because of it.

Offline

#22 2020-11-15 08:57:16

seth
Member
Registered: 2012-09-03
Posts: 51,056

Re: [SOLVED] I messed up permissions in /usr

Fat finger problem?

The hash is next to the enter key, you might have pressed it inadvertently.

Offline

#23 2020-11-15 08:58:23

fire100265
Member
Registered: 2020-10-05
Posts: 95

Re: [SOLVED] I messed up permissions in /usr

It was highlighted in white. I couldn't type in the proceed field.
Edit: On my keyboard hash is nowhere near enter.

Last edited by fire100265 (2020-11-15 08:59:41)

Offline

#24 2020-11-15 09:02:53

seth
Member
Registered: 2012-09-03
Posts: 51,056

Re: [SOLVED] I messed up permissions in /usr

I assume this is a root shell and the hash is the prompt then?
Did you somehow fork any of the pacman commands (ie. put an ampersand "&" somewhere)?

Offline

#25 2020-11-15 09:05:07

fire100265
Member
Registered: 2020-10-05
Posts: 95

Re: [SOLVED] I messed up permissions in /usr

Yeah I was prompted to answer Yes or No and the hash was there. I wrote the exact command GaKu999 posted. I didn't add anything else.

Offline

Board footer

Powered by FluxBB