Recovering Ubuntu after apt-get upgrade failed - firefox

I was trying to install Firefox 5 using these commands -
sudo add-apt-repository ppa:mozillateam/firefox-stable
sudo apt-get update
sudo apt-get upgrade
The upgrade was happening, but I accidently killed the process, and Firefox 5 was up, so I didn't bother then. But the next time I restarted the system, I was stuck at the login screen. How can I recover it ?

You might have some broken packages. To check, press CTRL-ALT-F1 to go into TTY1 (note: CTRL-ALT-F7 gets you back to the GUI) and login using your credentials.
Now, run:
sudo apt-get install -f
It should give you more info about what's wrong.
Because you didn't provide any error logs or anything, we can't help you much...

Related

For root access composer not found in centos 7

I installed composer in centos 7.
When I logged in with centos user, if I hit composer -v, it shows that composer is installed.
But after I switch to root access with sudo su, if I hit composer -v, it displays not found.
Can anyone help me? What should I do now?
What you describe are the symptoms of non-packaged install.
If something is available from packages, you should strive to install it using packages where available.
sudo yum install epel-release
sudo yum install composer
# have no problems, have a cup of coffee

Mouse and Keyboard not working after reinstalling ubuntu-desktop

At first I got an error message,when I booted my system.
The system is running in low-graphics mode.Your screen, graphics cards, and input device settings could not be detected correctly. You will need to configure these yourself.
I pressed Ctrl +Alt+F1 and entered into terminal .Then I did the following commands.
sudo apt-get update
sudo apt-get remove ubuntu-desktop
sudo apt-get install ubuntu-desktop
sudo shutdown -r now
But after that ,even though error message was not showing when rebooted , my laptop's keyboard and mouse were not working.But external keyboard and laptop worked.My current Ubuntu version is 16.04 LTS.
Try installing the xserver-xorg-input-all package.
$ sudo apt-get install xserver-xorg-input-all

Shell driver install with `ACCEPT_EULA=Y` error

As described here, I am trying to install the following driver in shell, using this code (modified from the original slightly):
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
curl https://packages.microsoft.com/config/debian/8/prod.list | sudo tee /etc/apt/sources.list.d/mssql-release.list
sudo apt-get update
sudo ACCEPT_EULA=Y apt-get install msodbcsql17
But I get an error on the last command:
sudo: sorry, you are not allowed to set the following environment variables: ACCEPT_EULA
After searching, I can't seem to find this exact error anywhere else.
One solution is to run the last command without ACCEPT_EULA=Y as sudo apt-get install msodbcsql17. And then to enter Y at the prompt. This indeed works but I would like to run the above installation for other users without need of their input.
Is there a way to resolve the above error so I can use ACCEPT_EULA=Y, or
alternatively is there a simple way to enter the Y response for the EULA
automatically so the end user never needs to take any action?
Thank you in advance.
You appear to have access to run arbitrary commands, but not to modify the environment.
The simple workaround is to hand off environment changes to the command:
sudo env ACCEPT_EULA=Y apt-get install msodbcsql17
I don't have enough rep to post a comment.
But I was doing the same install for pyodbc inside a python:3 docker container.
In the dockerfile the following command works:
ACCEPT_EULA=Y apt-get install -y msodbcsql17
(I was after this particular driver #17.)
Reading: https://github.com/microsoft/mssql-docker/blob/master/oss-drivers/pyodbc/Dockerfile can help see the environment set up from a base ubuntu (ubuntu:16.04) box.
Also check up on: https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-2017
for microsoft first hand docs.
The ACCEPT_EULA=Y apt-get install -y msodbcsql17 command above did the trick for me as I was trying to set up msodbcsql17 via a Dockerfile.

Heroku CLI suddenly broken

Suddenly, from one command to the next, the Heroic CLI stopped working. No matter what I type into the command line, I get the same error. See below.
$heroku help
▸ commands is not a heroku command.
▸ Perhaps you meant domains
▸ Run heroku help for a list of available commands.
! error getting commands pid 24643 exit 127
What the heck is going on?
this problem just happened with me after the last update of heroku CLI,
heroku CLI check if there is updates after execute any command related with and when run updates the problem occurs because is not working with root permissions.
to fix this you need to reinstall heroku CLI
sudo apt-get remove heroku
sudo add-apt-repository "deb https://cli-assets.heroku.com/branches/stable/apt ./"
curl -fL https://cli-assets.heroku.com/apt/release.key | sudo apt-key add -
sudo apt-get update
sudo apt-get install heroku
and you probably need to add this path
PATH=$PATH:~/usr/bin
export PATH
This just happened to me. I fixed it by removing the heroku app the same way i installed it. I had the gem installed, so i uninstalled that.
gem uninstall heroku
Then i used homebrew to reinstall it.
brew install heroku
and it worked.
Something similar (although with a different error message) happened to me after updating my OS. On a Mac, make sure to install the CommandLineTools (with Xcode) after a major OS update!

Linux server sudo command not found

I am having Linux server with
2.6.32-673.8.1.lve1.4.3.el6.x86_64 - GNU/Linux
and trying to run following commands :
sudo apt-get update
-bash: sudo: command not found
I have also tried - sudo su
-bash: sudo: command not found
And for lsb_release -a
-bash: lsb_release: command not found
I am trying to install ruby. Any help is highly appreciated.
sudo is in its own package. You probably don't have it installed, so you'll have to login as root and install it.
Sadly, just showing the kernel version doesn't help much, so see if this returns anything: cat /etc/*-release
If it does, you could be using something like CentOS or any other flavor of linux, so apt-get may not work anyway.
Hopefully, you are logging in with root if sudo isn't available. Running whoami should let you know your username if you are not sure.
If you are root, then try (for CentOS) yum install sudo to get sudo or just yum install ruby to install Ruby. If yum is not found, then try apt-get. If that still doesn't work, then you could be using a system with a different package manager (like emerge for Gentoo Linux).
EDIT: Does anything happen if you try /sbin/sudo (or /usr/sbin/sudo)?
Often sudo is not installed by default on distributions like Debian.
Tipe into the console:
su -
After that try to install sudo with this line:
apt-get install sudo -y
To use sudo properly you should give yourself Superuser permissions:
usermod -aG sudo USERNAME
After this step reboot your device and everything should work fine.

Resources