0

I am having a problem with my sudo command in my ubuntu, that is because I think I had run the permission command on my computer directory. I found that on the internet everybody is saying that in this situation we have to reinstall the ubuntu. What if I update my ubuntu from 16.04 to 18.04, would it be ok or would it remove my issue?

Thank you.

  • 1
    Take a try, then share the consequence. – Ipor Sircer Nov 29 '18 at 6:29
  • Reinstalling can be any version; you're basically starting over with a clean slate that doesn't reflect things you might have messed up. – fixer1234 Nov 29 '18 at 6:56
  • @fixer1234 so should I reinstall or update? – shashi verma Nov 29 '18 at 7:10
  • When people say "update" one major release to another major release, it's an upgrade or reinstallation. If you're fluent in Linux, you can upgrade, but it isn't always a clean, simple process because of how much changes between major releases. I'm also not sure if upgrading replaces all of the configuration files, especially user files like the .d files. Reinstalling is safer and cleaner because you're starting with a fresh setup, with everything set to the distro defaults. – fixer1234 Nov 29 '18 at 7:24
1

That's why what Ubuntu is doing with root account is not very smart - once sudo breaks you are out of options.

But - you can try to boot in single user mode. If you are lucky it will let you in without password. Adding 1 or single to kernel command line should do the trick. If this does not work try passing init=/bin/bash (or whatever shell you have installed) to kernel command line. Once in a shell fix permissions on /etc/sudoers.d (my system has 750 on it) and you should be good to go. Reboot and enjoy.

Once you are back to your normal login, do sudo su - and set root password! Save it somewhere and next time just login or su to root and fix whatever is needed.

0

Upgrade to 18.04 probably won't help.

Upgrade is performed by changing package repositories to newer ones and installing new set of packages. Some packages will remain, though, and may still have broken permissions.

The only safe method of restoring this system is wiping it clean and installing from scratch. Unless you have backups, of course, but if you had, you wouldn't be asking this question.

The lesson to learn here is that you should be making regular backups.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.