After you log in with the root user in Ubuntu, and then install Chrome, there may be some errors with Google Chrome can not be run as root.
At this point there are two solutions that can be tried.
Method 1:
After you log in as root, install HexEdit:
Apt-get Install HexEdit
Then copy the chrome file from the/opt/google/chrome/directory to root, because you cannot modify the file directly in the original directory Chrome:
Cp-r/opt/google/chrome/chrome/root/
Then use HexEdit to open the chrome file you just copied:
HexEdit Chrome
After opening, press the TAB key, then press CTRL + S to search, enter the search term: geteuid,
Press ENTER, will automatically jump to the location of the target, and then enter the Getppid, the original file Geteuid replaced Getppid.
Then press CTRL + X to save the exit.
Then copy the modified Chrome file back to the original place and overwrite the original file:
Cp-r/root/chrome/opt/google/chrome/
It's done here.
If this error still occurs after using the above method, use the following method while preserving the above modification.
A second method:
After logging in as root, open the Google-chrome file in the/opt/google/chrome/directory with gedit:
Gedit/opt/google/chrome/google-chrome
Then come to the end of this file and find
Exec-a "$" "Here/chrome" "[email protected]"
Replace this line with the following line:
Save and exit.
It should be all right here.
Google Chrome can not be run as root