【发布时间】:2021-10-18 12:04:58
【问题描述】:
我最近启动的一些 GitHub Actions 工作流在安装 Chromedriver 时返回此错误:
Get:1 http://security.debian.org/debian-security buster/updates InRelease [65.4 kB]
Get:2 http://deb.debian.org/debian buster InRelease [122 kB]
Get:3 http://deb.debian.org/debian buster-updates InRelease [51.9 kB]
Reading package lists...
E: Repository 'http://security.debian.org/debian-security buster/updates InRelease' changed its 'Suite' value from 'stable' to 'oldstable'
E: Repository 'http://deb.debian.org/debian buster InRelease' changed its 'Suite' value from 'stable' to 'oldstable'
E: Repository 'http://deb.debian.org/debian buster-updates InRelease' changed its 'Suite' value from 'stable-updates' to 'oldstable-updates'
Error: Process completed with exit code 100.
这是我的步骤实现:
jobs:
build:
runs-on: ubuntu-latest
container:
image: docker://guillaumefalourd/ritchiecli:py-3.8
steps:
- name: Install Chrome Driver
run: |
sudo apt-get update
sudo apt-get install -y unzip xvfb libxi6 libgconf-2-4 gnupg2
sudo curl -sS -o - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add
sudo echo "deb https://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list
sudo apt-get -y update
sudo apt-get -y install google-chrome-stable
wget -N https://chromedriver.storage.googleapis.com/89.0.4389.23/chromedriver_linux64.zip -P ~/
unzip ~/chromedriver_linux64.zip -d ~/
rm ~/chromedriver_linux64.zip
sudo mv -f ~/chromedriver /usr/local/bin/chromedriver
sudo chown root:root /usr/local/bin/chromedriver
sudo chmod 0755 /usr/local/bin/chromedriver
Docker 镜像实现:docker://guillaumefalourd/ritchiecli:py-3.8
我尝试了什么
-
我从here 和here 中了解到,添加
sudo apt-get --allow-releaseinfo-change update或sudo apt-get dist-upgrade可以解决问题,但即使将它们添加到我的工作流程中也不能解决问题。 -
我尝试使用此操作setup-chromedriver,但在遵循文档时返回相同的错误:
steps: - uses: actions/checkout@v2 - uses: nanasess/setup-chromedriver@master with: # Optional: do not specify to match Chrome's version chromedriver-version: '88.0.4324.96' - run: | export DISPLAY=:99 chromedriver --url-base=/wd/hub & sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & # optional -
因为它似乎与 Debian 10 (Buster) (?) 我也尝试使用另一个 Ubuntu 运行器版本作为运行器(
ubuntu-18.04而不是ubuntu-latest),但是没有任何改变,同样的错误。
我该如何解决这个问题?
回答
我后来观察到问题出现在第一个命令:sudo apt-get update(我在之后添加了另一个命令......)。
用它代替 sudo apt-get --allow-releaseinfo-change update 解决了我的问题。
因此,答案不是将sudo apt-get --allow-releaseinfo-change update 添加到步骤执行的命令中,而是替换sudo apt-get update 命令。
jobs:
build:
runs-on: ubuntu-latest
container:
image: docker://guillaumefalourd/ritchiecli:py-3.8
steps:
- name: Install Chrome Driver
run: |
sudo apt-get --allow-releaseinfo-change update
sudo apt-get install -y unzip xvfb libxi6 libgconf-2-4 gnupg2
sudo curl -sS -o - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add
sudo echo "deb https://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list
sudo apt-get -y update
sudo apt-get -y install google-chrome-stable
wget -N https://chromedriver.storage.googleapis.com/89.0.4389.23/chromedriver_linux64.zip -P ~/
unzip ~/chromedriver_linux64.zip -d ~/
rm ~/chromedriver_linux64.zip
sudo mv -f ~/chromedriver /usr/local/bin/chromedriver
sudo chown root:root /usr/local/bin/chromedriver
sudo chmod 0755 /usr/local/bin/chromedriver
【问题讨论】:
-
如果你想要稳定(变化),在 source.list 上使用“稳定”,否则使用发布名称。注意:如果您从其他人那里得到错误的数据,
sed命令可以纠正它。所以检查你的 /etc/apt/sources.list* -
旁注:这可能是因为 Debian 刚刚发布了 "bullseye" (debian.org/News/2021/20210814),所以 Buster 进入了 LTS - wiki.debian.org/LTS
-
apt upgrade为我解决了这个问题。
标签: shell selenium-chromedriver debian github-actions debian-buster