我sudo apt-get install chromium-browser
在终端上运行以安装 Chromium。我得到了这个:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
chromium-browser
0 upgraded, 1 newly installed, 0 to remove and 31 not upgraded.
Need to get 0 B/48.3 kB of archives.
After this operation, 164 kB of additional disk space will be used.
Preconfiguring packages ...
Selecting previously unselected package chromium-browser.
(Reading database ... 210209 files and directories currently installed.)
Preparing to unpack .../chromium-browser_1%3a85.0.4183.83-0ubuntu0.20.04.2_amd64.deb ...
=> Installing the chromium snap
==> Checking connectivity with the snap store
==> Installing the chromium snap
error: cannot install "chromium": cannot query the store for updates: got
unexpected HTTP status code 408 via POST to
"https://api.snapcraft.io/v2/snaps/refresh"
dpkg: error processing archive /var/cache/apt/archives/chromium-browser_1%3a85.0.4183.83-0ubuntu0.20.04.2_amd64.deb (--unpack):
new chromium-browser package pre-installation script subprocess returned error exit status 1
Errors were encountered while processing:
/var/cache/apt/archives/chromium-browser_1%3a85.0.4183.83-0ubuntu0.20.04.2_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
如何在我的笔记本电脑上安装 Chromium 浏览器?我尝试了网上很多方法。但都不起作用
答案1
运行以下命令确实对我有帮助:
sudo service snapd restart
sudo snap set system proxy.http=""
sudo snap set system proxy.https=""
sudo snap refresh
sudo snap install snap-shop
sudo snap install snapd
请注意,最后一行安装了 snap。之后,我可以安装任何我想要的 snap。我认为在将 Ubuntu 18.04 LTS 升级到 20.04 LTS 期间出了点问题snap
。snapd
如果再次失败,可以通过以下方式手动下载 snap:
sudo snap download snap-shop
sudo snap download snapd
按照打印的说明,您现在可以通过以下方式安装它们:
snap ack snapd_16778.assert
snap install snapd_16778.snap
snap ack snapd-shop_60.assert
snap install snap-shop_60.snap
请注意,修订号(文件名后缀)可能会改变。
答案2
错误:“通过 POST 收到意外的 HTTP 状态代码 408”表示 snap store 服务器未在服务器分配的时间内收到来自客户端的完整请求。错误代码:“子进程 /usr/bin/dpkg 返回错误代码 (1)”表示 dpkg 数据库损坏。我建议使用以下终端命令来解决问题。通过以下命令重新配置 dpkg
sudo dpkg --configure -a
使用命令修复损坏的软件包
sudo apt install--fix-broken
从 ubuntu 存储库而不是 snap 商店安装 chromium。
sudo apt update
sudo apt upgrade
sudo apt install chromium-browser