I tried to install the Nvidia graphics drivers via System Settings → Software & Updates → Additional Drivers. However got several error messages and ended up with corrupted drivers as it seems.
I rebooted and landed in a login loop, which I fixed by going into Ctrl+Alt+F1 menu, removed all nvidia related drivers via purge nvidia*
.
Then reinstalled the xorg stuff with some autoremove
I guess and sudo apt-get install lightdm xserver-xorg-core
and something else like… xorg-id-19
.
I just wanted to use my external screen as second screen and I ended up with this total mess. My idea now was to somehow uninstall all the xorg
related stuff and lightdm
and reinstall it somehow. However it appears to be rather difficult because I can't use any command as soon as Ubuntu booted.
I use Ubuntu 16.04 LTS.
I also had the same problem. Just reinstall your desktop environment and it'll be solved.
sudo apt-get install <Your Desktop Environment name>
I had installed some nvidia and cuda drivers and ran into the same problem, where my keyboard and touchpad won't work after booting. The following steps brought it back. (Read the last paragraph first)
Start ubuntu in recovery mode. To do that press
esc
key while booting (or some other key depending on your pc), go to advanced options and select recovery mode.Start the
root
shell and try the follwing commands.Try
sudo ubuntu-drivers autoinstall
. If this gives an unmet dependencies error, remove all the unmet dependencies in one command. That is go on adding it to the statementsudo apt remove unmet_dependency_1 unmet_dependency_2 ... unmet_dependency_n
till that command finally works.Now exit the root shell and select
dpkg Repair broken packages
. NOTE: You will require an internet connection as this will install some packages.After that reboot and your keyboard and touchpad will be working.
Aside : For me after doing above steps and rebooting, when I was logging in for the first time after entering the password it would just come back to the user screen and not log in. So from the settings button I selected 'Ubuntu in wayland' and logged in, and it worked. I'm still not sure whether above steps worked or it was just because of 'Ubuntu in Wayland', anyway you can first try logging in, in ubuntu in wayland and see if that works.