Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to install a module using apt-get.

For that I do the following:

sudo apt-get install

But I get the following error:

sudo: can't stat /etc/sudoers: No such file or directory
sudo: no valid sudoers sources found, quitting

I have been trying to Google the answer but can't find any solution to the problem.

How can I solve this error?

share|improve this question
up vote 2 down vote accepted

sudo relies on a database of allowed users and actions in /etc/sudoers. This error occurs because this file does not exist, so sudo doesn't know who is authorized to do what.

You need to recreate /etc/sudoers with a valid configuration. Assuming you want to authorize users in group "sudo" to elevate to root, this would work (as root):

cat > /etc/sudoers << 'EOF'
root ALL=(ALL) ALL
%sudo ALL=(ALL) ALL

If you can't get a root shell any other way, or your root password is disabled, perhaps the easiest way to do this is to reboot, set init to your shell, then reboot again. For example, with GRUB 2, hit e at the bootloader to edit your menu entry, add init=/bin/bash to your kernel parameters, press F10 to boot, and run the above command from the shell that appears.

share|improve this answer
I can't become root by typing su. it says 'authentication failure'. But I can create directories with 'sudo mkdir somedirectory' for instance and my password gets accepted then. – Hermann Ingjaldsson Feb 8 '13 at 11:40
My favourite: sudo su - – Munhitsu Feb 8 '13 at 11:52
@jofel You can't do sudo foo if /etc/sudoers is missing... also you should not be doing those, it screws with the environment. Use sudo -i or sudo -s as appropriate. – Chris Down Feb 8 '13 at 12:49
@ChrisDown Ok, my comment was not very clever (I deleted it). Why seems sudo mkdir work for Hermann Ingjaldsson if there is no /etc/sudoers file? – jofel Feb 8 '13 at 14:54

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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