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 just finished installing Debian 8 (Jessie) and tried to make a directory in lib/firmware, because there was a file missing (rtl8723befw.bin) in the installation, and it says

mkdir: cannot create directory rtlwifi: Permission denied

I tried putting sudo on the front, but then it returns:

bash: sudo: command not found

When trying to install sudo with apt-get install sudo or even apt-get update it returns:

E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?

I am really at a loss of what to do. All the solutions that I seem to find for the latest error is to use sudo, but I don't even have that.

share|improve this question
    
    
I never even use sudo. Always su -c. – Mr Lister 39 mins ago

If you do not have sudo installed, you will need to actually become root. Use su - and provide the root user's password (not your password) when asked. Once you have become root, you can then apt-get install sudo, log out of the root shell, and actually use sudo as you are trying to, now that it will have been installed.

share|improve this answer
    
When making sudo mkdir rtlwifi it returns mariel is not in the sudoers file. This incident will be reported. – Mariel 15 hours ago
    
cant edit but the sudo is part of the first code obviously – Mariel 15 hours ago
3  
Become root again, and add yourself to the wheel group. Also use visudo to make sure that the configuration to allow anyone in the wheel group to use sudo is not commented out. – DopeGhoti 15 hours ago
2  
The sudo group serves the same purpose. – DopeGhoti 14 hours ago
2  
adduser yourusername sudo - note that group membership really doesn't change until you completely log out of all sessions/logins – ivanivan 14 hours ago

As an alternative to given answers, if you do not know the root password to allow you to use su, you can boot to single user mode.

At the grub menu, press e to edit the boot command line. Near the end of the line beginning linux add the word single, and continue the boot. You will be placed at a root prompt and can reset the root password so that you can use su on the next normal boot.

share|improve this answer

Become root, run su, give your root password, and then run:

apt install sudo

To grant administrative privileges to Mariel, run visudo command as root, and then edit your file as follows:

# User privilege specification
root    ALL=(ALL:ALL) ALL
Mariel  ALL=(ALL:ALL) ALL

Log in as user Mariel. You will be able to run sudo without problems.

share|improve this answer

Your Answer

 
discard

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.