Page 1 of 1

"sudo" command does not work...

Posted: Wed Jun 07, 2017 7:17 pm
by JacobEndure
Hi Guys,

I have been running Home Assistant on my Raspberry Pi for months now and all was good. So, I tried to update HA and I
got some errors related to access permissions not set properly. Anyway, I used "chmod" command to change some permissions
and all hell broke and now my "sudo" command does not work. :oops:

I get the error:
sudo: error in/etc/sudo.conf, line 0 while loading plugin 'sudoers_policy'
sudo: /usr/lib/sudo/sudoers.so must be only be writable by owner

How do I fix this problem? Please help :oops:

Thanks,
JG

Re: "sudo" command does not work...

Posted: Thu Jun 08, 2017 11:05 am
by pi_everalm
Assuming you remember the permissions you changed, su to "root", reset permissions and reboot....

Re: "sudo" command does not work...

Posted: Thu Jun 08, 2017 12:18 pm
by RaTTuS
what sudo chmod command did you do

Re: "sudo" command does not work...

Posted: Thu Jun 08, 2017 12:29 pm
by Martin Frezman
This never ends well. You always end up re-installing Raspbian.

It's the only real solution.

Re: "sudo" command does not work...

Posted: Fri Jun 09, 2017 3:37 am
by JacobEndure
RaTTuS wrote:what sudo chmod command did you do
Since I was getting some errors when trying to do and update of HA ( it could not update certain /etc/lib etc.) I did a
sudo chmod -R 777 /etc/lib and other dir's it complained about. I did not think that changing permission would do any
harm. How can I restore the permissions now, and to what? The funny thing is that much of the Home Assistant, mosquito
and Node-RED works fine...I am not to very good with Linux. Will su reboot help restore the permissions?

Thanks,
JG

Re: "sudo" command does not work...

Posted: Mon Jun 12, 2017 7:21 am
by RaTTuS
restart again with a fresh Raspbian install -
you have cabbageded somethings that need not be done a fresh start will help and you will learn more

Re: "sudo" command does not work...

Posted: Mon Jun 12, 2017 12:20 pm
by Martin Frezman
Yes, as I said upthread:
This never ends well. You always end up re-installing Raspbian.

It's the only real solution.

Re: "sudo" command does not work...

Posted: Mon Jun 12, 2017 9:37 pm
by lerner
Hi Jacob.

One thing I can see which could be "problematic" is HOW you are updating the program.

Just in case you are/were not sure:

when you want to update a package, you don't update it as "pi".

sudo apt-get update
sudo apt-get upgrade

These two commands are needed to be done as shown.

Other people can tell you how to update specific packages. I am still learning.

But I would guess it would be along the lines of:

sudo apt-get update <package>
sudo apt-get upgrade <package>


Hey, I'm not sure and I admit it.

There are quirks with linux and if you are not well versed with it, it can be problematic getting things done.

Hope all goes well in the future.

Re: "sudo" command does not work...

Posted: Mon Jun 12, 2017 11:28 pm
by Paeryn
lerner wrote:But I would guess it would be along the lines of:

sudo apt-get update <package>
sudo apt-get upgrade <package>
update and upgrade don't take package names.

Code: Select all

sudo apt-get update
just updates apt's database of available packages.

Code: Select all

sudo apt-get upgrade
upgrades all packages that can be upgraded so long as for any package, if it would require uninstalling another package or require another package that isn't already installed then that package will not be upgraded.

Code: Select all

sudo apt-get dist-upgrade
will attempt to upgrade all packages including installing/uninstalling other packages if necessary.

If you want to upgrade a specific package you can just ask apt to install it,

Code: Select all

sudo apt-get install <package>