The easiest way to install chrome in CentOS 6

Time:2021-4-1

[please indicate the source for reprint]:https://blog.csdn.net/huahao1989/article/details/107967581

Today, a colleague said, “brother long, I’m going to install chrome on CentOS 6.5 for two days. Please help me to have a look.”. When I heard this, I had a big head. I remember a long time ago, I also needed to build a chrome based crawler on CentOS 6.5, which also took a lot of effort. The official website of chrome has already indicated that at least CentOS 7 is needed. When installing a dependency package, I found that another dependency package is needed. All kinds of dependencies are very difficult. Later, I found support for CentOS 6 It’s a perfect solution. Today, it’s a record.

Direct to a network disk

Link:https://pan.baidu.com/s/1zxbW…Extraction code: ggyu

First download the two files, and then execute the following command to install

rpm -i chrome-deps-stable-3.11-1.x86_64.rpm
rpm -i --force --nodeps google-chrome-stable_current_x86_64.rpm

If there is no error, congratulations on the completion of the installation.

In general, you may be prompted that glibc version is low, so upgrade it

strings /lib64/libc.so.6 | grep GLIBC
#Check the existing version first
wget http://ftp.gnu.org/gnu/glibc/glibc-2.17.tar.gz
tar -zxvf glibc-2.17.tar.gz
cd glibc-2.17
mkdir build
cd build
../configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin 
make 
make install

If it appears

Can’t open configuration file /usr/etc/ld.so.conf: No such file or directory

Input:

touch /usr/etc/ld.so.conf/etc/ld.so.conf 
sudo cp -r  /etc/ld.so.c* /usr/etc/
sudo ln -sf /usr/lib/libc-2.17.so /lib64/libc.so.6

If there’s any order here

error while loading shared libraries: __vdso_time: invalid mode for dlopen(): Invalid argument

Then execute the following command and go back first

cd /lib64
LD_PRELOAD=/lib64/libc-2.12.so ln -fs /lib64/libc-2.12.so /lib64/libc.so.6 
LD_PRELOAD=/lib64/libc-2.12.so ln -s ld-2.12.so ld-linux-x86-64.so.2 
LD_PRELOAD=/lib64/libc-2.12.so ln -s libc-2.12.so libc.so.6  
LD_PRELOAD=/lib64/libc-2.12.so ln -s libBrokenLocale-2.12.so libBrokenLocale.so.1
LD_PRELOAD=/lib64/libc-2.12.so ln -s  ld-2.12.so ld-linux-x86-64.so.2 

At this time, we have to upgrade the version of GCC

wget http://ftp.gnu.org/gnu/gcc/gcc-4.8.2/gcc-4.8.2.tar.bz2
tar -jxvf gcc-4.8.2.tar.bz2
cd gcc-4.8.2
./contrib/download_prerequisites
#This script will automatically download the three dependencies of GMP, mpfr and MPC required for compiling GCC. If the network is not good enough to download, it is recommended to manually download them to the current directory, comment out the three wgets in this script, and then execute them again.
mkdir build
cd build
../configure -enable-checking=release -enable-languages=c,c++ -disable-multilib
make
make install

Now GCC has been upgraded. If you go back and upgrade libc, you will have no problem. You should also have no problem installing chrome. If you are also prompted for a lack of dependent packages, go tohttp://ftp.gnome.org/pub/gnome/sources/Download and install.

After installation, it will appear when you start with root

Chromium can not be run as root

Files need to be modified

cd /opt/chromium-browser/
vi chromium-browser.sh

find

exec -a "$0" "$HERE/chromium-browser" $CHROMIUM_RHEL_FLAGS "[email protected]"

Add after–user-data-dirChange to

exec -a "$0" "$HERE/chromium-browser" $CHROMIUM_RHEL_FLAGS "[email protected]" --user-data-dir

That should be right.

I suggest that you’d better install CentOS 7. If you don’t upgrade, you’ll have to be in trouble.

Welcome to “back end old bird” The official account will be followed by a series of thematic articles, including Java, Python, Linux, SpringBoot, SpringCloud, Dubbo, algorithm, management of technical team, and various brain maps and learning materials, NFC technology, search technology, crawler technology, recommendation technology, audio frequency interactive live broadcast, etc. as long as there is time, I will organize and share. Please look forward to ready-made notes. If you need a map and learning materials, you can get the official account message in advance. Because I am basically in the role of tackling key problems and exploring the way in all the teams, I have done many things, and I have encountered many holes and solved many problems. Welcome to join the official account and learn together.

[please indicate the source for reprint]:https://blog.csdn.net/huahao1989/article/details/107967581

The easiest way to install chrome in CentOS 6