我在Circle CI配置中具有以下命令,用于安装chrome驱动程序以运行自动化测试用例。
sudo apt-get update
sudo apt-get install lsb-release libappindicator3-1
curl -L -o google-chrome.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome.deb
sudo sed -i 's|HERE/chrome"|HERE/chrome" --no-sandbox|g' /opt/google/chrome/google-chrome
rm google-chrome.deb
现在这会引发错误:
Ign http://deb.debian.org jessie InRelease
Ign http://http.debian.net jessie-backports InRelease
Get:1 http://deb.debian.org jessie-updates InRelease [7340 B]
Get:2 http://security.debian.org jessie/updates InRelease [44.9 kB]
Get:3 http://deb.debian.org jessie Release.gpg [2420 B]
Ign http://http.debian.net jessie-backports Release.gpg
Get:4 http://deb.debian.org jessie Release [148 kB]
Ign http://http.debian.net jessie-backports Release
Get:5 http://security.debian.org jessie/updates/main amd64 Packages [829 kB]
Get:6 http://deb.debian.org jessie/main amd64 Packages [9098 kB]
Err http://http.debian.net jessie-backports/main amd64 Packages
Err http://http.debian.net jessie-backports/main amd64 Packages
Err http://http.debian.net jessie-backports/main amd64 Packages
Err http://http.debian.net jessie-backports/main amd64 Packages
Err http://http.debian.net jessie-backports/main amd64 Packages
404 Not Found
Fetched 10.1 MB in 1s (8456 kB/s)
W: Failed to fetch http://deb.debian.org/debian/dists/jessie-updates/InRelease Unable to find expected entry 'main/binary-amd64/Packages' in Release file (Wrong sources.list entry or malformed file)
W: Failed to fetch http://http.debian.net/debian/dists/jessie-backports/main/binary-amd64/Packages 404 Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.
Exited with code 100
因此,我认为添加回购归档文件将解决此问题,因此我添加了类似的内容
sudo -i
printf "deb http://archive.debian.org/debian/ jessie main\ndeb-src http://archive.debian.org/debian/ jessie main\ndeb http://security.debian.org jessie/updates main\ndeb-src http://security.debian.org jessie/updates main" > /etc/apt/sources.list
exit
sudo apt-get update
sudo apt-get install lsb-release libappindicator3-1
curl -L -o google-chrome.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome.deb
sudo sed -i 's|HERE/chrome"|HERE/chrome" --no-sandbox|g' /opt/google/chrome/google-chrome
rm google-chrome.deb
exit 0
这再次阻止进度,并且在Circle CI作业进度时间轴中显示一个shell提示,如图所示。如何解决?我唯一的要求是安装chrome驱动程序。