软件版本:ubuntu16.04
硬件:GPU:nivdia Titan
出现原因:在桌面模式下操作时不小心按了Ctrl+Alt+F9,退出了桌面模式,只有一杠在闪烁,不能进行任何操作,关机重启之后,用户登录界面死循环,表现为:输入正确的密码之后,跳一下,黑屏,然后又跳回登录界面。如果输入错误密码,则提示密码错误。
解决办法:
1.参考 https://blog.csdn.net/ssmixi/article/details/73483795(多数人反应此方法可以)
(1)进入文本模式:CTRL+ALT+F1
(2)输入用户名和密码
(3)sudo apt-get remove nvidia-*
(4) sudo apt-get autoremove
(5)sudo nvidia-uninstall XXX.run(卸载之前安装的驱动)
(6)su reboot,重启
(7)Ctrl+Alt+F1
(8)sudo service lightdm stop
(9)sudo ./NVIDIA-Linux-x86_64-381.22.run -no-x-check -no-nouveau-check -no-opengl-files
-no-x-check安装驱动时关闭x服务;
-no-nouveau-check 安装驱动时禁用Nouveau
-no-opengl-files 安装时只装驱动文件,不安装Opengl
(10)sudo service lightdm restart(可正常登录)
此方法大多数人能够觉得此问题,但没有能解决我的问题。
2.参考https://askubuntu.com/questions/223501/ubuntu-gets-stuck-in-a-login-loop?page=1&tab=votes#tab-top(作者分析了各种情况)
(1)NVIDIA drivers missing or broken?
Run nvidia-smi to access the NVIDIA system management interface. The output should be something of this sort.
If you’re not able to access it, there is probably some issue with your graphic drivers.
In that case, you should be able to find out the name of your graphics card using lspci | grep VGA.
You can find out the compatible drivers for your graphics card using the link.
(Try without this stepand maybe then with this step if there was no success). Remove the existing broken drivers using sudo apt-get purge nvidia*.
Install the drivers using
sudo add-apt-repository ppa:graphics-drivers
sudo apt-get update
sudo apt-get install nvidia-390 (Or whatever the compatible driver is for your graphics card)
Try a restart using systemctl reboot -i and hope your login loop is fixed.
(2)Is your HOME your HOME?
Check the owner of your home directory using ls -l /home
If you don not own your home directory, change it using sudo chown user:user $HOME
Try a restart using systemctl reboot -i and hope your login loop is fixed.
Do you own your .Xauthority?
Check the owner of your home directory using ls -l ~/.Xauthority
If you don’t own your .Xauthority, change it using sudo chown user:user ~/.Xauthority
If you do, move your .Xauthority file using sudo mv ~/.Xauthority ~/.Xauthority.bak
Try a restart using systemctl reboot -i and hope your login loop is fixed.
You might need to do the same thing on .ICEauthority.
Is your /tmp right?
Run ls -ld /tmp and make sure the permissions are exactly drwxrwxrwt. The output should be of this sort
drwxrwxrwt 27 root root 36864 Sep 17 17:15 /tmp
If not, run sudo chmod a+wt /tmp
Try a restart using systemctl reboot -i and hope your login loop is fixed.
Maybe lightdm is your problem?
Reconfigure your display manager using dpkg-reconfigure lightdm and try out other display managers (gdm3,lightdm,) that are available. Maybe this will you give you enough clues to move forward.
If none of them help,try installing sddm using sudo apt-get install sddm
for one final try. reconfigure display to sddm.
If none of the above solutions worked, you can try re-installing ubuntu
上述方法没有解决我的问题,但通过一些命令,我排除了一些可能造成的原因。
(1)ls -1A
(2)cat ~/.Xsession-errors等
排除了不是驱动问题,不是root问题。
3.参考https://blog.csdn.net/xc_zhou/article/details/80732410
由于前面在anaconda中添加了caffe,根据上诉博客,可能是在添加caffe中改动了配置文件profile,因此决定将profile文件中自己添加的部分暂时屏蔽,具体操作:
(1)在登录界面同时按下ctrl+alt+f1;
(2)输入用户名和密码;
(3)sudo vi /etc/profile
然后:wq保存退出;
重启,键入sudo reboot回车
问题解决。