当前位置: 首页 > news >正文

linux 安装谷歌浏览器和对应的驱动

创建文件install-google-chrome.sh

#! /bin/bash# Copyright 2017-present: Intoli, LLC
# Source: https://intoli.com/blog/installing-google-chrome-on-centos/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.# What this script does is explained in detail in a blog post located at:
# https://intoli.com/blog/installing-google-chrome-on-centos/
# If you're trying to figure out how things work, then you should visit that!# Require that this runs as root.
[ "$UID" -eq 0 ] || exec sudo "$0" "$@"# Define some global variables.
working_directory="/tmp/google-chrome-installation"
repo_file="/etc/yum.repos.d/google-chrome.repo"# Work in our working directory.
echo "Working in ${working_directory}"
mkdir -p ${working_directory}
rm -rf ${working_directory}/*
pushd ${working_directory}# Add the official Google Chrome Centos 7 repo.
echo "Configuring the Google Chrome repo in ${repo_file}"
echo "[google-chrome]" > $repo_file
echo "name=google-chrome" >> $repo_file
echo "baseurl=http://dl.google.com/linux/chrome/rpm/stable/\$basearch" >> $repo_file
echo "enabled=1" >> $repo_file
echo "gpgcheck=1" >> $repo_file
echo "gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub" >> $repo_file# Install the Google Chrome signing key.
yum install -y wget
wget https://dl.google.com/linux/linux_signing_key.pub
rpm --import linux_signing_key.pub# A helper to make sure that Chrome is linked correctly
function installation_status() {google-chrome-stable --version > /dev/null 2>&1[ $? -eq 0 ]
}# Try it the old fashioned way, should work on RHEL 7.X.
echo "Attempting a direction installation with yum."
yum install -y google-chrome-stable
if [ $? -eq 0 ]
thenif installation_status; then# Print out the success message.echo "Successfully installed Google Chrome!"rm -rf ${working_directory}popd > /dev/nullexit 0fi
fi# Uninstall any existing/partially installed versions.
yum --setopt=tsflags=noscripts -y remove google-chrome-stable# Install yumdownloader/repoquery and download the latest RPM.
echo "Downloading the Google Chrome RPM file."
yum install -y yum-utils
# There have been issues in the past with the Chrome repository, so we fall back to downloading
# the latest RPM directly if the package isn't available there. For further details:
# https://productforums.google.com/forum/#!topic/chrome/xNtfk_wAUC4;context-place=forum/chrome
yumdownloader google-chrome-stable || \wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
rpm_file=$(echo *.rpm)
echo "Downloaded ${rpm_file}"# Install the RPM in a broken state.
rpm -ih --nodeps ${rpm_file}
rm ${rpm_file}# Install font dependencies, see: https://bugs.chromium.org/p/chromium/issues/detail?id=782161
echo "Installing the required font dependencies."
yum install -y \fontconfig \fontpackages-filesystem \ipa-gothic-fonts \xorg-x11-fonts-100dpi \xorg-x11-fonts-75dpi \xorg-x11-fonts-misc \xorg-x11-fonts-Type1 \xorg-x11-utils# Helper function to install packages in the chroot by name (as an argument).
function install_package() {# We'll leave the RPMs around to avoid redownloading things.if [ -f "$1.rpm" ]; thenreturn 0fi# Find the URL for the package.url=$(repoquery --repofrompath=centos7,http://mirror.centos.org/centos/7/os/`arch` \--repoid=centos7 -q --qf="%{location}" "$1" | \sed s/x86_64.rpm$/`arch`.rpm/ | \sed s/i686.rpm$/`arch`.rpm/g | \sort -u)# Download the RPM.wget "${url}" -O "$1.rpm"# Extract it.echo "Extracting $1..."rpm2cpio $1.rpm | cpio -idmv > /dev/null 2>&1
}# Install glibc/ld-linux from CentOS 7.
install_package glibc# Make the library directory and copy over glibc/ld-linux.
lib_directory=/opt/google/chrome/lib
mkdir -p $lib_directory
cp ./lib/* $lib_directory/ 2> /dev/null
cp ./lib64/* $lib_directory/ 2> /dev/null# Install `mount` and its mandatory dependencies from CentOS 7.
for package in "glibc" "util-linux" "libmount" "libblkid" "libuuid" "libselinux" "pcre"; doinstall_package "${package}"
done# Create an `ldd.sh` script to mimic the behavior of `ldd` within the namespace (without bash, etc. dependencies).
echo '#!/bin/bash' > ldd.sh
echo '' >> ldd.sh
echo '# Usage: ldd.sh LIBRARY_PATH EXECUTABLE' >> ldd.sh
echo 'mount --make-rprivate /' >> ldd.sh
echo 'unshare -m bash -c "`tail -n +7 $0`" "$0" "$@"' >> ldd.sh
echo 'exit $?' >> ldd.sh
echo '' >> ldd.sh
echo 'LD=$({ ls -1 ${1}/ld-linux* | head -n1 ; } 2> /dev/null)' >> ldd.sh
echo 'mount --make-private -o remount /' >> ldd.sh
echo 'mount --bind ${1} $(dirname "$({ ls -1 /lib/ld-linux* /lib64/ld-linux* | head -n1 ; } 2> /dev/null)")' >> ldd.sh
echo 'for directory in lib lib64 usr/lib usr/lib64; do' >> ldd.sh
echo '    PATH=./:./bin:./usr/bin LD_LIBRARY_PATH=${1}:./lib64:./usr/lib64:./lib:./usr/lib mount --bind ${1} /${directory} 2> /dev/null' >> ldd.sh
echo 'done' >> ldd.sh
echo 'echo -n "$(LD_TRACE_LOADED_OBJECTS=1 LD_LIBRARY_PATH="${1}" "${LD}" "${2}")"' >> ldd.sh
chmod a+x ldd.sh# Takes the executable as an argument and recursively installs all missing dependencies.
function install_missing_dependencies() {executable="${1}"# Loop through and install missing dependencies.while truedofinished=true# Loop through each of the missing libraries for this round.while read -r linedo# Parse the various library listing formats.if [[ $line == *"/"* ]]; then# Extract the filename when a path is present (e.g. /lib64/).file=`echo $line | sed 's>.*/\([^/:]*\):.*>\1>'`else# Extract the filename for missing libraries without a path.file=`echo $line | awk '{print $1;}'`fiif [ -z $file ]; thencontinuefi# We'll require an empty round before completing.finished=falseecho "Finding dependency for ${file}"# Find the package name for this library.package=$(repoquery --repofrompath=centos7,http://mirror.centos.org/centos/7/os/`arch` \--repoid=centos7 -q --qf="%{name}" --whatprovides "$file" | head -n1)install_package "${package}"# Copy it over to our library directory.find . | grep /${file} | xargs -n1 -I{} cp {} ${lib_directory}/done <<< "$(./ldd.sh "${lib_directory}" "${executable}" 2>&1 | grep -e "no version information" -e "not found")"# Break once no new files have been copied in a loop.if [ "$finished" = true ]; thenbreakfidone
}# Install the missing dependencies for Chrome.
install_missing_dependencies /opt/google/chrome/chromeif ! installation_status; then# Time for the big guns, we'll try to patch the executables to use our lib directory.yum install -y gcc gcc-c++ make autoconf automakeecho "Linking issues were encountered, attempting to patch the `chrome` executable."wget https://github.com/NixOS/patchelf/archive/0.9.tar.gz -O 0.9.tar.gztar zxf 0.9.tar.gzpushd patchelf-0.9./bootstrap.sh./configuremakeLD="$({ ls -1 ${lib_directory}/ld-linux* | head -n1 ; } 2> /dev/null)"./src/patchelf --set-interpreter "${LD}" --set-rpath "${lib_directory}" /opt/google/chrome/chrome./src/patchelf --set-interpreter "${LD}" --set-rpath "${lib_directory}" /opt/google/chrome/chrome-sandboxsed -i 's/\(.*exec cat.*\)/LD_LIBRARY_PATH="" \1/g' /opt/google/chrome/google-chromepopd > /dev/nullecho "Attempted experimental patching of Chrome to use a relocated glibc version."
fi# Clean up the directory stack.
rm -rf ${working_directory}
popd > /dev/null# Print out the success status message and exit.
version="$(google-chrome-stable --version)"
if [ $? -eq 0 ]; thenecho "Successfully installed google-chrome-stable, ${version}."exit 0
elseecho "Installation has failed."echo "Please email contact@intoli.com with the details of your operating system."echo "If you're using using AWS, please include the AMI identifier for the instance."exit 1
fi

