I did the command by accident whilst trying to fix things not being able to upload files anywhere and now some of my software is refusing to open, including the software centre itself, I'm newish to Ubuntu so I'm not super sure of what I'm doing, definitely learning by my mistakes a bit
Asked
Active
Viewed 498 times
1 Answers
4
Doing what you did has effectively has broken your system in an irreparable way. Given that you admittedly are 'newish' to Ubuntu, then you'll have to reinstall to fix the permissions. (To fix the permissions manually will be a days-on-end process and will take a LOT more knowledge than you have about Ubuntu, and it is effectively faster for you to reinstall than try to fix the issue.)
NEVER run recursive chmod on the root - it's basically making your life hell, and on this site there's no way to restore your system to working without a reinstall.
And unless you really understand what a command does, don't randomly execute commands with sudo
access.

Thomas Ward
- 74,764
-
And I would add NEVER on systems' folders, and in /home very carefully. – schrodingerscatcuriosity May 02 '20 at 21:11
-
1Yeah, I thought I might have messed up doing it, thankfully I had only just installed it earlier today so it's not as if I've lost alot of progress, I'm going to have to ask alot of questions on here as I'm having alot of problems with this at the mo – drneroli May 02 '20 at 21:13
-
I have to admit I find this answer - with the exception of the last sentence (which should include
sudo
and/or superuser, though) - a mit meager. In my mind I can come up with two ways to restore the file modes in an instant (use info from.deb
files, use a cloud image as template for the correct file modes). Whether they're practical for a newbie is another question, similarly whether the effort is worth it (which would depend on the circumstances), but perhaps that's what your wording with "effectively" is meant to suggest? – 0xC0000022L May 02 '20 at 21:26 -
@0xC0000022L unfortunately, a 'cloud' image only works if they haven't installed other things on their systems. There is no way to really restore every application's settings to the correct state even with a cloud image or .deb files because that's a very tedious and many days long process, and since they changed the permissions on
sudo
and other directoriessudo
won't work properly anymore either. Effectively making it impossible to fix that problem. – Thomas Ward May 02 '20 at 21:42 -
@ThomasWard fair enough, so that is what you meant by effectively.
apt-mark
anddpkg --get-selections
options to figure out what was added over a default installation, and unless configuration management is used,debsums -ce
can be used to survey the changed configuration files. So indeed it's likely faster for the OP to reinstall (also given the OPs statement ;)). – 0xC0000022L May 02 '20 at 21:49
.deb
files). I suggest you restore from a backup or backup your data and reinstall. In future you may want to consider the use of the mnemonic form of the file modes. There are things that numeric (octal) file modes can't even express, for example+rwX
. So this helps being more aware of what you're doing. Also when usingsudo
always make sure to stop and think about what you're doing. – 0xC0000022L May 02 '20 at 21:17find
with the-type
predicate to executechmod
on files or folders with different modes. However, you could also use the uppercaseX
mnemonic file mode and be done with it. As it means "setx
for directories only". – 0xC0000022L May 02 '20 at 21:21