Google Chrome can not be run as root 【不能以根用户身份运作 Google Chrome】

Google Chrome can not be run as root 【不能以根用户身份运行 Google Chrome】

在CentOS上安装Chrome浏览器步骤:

 

第一步:在 /etc/yum.repos.d/目录下新建google.repo文件:

 

# vim /etc/yum.repos.d/google.repo 

 

输入以下内容保存:


[google-chrome-browser]
name=google-chrome
baseurl=http://dl.google.com/linux/chrome/rpm/stable/i386
enabled=1
gpgcheck=1
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub

 

 

第二步:yum install google-chrome-stable

 

第三步:启动chrome,此时如果以root用户启动将会启动失败,提示:

                Google Chrome can not be run as root 【不能以根用户身份运行 Google Chrome】

 

解决办法:

#yum -y install alacarte

# alacarte

 

Once alacarte Window is opened Click on Applications and from Right Panel Select Google Chrome

On Google Chrome Menu click on Properties , Move to Command Text Box of Google Chrome Menu Properties.

Change this line from  /opt/google/chrome/google-chrome %U to /opt/google/chrome/google-chrome –user-data-dir %U

If This GUI Steps doesn’t work than do following Steps it will work. 

# vi /opt/google/chrome/google-chrome

and Find line exec -a “$0″ “$HERE/chrome” “$@” and change it to following

exec -a “$0″ “$HERE/chrome” “$@” –user-data-dir ( Two Hyphens at start of options )

Save and Close File


启动chrome,应该就可用root用户启动来

参考网页:http://www.tejasbarot.com/2011/09/26/howto-running-google-chrome-as-root-fedora-15-centos-6-rhel-6-ubuntu-11-04-linux/