然后授予可执行权限
chmod 755 ./install-google-chrome.sh


执行脚本
./install-google-chrome.sh


安装脚本会自动下载、安装chrome(合适的版本),并且目前两个系统中,所缺少的依赖,都会被安装。

测试安装结果
google-chrome-stable --no-sandbox --headless --disable-gpu --screenshot   https://www.baidu.com/
如果出现screenshot.png 则安装成功

查看chrome 版本
google-chrome-stable --version

下载对应版本的驱动,换成对应的版本号

https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/118.0.5993.70/linux64/chrome-linux64.zip

卸载

yum remove google-chrome-stable
rm -rf /usr/bin/chromedriver

linux 历时版本 Chromium Downloads Tool

驱动下载地址 ChromeDriver - WebDriver for Chrome - Downloads

相关文章:

linux 安装谷歌浏览器和对应的驱动

创建文件install-google-chrome.sh #! /bin/bash# Copyright 2017-present: Intoli, LLC # Source: https://intoli.com/blog/installing-google-chrome-on-centos/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted p…...

FPGA的通用FIFO设计verilog,1024*8bit仿真,源码和视频

名称&#xff1a;FIFO存储器设计1024*8bit 软件&#xff1a;Quartus 语言&#xff1a;Verilog 本代码为FIFO通用代码&#xff0c;其他深度和位宽可简单修改以下参数得到 reg [7:0] ram [1023:0];//RAM。深度1024&#xff0c;宽度8 代码功能&#xff1a; 设计一个基于FPGA…...

