我自己安装的时候遇到了很多问题,浪费了很多时间才解决,所以特地记录下这个过程,希望能够帮到正在阅读这篇文章的你。
1.下载chrome安装包
wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
如果在阿里云上下载不下来,多试几次。
2. 直接通过yum来安装npm解决依赖问题(我之前是通过sudo dnf install来安装的,一直不行,快崩溃了)
yum install -y google-chrome-stable_current_x86_64.rpm
3.安装glib2
yum update glib2 -y
4.配置环境变量
export PATH=$PATH:/opt/google/chrome
source/etc/profile
5.查看chrome版本,如果成功,那么恭喜你,表示安装完成大功告成
google-chrome --version
6.如果执行第五步执行的时候出现类似的如下错误,表示缺少相关依赖包
/opt/google/chrome/google-chrome: error while loading shared libraries: libpango-1.0.so.0: cannot open shared object file: No such file or directory
执行yum provides */libpango-1.0.so.0查看依赖包来源
yum provides */libpango-1.0.so.0
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
pango-1.42.4-4.el7_7.i686 : System for layout and rendering of internationalized
: text
源 :base
匹配来源:
文件名 :/usr/lib/libpango-1.0.so.0
pango-1.42.4-4.el7_7.x86_64 : System for layout and rendering of internationalized
: text
源 :base
匹配来源:
文件名 :/usr/lib64/libpango-1.0.so.0
安装缺失的依赖包
yum install pango
再查看chrome版本
google-chrome --no-sandbox --version
Google Chrome 113.0.5672.126
大功告成!