原文鏈接:
http://blog.csdn.net/panbin0054/article/details/7198315
系統環境:Centos7
安裝Chrome:
1、wget http://chrome.richardlloyd.org.uk/install_chrome.sh (用wget下載shell文件)
2、chmod u+x install_chrome.sh (給文件授予權限)
3、 ./install_chrome.sh -s (用 ./ 命令執行sh文件,-s 表示安裝的穩定版,之后等待數分鐘就好了)
4、如果想卸載,則執行命令 yum remove google-chrome-stable 或者 ./install_chrome.sh -u 命令
5、執行以上命令需要在root權限下。
問題描述:原本在root這個用戶登錄的情況下安裝的chrome,打開chrome時提示以下錯誤:
Google Chrome can not be run as root.
Please start Google Chrome as a normal user.
To run as root, you must specify an alternate --user-data-dir for storage of profile information.
這個問題在網上有很多人在問,而且解決方法都是一樣:用hexedit去編輯chrome文件,把geteuid改為getppid,過程如下:
1.搜索并安裝hexedit:
yum list hexedit
發現有這個包:
hexedit.i686 1.2.12-11.fc12 @fedora
于是安裝:
yum install hexedit.i686
2.用hexedit修改/opt/google/chrome/chrome文件
這里按照網上說的方法修改,提示文件為只讀,不管用chmod怎么修改權限,還是提示只讀。這里采用以下方法:
cp chrome /root/
hexedit /root/chrome
這樣便可以修改/root/目錄下的chrome了,打開chrome,按Tab鍵,再按Ctrl+s搜索geteuid,找到后,直接輸入getppid,將會覆蓋掉geteuid,最后按Ctrl+x保存。
3.將/root目錄下的chrome復制回/opt/google/chrome/,覆蓋掉原來的chrome文件即可。打開chome,現在可以正常使用了。