攻防世界web篇-backup

这是链接中的网页&#xff0c;只有一句话 试着使用.bak点缀看看是否有效 这里链接中加上index.php.bak让下在东西 是一个bak文件&#xff0c;将.bak文件改为.php文件试试 打开.php文件后就可以得到flag值...

uni-app:js二维数组与对象数组之间的转换

一、二维数组整理成对象数组 效果 [ ["前绿箭","DI10","RO1"], ["前红叉","DI2","RO2"], ["后绿箭","DI12","RO3"], ["后红叉","DI4","RO6"] ] …...

15-bean生命周期,循环依赖

文章目录 1. bean生命周期 1. bean生命周期...

缩短cin时间

std::ios::sync_with_stdio(false);...

【试题030】C语言之关系表达式例题

1.关系表达式是用关系运算符将两个表达式连接起来 错误示例&#xff1a;a<bc &#xff08;不是关系运算符&#xff0c;是赋值运算符&#xff09; 2.题目&#xff1a;设int m160,m280,m3100;&#xff0c;表达式m3>m2>m1的值是 &#xff1f; 3.代码分析&#xff1a; …...

ArGIS Engine专题(14)之GP模型根据导入范围与地图服务相交实现叠置分析

一、结果预览 二、需求简介 前端系统开发时,可能遇到如下场景,如客户给出一个图斑范围,导入到系统中后,需要判断图斑是否与耕地红线等地图服务存在叠加,叠加的面积有多少。虽然arcgis api中提供了相交inserect接口,但只是针对图形几何之间的相交,如何要使用该接口,则需…...

矩阵置零(C++解法)

题目 给定一个 m x n 的矩阵&#xff0c;如果一个元素为 0 &#xff0c;则将其所在行和列的所有元素都设为 0 。请使用 原地 算法。 示例 1&#xff1a; 输入&#xff1a;matrix [[1,1,1],[1,0,1],[1,1,1]] 输出&#xff1a;[[1,0,1],[0,0,0],[1,0,1]]示例 2&#xff1a; 输入…...

Ansible的debug模块介绍,fact变量采集和缓存相关操作演示

目录 一.debug模块的使用方法 1.帮助文档给出的示例 2.主要用到的参数 &#xff08;1&#xff09;msg&#xff1a;主要用这个参数来指定要输出的信息 &#xff08;2&#xff09;var&#xff1a;打印指定的变量&#xff0c;一般是通过register注册了的变量 &#xff08;3&…...

