运行时我收到“403 禁止错误” sudo apt-get update
。
我使用以下命令添加了 Google Chrome 存储库:
添加密钥:
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
添加存储库:
sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
安装包:
sudo apt-get update
sudo apt-get install google-chrome-stable
apt-get update 的输出:
sudo apt-get update
Ign http://dl.google.com stable InRelease
Ign http://dl.google.com stable Release.gpg
Ign http://dl.google.com stable Release
Err http://dl.google.com stable/main amd64 Packages 403 Forbidden [IP: 172.217.26.206 80]
Ign http://dl.google.com stable/main Translation-en_IN
Ign http://dl.google.com stable/main Translation-en
Ign http://extras.ubuntu.com trusty InRelease
Hit http://security.ubuntu.com trusty-security InRelease
Ign http://in.archive.ubuntu.com trusty InRelease
Hit http://ppa.launchpad.net trusty InRelease
Hit http://in.archive.ubuntu.com trusty-updates InRelease
Hit http://extras.ubuntu.com trusty Release.gpg
Hit http://security.ubuntu.com trusty-security/main Sources
Hit http://in.archive.ubuntu.com trusty-backports InRelease
Hit http://extras.ubuntu.com trusty Release
Hit http://ppa.launchpad.net trusty/main amd64 Packages
Hit https://repo.skype.com stable InRelease
Hit http://in.archive.ubuntu.com trusty Release.gpg
Hit http://ppa.launchpad.net trusty/main i386 Packages
Hit http://security.ubuntu.com trusty-security/restricted Sources
Hit http://in.archive.ubuntu.com trusty-updates/main Sources
Hit http://ppa.launchpad.net trusty/main Translation-en
Hit http://security.ubuntu.com trusty-security/universe Sources
Hit http://in.archive.ubuntu.com trusty-updates/restricted Sources
Hit http://security.ubuntu.com trusty-security/multiverse Sources
Hit https://repo.skype.com stable/main amd64 Packages
Hit http://in.archive.ubuntu.com trusty-updates/universe Sources
Hit http://extras.ubuntu.com trusty/main Sources
Ign ftp://apt.postgresql.org trusty-pgdg/main Translation-en
W: Failed to fetch http://dl.google.com/linux/chrome/deb/dists/stable/main/binary-amd64/Packages 403 Forbidden [IP: 172.217.26.206 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.
答案1
当您导入密钥并添加存储库时可能出现了问题 - 因此请从头开始删除导入的密钥并删除 Google Chrome 存储库。
搜索导入的 Google 密钥:apt-key adv --list-public-keys
删除导入的 Google 密钥:sudo apt-key del <key-ID>
删除 Google Chrome 存储库:sudo rm /etc/apt/sources.list.d/google-chrome.list
另外检查/etc/apt/sources.list
文件中是否存在旧的 Google Chrome 条目:
sudo nano /etc/apt/sources.list
如果发现旧条目,请将其删除。
导入 Google 密钥,添加 Google Chrome 存储库并按以下方式安装 Google Chrome:
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee /etc/apt/sources.list.d/google-chrome.list
wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo apt update
sudo apt install google-chrome-stable
请注意,Google Chrome 只能安装在 64 位 Linux 版本上 -更多信息请点击此处。
这些命令与您使用的命令略有不同,也许这就是原因...