1. 程式人生 > >ubuntu進不了桌面系統的相關原因

ubuntu進不了桌面系統的相關原因

重啟 pen 解決問題 根據 nor 顯卡驅動 user previous erro

Ctrl+Alt+F1
sudo apt-get install ubuntu-session

sudo apt-get install ubuntu-desktop
sudo apt-get -f install
sudo dpkg-reconfigure ubuntu-desktop
sudo reboot
sudo apt-get install gnome-session
sudo apt-get install lightdm
sudo apt-get install unity-greeter

sudo apt-get install ubuntu-desktop(安裝到這一步,reboot嘗試可以登入界面,不行就執行下面命令)

Sudo apt-get install python-ntdb
Sudo apt-get install libntdb1:amd64
Sudo apt-get install libupstart1:amd64


然後到/home/username 賬戶下,會有個.xsession-errors 的文件,
看裏面報什麽錯誤,根據錯誤提示去解決問題,比如 .profile 文件設置錯誤等,都有可能引起上述現象

sudo rm -r .Xauthority
sudo reboot //重啟
可惜,不明白為什麽刪除.Xauthority
就ok的原因。
關於.Xauthority:startx的腳本文件
Xserver 啟動時,讀文件~/.Xauthority,讀入對應其display的記錄.當一個需要顯示的客戶程序啟動調用XOpenDisplay()也讀這個文 件,並把找到的magic code 發送給Xserver.當Xserver驗證這個magic code正確以後,就同意連接啦.
觀察startx腳本也可以看到,每次startx運行,都在調用xinit以前使用了xauth的add命令添加了一個新的記錄到~/.Xauthority,用來這次運行X使用認證

最後發現還是NVIDIA顯卡驅動安裝的問題。在我的電腦上安裝不可以使用
sudo ./NVIDIA-Linux-x86_64-381.22.run -no-x-check -no-nouveau-check -no-opengl-files
我用
sudo ./NVIDIA-Linux-x86_64-381.22.run

原因:NVIDIA 驅動所致,可能之前安裝方式nvidia驅動方式不對,安裝OpenGl導致?。
解決方法:
(1)進入文本模式:CTRL+ALT+F1
(2)Uninstall any previous drivers:
sudo apt-get remove nvidia-*
sudo apt-get autoremove
(3)Uninstall the drivers from the .run file:
sudo nvidia-uninstall
(4)此時,重啟可login normally.
(5)驅動重新安裝:
(1)Ctrl+Alt+F1
(2)sudo service lightdm stop //LightDM,即:Light Display Manager,是一個全新的、輕量的Linux桌面的桌面顯示管理器.
(3)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
(6)sudo service lightdm restart(可正常登錄)
(7)重啟不會出現循環登錄。

install ubuntu-gnome-desktop

ubuntu進不了桌面系統的相關原因