零基础新手也能会的H5邀请函制作教程

随着科技的的发展&#xff0c;H5邀请函已经成为了各种活动、婚礼、会议等场合的常见邀约方式。它们不仅可以提供动态、互动的体验&#xff0c;还能让邀请内容更加丰富多彩。下面&#xff0c;我们将通过乔拓云平台&#xff0c;带领大家一步步完成H5邀请函的制作。 1. 选择可靠的…...

推荐《中华小当家》

《中华小当家&#xff01;》 [1] 是日本漫画家小川悦司创作的漫画。该作品于1995年至1999年在日本周刊少年Magazine上连载。作品亦改编为同名电视动画&#xff0c;并于1997年发行播出。 时隔20年推出续作《中华小当家&#xff01;极》&#xff0c;于2017年11月17日开始连载。…...

接口自动化测试持续集成,Soapui接口功能测试参数化

按照自动化测试分层实现的原理&#xff0c;每一层的脚本实现都要进行参数化&#xff0c;自动化的目标就是要实现脚本代码与测试数据分离。当测试数据进行调整的时候不会对脚本的实现带来震荡&#xff0c;从而提高脚本的稳定性与灵活度&#xff0c;降低脚本的维护成本。Soapui最…...

(N-128)基于springboot,vue酒店管理系统

开发工具&#xff1a;IDEA 服务器&#xff1a;Tomcat9.0&#xff0c; jdk1.8 项目构建&#xff1a;maven 数据库&#xff1a;mysql5.7 系统分前后台&#xff0c;项目采用前后端分离 前端技术&#xff1a;vueelementUI 服务端技术&#xff1a;springbootmybatis 本系统功…...

Linux UWB Stack实现——MCPS帧处理

MCPS帧处理 用于处理IEEE 802.15.4中的相关帧&#xff0c;Frame Processing&#xff0c;简写为&#xff1a;fproc。 在实现中&#xff0c;维护了关于帧处理的有限状态机(FSM)。本文从帧处理的数据结构和部分典型处理实现上进行简要的介绍。 1. 数据结构定义 关于帧处理状态…...

【面试经典150 | 区间】插入区间

文章目录 Tag题目解读题目来源解题思路方法一&#xff1a;合并区间方法二&#xff1a;模拟 其他语言python3 写在最后 Tag 【模拟】【数组】 题目解读 给定一个含有多个无重叠区间的数组&#xff0c;并且数组已经按照区间开始值升序排序。在列表中插入一个新的区间&#xff0…...

前端 js 之 浏览器工作原理 和 v8引擎 01

嘿&#xff0c;老哥&#xff0c;来了就别跑 &#xff01;学完 &#xff0c;不亏 &#x1f602; 文章目录 一、输入url 之后做了什么二、简单了解下浏览器内核三、浏览器渲染过程 &#xff08;渲染引擎&#xff09;四、js 引擎五、chrome五、v8 引擎原理八、浏览器性能优化九、前…...

全波形反演培训的思考与总结

一. InversionNet 最简单的端到端DL_FWI 1. 网络结构&#xff1a; 图1 构建了一个具有编码器-解码器结构的卷积神经网络&#xff0c;根据地震波动数据模拟地下速度结构。编码器主要由卷积层构建&#xff0c;它从输入地震数据中提取高级特征并将其压缩为单个高维向量。解码器然后…...

Arcgis聚合工具——实现简单的升尺度

找到Aggregate工具 按如下设置进行操作 注意&#xff1a;如有需要对应的低分辨率影像&#xff0c;必须点开右下角环境Environments选项&#xff0c;进行栅格的捕捉选项设置&#xff0c;以防止升尺度后的影像与需对应的低分辨率影像的栅格单元存在偏移。 点击OK&#xff0c;即可…...

专题:链表常考题目汇总

文章目录 反转类型&#xff1a;206.反转链表完整版二刷记录 25. K个一组反转链表1 &#xff1a;子链表左闭右闭反转版本2 &#xff1a; 子链表左闭右开反转版本&#xff08;推荐&#xff09;⭐反转链表左闭右闭和左闭右开 合并类型&#xff1a;21.合并两个有序链表1: 递归法2: …...

