JacobEndure
Posts: 2
Joined: Wed Jun 07, 2017 7:02 pm

"sudo" command does not work...

Wed Jun 07, 2017 7:17 pm

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

pi_everalm
Posts: 33
Joined: Thu Apr 20, 2017 11:44 am

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

Thu Jun 08, 2017 11:05 am

Assuming you remember the permissions you changed, su to "root", reset permissions and reboot....

User avatar
RaTTuS
Posts: 10531
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

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

Thu Jun 08, 2017 12:18 pm

what sudo chmod command did you do
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

Martin Frezman
Posts: 1020
Joined: Mon Oct 31, 2016 10:05 am

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

Thu Jun 08, 2017 12:29 pm

This never ends well. You always end up re-installing Raspbian.

It's the only real solution.
If this post appears in the wrong forums category, my apologies.

JacobEndure
Posts: 2
Joined: Wed Jun 07, 2017 7:02 pm

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

Fri Jun 09, 2017 3:37 am

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

User avatar
RaTTuS
Posts: 10531
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

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

Mon Jun 12, 2017 7:21 am

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
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

Martin Frezman
Posts: 1020
Joined: Mon Oct 31, 2016 10:05 am

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

Mon Jun 12, 2017 12:20 pm

Yes, as I said upthread:
This never ends well. You always end up re-installing Raspbian.

It's the only real solution.
If this post appears in the wrong forums category, my apologies.

lerner
Posts: 508
Joined: Sun Mar 29, 2015 12:12 am

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

Mon Jun 12, 2017 9:37 pm

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.

User avatar
Paeryn
Posts: 2800
Joined: Wed Nov 23, 2011 1:10 am
Location: Sheffield, England

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

Mon Jun 12, 2017 11:28 pm

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>
She who travels light — forgot something.

Return to “Beginners”