1. 程式人生 > >Ubuntu登陸不進去的一個原因

Ubuntu登陸不進去的一個原因

Ubuntu一直在登陸介面迴圈:登陸密碼是正確的,但是登陸後自動退回登陸介面。

這個問題原因應該很多,上網看了些可能有些啟發,但是最終還是得看自己的問題。

我以為我要拋棄這個系統重新安裝了,那是很杯具了,還好最終發現並解決了問題。

我發現,一方面我通過SSH可以登入進去系統,會報一些錯誤:

Last login: Tue Jun 26 02:32:21 2018 from 192.168.23.1
-bash: /opt/apache-hive-2.1.1-bin/bin: Is a directory
Command 'lesspipe' is available in the following places
 * /bin/lesspipe
 * /usr/bin/lesspipe
The command could not be located because '/bin:/usr/bin' is not included in the PATH environment variable.
lesspipe: command not found
Command 'dircolors' is available in '/usr/bin/dircolors'
The command could not be located because '/usr/bin' is not included in the PATH environment variable.
dircolors: command not found
Command 'ls' is available in '/bin/ls'
The command could not be located because '/bin' is not included in the PATH environment variable.
ls: command not found

在登入的圖形介面用Ctrl+Alt+F1~F6進入命令列介面同樣報類似資訊。

而且兩種方式下,很多命令都執行不了。

還好可以執行export:

[email protected]:~$ export PATH=$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/local/hadoop/bin:/usr/local/hadoop/sbin

執行完後就可以執行很多命令了。

聯想到之前安裝HIVE,修改了profile檔案,趕緊進去看看:

[email protected]:/$ sudo vi etc/profile

export HIVE_HOME=/opt/apache-hive-2.1.1-bin
export PATH=$HIVE_HOME/bin;$PATH

果然,設定PATH時用了;號導致PATH路徑錯誤,系統起不來了。

修改檔案中;為:號後,重啟系統就可以正常登入了