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.