After I removed an app with purge, I cannot use sudo or apt-get any more and get this error.   -bash: /usr/bin/sudo: No such file or directory   Do you have any suggestions?   version: Ubuntu 16.04
777
This seems to be a chicken-egg problem. The most common task using sudo is installing and removing software.  sudo apt-get purge &lt;appname&gt;   But sudo itself can be removed.  sudo apt-get purge sudo # Do not run this command on production computers!   This is where the fun comes  ubuntu@ubuntu:~$ sudo bash: /usr/bin/sudo: No such file or directory   Although it's obvious that no person in his right mind will purge sudo (other than me), someone can be fooled to run this command (not directly, in its hex mode, or whatever it's called) or a person could SSH in disguised as tech guru and do the mess.  So is there a way of reinstalling sudo?
11958
I have been using Ubuntu 12.04 for quite a while and have never had a problem come at me out of the blue like this. I'm trying to install python 3.2 on my Ubuntu system and every time I run the code to compile the python source, I get this error:  'Command 'sudo' is available in '/usr/bin/sudo' The command could not be located because '/usr/bin' is not included in the PATH environment variable. sudo: command not found'   I've also tried running gksudo command to view what my environment shows but I pretty much get the same error.
93268
I was doing some experiment about resource-accessing. By mistake, I executed this command, $ sudo mv /etc/passwd /etc/passwd.bak Then I could not execute any command with privilege(eg. sudo mv /etc/passwd.bak /etc/passwd). When I shut the system down, I could not boot it any more. Afterwards, I restored the passwd file with a LiveCD.  Any other approaches could make it?
116496
I've followed the instructions, but I have this back in my terminal:  ./u1_downloader bash: ./u1_downloader: cannot execute binary file: Exec format error   What am I doing wrong?
62175
I know this is something I shouldn't do, but it happened(Ubuntu 12.04.1 LTS) as a root user I deleted /usr/lib folder. Any ideas how to restore it?
36394
I stupidly ran sudo chown -R carlos:carlos / and carlos is my user. This changed all files to be Carlos and I could not boot up again (because the root files were now owned by #1000) and I cant get sudo acess in live cd (because the owner of /usr was changed to my user). Can anyone help me? FYI I have mounted my hard drive.
4844
I accidentally executed      sudo chmod -R 777 /   I was actually trying to change a specific folder permission recursively, btw i did stop the command before it changed everything.  But now, i can't execute for example      sudo   Every time i try to sudo something it throws me this error:     effective uid is not 0, is sudo installed setuid root?   Btw i know i can use chown -R root:root /usr/bin where sudo is located, but of course i don't have the permissions to do this.  So, how can i revert this process? Or at least save the sudo file without reinstalling everything?  The system is still connected to the internet and seems to work fine besides the sudo issue.  Thanks in advance.
19080
Of course when you type:  sudo apt-get install whatever   It asks you:   Do you want to continue [Y/n]?    Is there any way I can just install it without it asking me if I want to continue? I don't really care about space, I have more then enough.
65697
I accidentally executed the following command on the etc directory:  sudo chmod -R 700 /etc   I know that I have done something very wrong. My terminal now prints:  I have no name!@ubuntu: /$   How can I revert my etc directory to its earlier state?  I tried changing the permissions but it is failing now. Also, it would be very helpful if someone can explain what actually went wrong when I executed that command on etc. It was only file permissions. Then why does the whole system seems completely blown up? Why is it that no login passwords are working now? I know that there is a file in etc directory that has to do with users. But how did changing permissions jeopardize everything? Some technical details about this would be very helpful.
76595
I accidentally used  sudo chmod 3 /   which gives a execute and write permission to the root directory, while deleting the read permission. How can I recover from this, I cannot even use sudo now.
117411
Is sudo aptitude purge ubuntuone? sufficient to remove everything Ubuntu One-related from my system?
100150
I know that I can use apt-get remove &lt;package&gt; to remove a program.  But apt is a program itself. Could I use apt-get remove apt to remove it, or would it get confused part way through?
6272
I've read  and am interested in this line:     You should never use normal sudo to start graphical applications as Root.   Why? What is the difference? Please provide a simple explanation, as I'm just a normal desktop user.
2558
When I try to sudo apt-get upgrade I get:  Preconfiguring packages ... dpkg: error: unable to create new file '/var/lib/dpkg/info/format-new': No such file or directory E: Sub-process /usr/bin/dpkg returned an error code (2)   What should I do to fix it?
23594
To run programs as sudo without password, I edited /etc/sudoers with wrong content.   Then I re-edited it with Mac's default text editor(course sudo cannot be used when /etc/sudoers is wrong).  I tried to run sudo agin, and get this error:   sudo: /etc/sudoers is owned by uid 501, should be 0 sudo: no valid sudoers sources found, quitting   What should I do? I cannot remember the root password (maybe I haven't ever set root password before).
34700
The last time I used sudo apt-get autoremove, nearly every important display driver or parts got deleted. This made me very squeamish about using the command again. However, each time I install something or use apt-get update the terminal reads:   The following packages were automatically installed and are no longer required:   devilspie libturbojpeg:i386 libxrandr-ltsr2 language-pack-kde-en   kde-l10n-engb language-pack-kde-en-base libxv1:i386 libllvm3.2   libllvm3.2:i386 linux-generic-lts-raring Use 'apt-get autoremove' to remove them.     I tried the command clean and the messages stops displaying for a while. My question is whether it's safe running the autoremove command, or will I lose everything once again? Is there a way of checking how safe it is to use autoremove in this particular (or any) case?
101024
I'm trying to update to node 7.x through the terminal on my raspberry pi and I keep encountering this error. The command I'm using is:  sudo curl -sL https://deb.nodesource.com/setup_7.x | bash -   Running this command as root doesn't work so I tried to see if apt-get was being used by any other processes.   ps aux | grep apt pi        1295  0.0  0.1   4272  1848 pts/0    S+   06:24   0:00 grep --color=auto apt   This is all I get. Ultimately, (although it was initially advised not to do so), I tried removing the files and running the command again.  sudo rm /var/lib/apt/lists/lock &amp;&amp; sudo rm /var/lib/dpkg/lock   Now neither one of these files no longer exists and I still receive the same error when trying to use curl. I also tried to kill that one process and I still get the error.