0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Ubuntuでchromedriverをインストールするとき困ったこと

Last updated at Posted at 2024-08-06

下記の文を参考にUbuntuでスクレイピング環境を構築中で、困ったことがあったので補足します。

対象はこちらです。

$ sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
$ sudo wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
$ sudo apt-get update
$ sudo apt-get install google-chrome-stable

キーリング管理

$ sudo wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -

上記コマンドで警告発生

Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).

対策

  1. GPGキーダウンロード
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub > /usr/share/keyrings/google-linux-signing-key.gpg

error

次のエラーが発生した場合

-bash: /usr/share/keyrings/google-linux-signing-key.gpg: Permission denied

コマンドを下記に変更

sudo wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo tee /usr/share/keyrings/google-linux-signing-key.gpg
  1. aptアップデート
echo "deb [signed-by=/usr/share/keyrings/google-linux-signing-key.gpg] http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee /etc/apt/sources.list.d/google-chrome.list
  1. パッケージアップデート、インストール
sudo apt update
sudo apt install google-chrome-stable

error

次のエラーが発生した場合

E: Conflicting values set for option Signed-By regarding source http://dl.google.com/linux/chrome/deb/ stable: /usr/share/keyrings/google-linux-signing-key.gpg !=
E: The list of sources could not be read.

複数のsigned-byオプションが設定しているので長谷資した不具合。
重複項目の削除が必要。

コマンドを下記に変更

sudo wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo tee /usr/share/keyrings/google-linux-signing-key.gpg

3-1. apt一覧確認

grep -r "google-linux-signing-key.gpg" /etc/apt/sources.list /etc/apt/sources.list.d/

3-2. 重複項目削除

sudo vim /etc/apt/sources.list.d/google-chrome.list

3-3. 次のファイル内容を確認

deb [signed-by=/usr/share/keyrings/google-linux-signing-key.gpg] http://dl.google.com/linux/chrome/deb/ stable main

ほかのファイルにも同様の設定があったら削除します。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?