Linux应用开发之网络套接字编程(实例篇)

服务端与客户端单连接 服务端代码 #include <sys/socket.h> #include <sys/types.h> #include <netinet/in.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <arpa/inet.h> #include <pthread.h> …...

手游刚开服就被攻击怎么办?如何防御DDoS?

开服初期是手游最脆弱的阶段&#xff0c;极易成为DDoS攻击的目标。一旦遭遇攻击&#xff0c;可能导致服务器瘫痪、玩家流失&#xff0c;甚至造成巨大经济损失。本文为开发者提供一套简洁有效的应急与防御方案&#xff0c;帮助快速应对并构建长期防护体系。 一、遭遇攻击的紧急应…...

从零实现富文本编辑器#5-编辑器选区模型的状态结构表达

先前我们总结了浏览器选区模型的交互策略&#xff0c;并且实现了基本的选区操作&#xff0c;还调研了自绘选区的实现。那么相对的&#xff0c;我们还需要设计编辑器的选区表达&#xff0c;也可以称为模型选区。编辑器中应用变更时的操作范围&#xff0c;就是以模型选区为基准来…...

线程与协程

1. 线程与协程 1.1. “函数调用级别”的切换、上下文切换 1. 函数调用级别的切换 “函数调用级别的切换”是指&#xff1a;像函数调用/返回一样轻量地完成任务切换。 举例说明&#xff1a; 当你在程序中写一个函数调用&#xff1a; funcA() 然后 funcA 执行完后返回&…...

Qt Http Server模块功能及架构

Qt Http Server 是 Qt 6.0 中引入的一个新模块&#xff0c;它提供了一个轻量级的 HTTP 服务器实现&#xff0c;主要用于构建基于 HTTP 的应用程序和服务。 功能介绍&#xff1a; 主要功能 HTTP服务器功能&#xff1a; 支持 HTTP/1.1 协议 简单的请求/响应处理模型 支持 GET…...

【论文阅读28】-CNN-BiLSTM-Attention-(2024)

本文把滑坡位移序列拆开、筛优质因子&#xff0c;再用 CNN-BiLSTM-Attention 来动态预测每个子序列&#xff0c;最后重构出总位移&#xff0c;预测效果超越传统模型。 文章目录 1 引言2 方法2.1 位移时间序列加性模型2.2 变分模态分解 (VMD) 具体步骤2.3.1 样本熵&#xff08;S…...

分布式增量爬虫实现方案

之前我们在讨论的是分布式爬虫如何实现增量爬取。增量爬虫的目标是只爬取新产生或发生变化的页面&#xff0c;避免重复抓取&#xff0c;以节省资源和时间。 在分布式环境下&#xff0c;增量爬虫的实现需要考虑多个爬虫节点之间的协调和去重。 另一种思路&#xff1a;将增量判…...

使用 Streamlit 构建支持主流大模型与 Ollama 的轻量级统一平台

🎯 使用 Streamlit 构建支持主流大模型与 Ollama 的轻量级统一平台 📌 项目背景 随着大语言模型(LLM)的广泛应用,开发者常面临多个挑战: 各大模型(OpenAI、Claude、Gemini、Ollama)接口风格不统一;缺乏一个统一平台进行模型调用与测试;本地模型 Ollama 的集成与前…...

基于matlab策略迭代和值迭代法的动态规划

经典的基于策略迭代和值迭代法的动态规划matlab代码&#xff0c;实现机器人的最优运输 Dynamic-Programming-master/Environment.pdf , 104724 Dynamic-Programming-master/README.md , 506 Dynamic-Programming-master/generalizedPolicyIteration.m , 1970 Dynamic-Programm…...

python报错No module named ‘tensorflow.keras‘

是由于不同版本的tensorflow下的keras所在的路径不同&#xff0c;结合所安装的tensorflow的目录结构修改from语句即可。 原语句&#xff1a; from tensorflow.keras.layers import Conv1D, MaxPooling1D, LSTM, Dense 修改后&#xff1a; from tensorflow.python.keras.lay…...