Score:0

I have recursively changed the ownership of /usr

cn flag

Okay my first time asking here because I can't find a similar question and probably wrecked my OS, so I need urgent help.

Today in the morning I've tried to install the Robust Control Toolbox in MATLAB, but as a common error I've got "unable to write to /usr/bin/MATLAB" or something like that. So I decided VERY, VERY STUPIDLY that I need to change the ownership of that folder.

After a while of searching and relearning chown, I again VERY VERY STUPIDLY made a mistake and run sudo chown --recursive bays /usr instead of something less harmful like sudo chown --recursive bays /usr/bin/MATLAB where bays is me, which is the only user.

I managed to install the toolbox, and after a while the system was very slowed down, so I decided to restart.

Everything booted perfectly except there was no Wi-Fi adapter seen by the system. So I've rebooted several times and searched another solution, someone suggested to run sudo lshw -C network which my terminal replied with sudo: /usr/bin/sudo must be owned by uid 0

I tried the solution in https://askubuntu.com/a/471503/1548977 but added two lines:

mount --all
chown root:root /usr/bin/sudo
chown --recursive root /usr <- this line
chmod 4755 /usr/bin/sudo
chmod --recursive 4755 /usr <- this line too
restart

After that, I couldn't boot neither normally, nor in recovery mode...

At this point, I'm pretty sure I need to reinstall, but just being able to rescue what I have in /home would be a blessing.

vanadium avatar
cn flag
Forget about it and reinstall. This is a fatal error. I bet it would have worked if you restored the ownership of /usr to root. However, for reasons unclear, you also decided to change permissions (`chmod`), so forget it and reinstall, wiping the havoc you created.
cn flag
start up a live session and reinstall WITHOUT formatting. Only mount all the partitions. It will leave personal files alone but reset all permissions of the system files. "but just being able to rescue what I have in /home would be a blessing" you can do that with the live session too prior to installing
furkan_baysal avatar
cn flag
i have changed permissions because the post i have linked told to change permissions... i thought of a live session from usb and then thought about plugging in a hard drive to back up my files, will it work? should i manually back up or use the back up utility?
user535733 avatar
cn flag
You should backup your files using whatever method will enable you to successfully and reliable restore those files onto the new system. If you inexperienced with the backup utility, this is the wrong time to try to learn it. Advice: Try backing up using BOTH methods. Nobody ever complained about having too many backups available during a crisis.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.