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

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

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

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

32位系统输入以下内容保存:


[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

64位系统输入以下内容保存:

[google-chrome-browser]
name= google-chrome-x86_64
baseurl=http://dl.google.com/linux/rpm/stable/x86_64
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/

[root@dock-qunar chrome]# ./google-chrome

./google-chrome: error while loading shared libraries: libasound.so.2: cannot open shared object file: No such file or directory

解决:

yum install libasound.so.2

yum install libudev.so.0

yum install libpk-gtk-module.so

yum install libcanberra-gtk-module.so

参考网页:http://mike.ucoz.com/publ/programming/centos/12


猜你喜欢

转载自289972458.iteye.com/blog/1543236