解决办法一
查看 google-chrome所在的路径
whereis google-chrome
google-chrome: /usr/bin/google-chrome /usr/share/man/man1/google-chrome.1
于是可以这么运行:
/usr/bin/google-chrome %U -user-data-dir
这种办法比较麻烦。
解决办法二:
找到 /usr/share/applications/google-chrome.desktop 文件并编辑:
找到Exec第一次出现的位置,其内容如下:
Exec=/usr/bin/google-chrome-stable %U
将他改成如下:
Exec=/usr/bin/google-chrome-stable --user-data-dir="/root/.config/google-chrome"
当然这个user-data-dir可以根据自己喜好,随便定义一个位置。
这样点击启动器上chrome的图标即可启动chrome浏览器。
[root@localhost Desktop]# google-chrome &
[1] 5546
[root@localhost Desktop]# [1:1:0707/133039:ERROR:nacl_fork_delegate_linux.cc(315)] Bad NaCl helper startup ack (0 bytes)
Chrome is not designed to run as root
. Running your browser as root is indeed a bad idea from security point of view, so you should do as @testdemoTestlast says and run it using regular user account. If for some reasons you need to run it as root,
这个问题在于 不能用 root 启动. 用以下启动方式,即解决了
google-chrome - -no-sandbox - -user-data-dir &