I've recently installed Ubuntu 12.04 it was working fine unless I messed up with a command. I change all user permissions(as they call ago permission in Ubuntu) by running command sudo chmod -R 777 /
. Now system won't detect any external devices like USB or any internal hard disk,but strangely it detect my mouse and keyboard. And system is also not able to recognize any wired connection. By using chmod
I think I messed up with admin
privileges and sudo
command won't work.Is there
Any other solution other than re-installing the whole OS? Can I restore my system in previous mode by any command?
1 Answer
No. You need to reninstall. Your permissions are all screwed up now and the only way to fix them all is to reinstall ubuntu.
You can however, keep all the data in your home folder (always make a backup first!). During installation, select something else when you get to the part that asks if you want to install ubuntu along side.
Then, right click on the ubuntu partition, set the format to ext4 and the mountpoint to /.
Click ok and UNTICK the box that says "format" before proceeding with the rest of the installation.
This will install ubuntu without formatting the drive and will only write over system files leaving your home folder untouched.
As neon_overloard pointed out, you will still have to manually fix a few permissions in your home folder.
-
unlike apple, there is no fix-permissions app that i know of for regular linux– mchidMar 1, 2015 at 21:31
-
2The messed up file permissions in the home folders may still be a problem for some things like .ssh, maildirs, etc. Mar 2, 2015 at 0:29
-
@neon_overload good point, although seems reasonable that these could be manually fixed.– mchidMar 2, 2015 at 2:53
-
Remember that data should be backed up before reinstall. Related: askubuntu.com/q/142925/40581 Mar 2, 2015 at 12:31
sudo chmod -R 777 /
... oh the humanity! Next tosudo rm -Rf /
the easiest way to trash a system in a way that can't be recovered except by reinstall.