Someone who has any idea of why and how to fix this error?
and after executing the commands of the end
dpkg --configure -a
shows the following
First try doing the following:
sudo dpkg-reconfigure grub-pc
then select the correct disk (/dev/sda/) when prompted. In that way, if the error does come back again try the following solution:
sudo grub-install /dev/sda
then
sudo update-grub
Related
I'd like to enable passwordless sudo for sudo apt update, and also have passwordless sudo work for the apt update command when I run it with options like sudo apt update -q and sudo apt update -qq.
I have the file /etc/sudoers.d/apt with these contents:
%sudo ALL=(root) NOPASSWD: /usr/bin/apt update
This gives me passwordless sudo for sudo apt update, but passwordless sudo fails when I call the command with an option such as sudo apt update -q.
I know I can account for options by listing out each one in /etc/sudoers.d/apt, but I'd prefer something which will work for all available options without me needing to foresee which ones I might want to use in the future.
I can not test it right now, but according to the link, you could use wildcards:
%sudo ALL=(root) NOPASSWD: /usr/bin/apt update *
Again, I could no test it - Be careful as always, when you edit the suders file.
Source: https://www.sudo.ws/docs/man/1.7.10/sudoers.man/#Wildcards
The most robust way that I can see to do this is:
%sudo ALL=(root) NOPASSWD: /usr/bin/apt update, /usr/bin/apt * update, /usr/bin/apt update *
The /usr/bin/apt update makes the basic command sudo apt update passwordless.
The /usr/bin/apt * update makes adding an option first like sudo apt -q update passwordless.
The /usr/bin/apt update * makes adding an option last like sudo apt update -q passwordless.
All of these are needed to handle the different ways the command might be called, and the different possible placements of options in the command.
Credit to Tobias' answer for pointing me in the right direction on this.
I get the below response on trying to view manual for any command
No manual entry for <<command>>
On $ echo $MANPATH, It says
.:/usr/local/man:/usr/man
$ echo $PATH gives the following result
/usr/local/bin:/mis/TREE/bin:/usr/bin:/bin:/usr/ucb:/proj/blade/tools/bin
and on $MANPATH= man -w man it says
MANPATH=: Command not found.
What could be the issue? How to resolve this?
I am on Enterprise Linux 7 (Maipo).
if you have installed man-pages by
sudo yum install man-pages
, then do
sudo yum update
I was trying to install wireshark when I accidentally had to restart my computer. Now I am stucked in a infinite login loop in Ubuntu. I tried to do something from the bash but every time I try to run a sudo command, as sudo su it gets:
-bash: /usr/lib/command-not-found: /usr/non/python3: bad interpreter: permission denied.
I tried to change the permission to that but it does not work.
EDIT:
i solved by entering in recovery mode as root user and sudo chmod 777 /usr/lib/command-not-found and even sudo chmod 777 /usr/bin/python3. I tried everything possible, and i dont even know why it worked.
Try this
sudo dpkg -i python2.7-miminal*.deb
sudo dpkg -i python2.7*.deb
I ran into the same problem when I have added export $PATH="~/bin" as last line in ~/.bash_profile.
I solved it by removing the line after entering into tty2 command line using "ctrl + alt + F3" and all commands like "ls, cd, nano" where available as "/bin/ls, /bin/cd, /bin/nano".
Using command "/bin/nano ~/.bash_profile" I changed the file content and now it's working normally.
I am trying to understand this docker file
FROM ubuntu:trusty
MAINTAINER Wurstmeister
RUN apt-get update; apt-get install -y unzip openjdk-7-jre-headless wget supervisor docker.io openssh-server
ENV JAVA_HOME /usr/lib/jvm/java-7-openjdk-amd64/
RUN echo 'root:wurstmeister' | chpasswd
RUN mkdir /var/run/sshd
RUN sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' /etc/ssh/sshd_config
EXPOSE 22
I understood most of the lines but I don't understand what these below lines means?
apt-get install -y unzip openjdk-7-jre-headless wget supervisor docker.io openssh-server
echo 'root:wurstmeister' | chpasswd
sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' /etc/ssh/sshd_config
Can anyone help me understand? I am not sure what is the purpose of wget supervisor docker.io openssh-server in that line. Also what does echo mean there? And then also last sed line.
apt-get install -y unzip openjdk-7-jre-headless wget supervisor docker.io openssh-server
Installs a bunch of packages using the ubuntu package manager (the base image is Ubuntu Trusty 14.04).
The -y option is used to prevent apt from asking user confirmation about installing the packages and their dependencies: the installation just proceeds without need for any input. This is needed to avoid hanging the process of building the docker image. Packages installed:
openssh-server: so that the container can act as an ssh server and process requests from ssh clients
wget, unzip: utilities
java: eventually this container is used to allow users to access it via ssh, maybe those users need java
supervisor, docker.io: I don't see a direct usage of it in the Dockerfile itself
then
echo 'root:wurstmeister' | chpasswd
Changes password of user root to wurstmeister
sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' /etc/ssh/sshd_config
Replaces the text PermitRootLogin without-password with PermitRootLogin yes in file /etc/ssh/sshd_config to allow root user to login with password or without (e.g., with public key).
An important general note: If you run SSHD in your Docker containers, you're doing it wrong!
wget supervisor docker.io openssh-server are parameters to the apt-get call. Those are the names of the packages to be installed.
echo is used in combination with | to send the new password to the chpasswd command.
sed is used to update some text in a configuration file (here to allow passwordless login). The s/text/newText/ part does text substitution.
After following this tutroial I get the following error when trying to run the commands as user or even sudo:
sudo: no tty present and no askpass program specified
The comments from Lurdan in this article state that you need to run
sudo -S <YOUR_COMMAND>
chmod 0666 /dev/tty
chmod doesn't work but sudo -S does, but surely there's another fix?
So silly, after looking further down I see a solution from Beorat:
To avoid the sudo tty issue and others, run these commands just before running do-release-upgrade:
sudo -S apt-mark hold sudo
sudo -S apt-mark hold procps
sudo -S apt-mark hold strace
If you've already upgraded, run the above commands, then manually downgrade to the Trusty packages:
sudo -S wget http://mirrors.kernel.org/ubuntu/pool/main/s/sudo/sudo_1.8.9p5-1ubuntu1.1_amd64.deb
sudo -S wget http://mirrors.kernel.org/ubuntu/pool/main/p/procps/procps_3.3.9-1ubuntu2_amd64.deb
sudo -S wget http://mirrors.kernel.org/ubuntu/pool/main/s/strace/strace_4.8-1ubuntu5_amd64.deb
sudo -S dpkg -i sudo_1.8.9p5-1ubuntu1.1_amd64.deb
sudo -S dpkg -i procps_3.3.9-1ubuntu2_amd64.deb
sudo -S dpkg -i strace_4.8-1ubuntu5_amd64.deb
More info here: https://github.com/Microsoft/BashOnWindows/issues/482
WSL uses the lxrun executable for management from Windows:
lxrun -h
Usage:
/install - Installs the subsystem
Optional arguments:
/y - Do not prompt user to accept
/uninstall - Uninstalls the subsystem
Optional arguments:
/full - Perform a full uninstall
/y - Do not prompt user to accept
/setdefaultuser - Configures the subsystem user that bash will be launched as. If the user does not exist it will be created.
Optional arguments:
username - Supply the username
/y - If username is supplied, do not prompt to create a password
/update - Updates the subsystem's package index
Given that, you can use lxrun /setdefaultuser root. Just thought I'd point out this side of it since it was required when I ran into the same issue as you after trying to upgrade to Xenial. I can confirm that running this command, then the wget / dpkg commands my issues were resolved.
The commands I used:
wget http://mirrors.kernel.org/ubuntu/pool/main/s/sudo/sudo_1.8.9p5-1ubuntu1.4_amd64.deb
wget http://mirrors.kernel.org/ubuntu/pool/main/p/procps/procps_3.3.9-1ubuntu2_amd64.deb
wget http://mirrors.kernel.org/ubuntu/pool/main/s/strace/strace_4.8-1ubuntu5_amd64.deb
dpkg -i sudo_1.8.9p5-1ubuntu1.4_amd64.deb
dpkg -i procps_3.3.9-1ubuntu2_amd64.deb
dpkg -i strace_4.8-1ubuntu5_amd64.deb
Finally, you might need to run sudo apt-get install -f in case you get The following packages have unmet dependencies [xxx] but it is not going to be installed
I got rid of the error by moving /etc/hosts to /etc/hosts.bu. After closing the shell en opening again, /etc/hosts is recreated and your computer name is added. The error is gone (for me.)