Ubuntu 16.04 用戶登錄界面死循環問題的解決

軟件版本: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回車
問題解決。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章