我将一台计算机从 Ubuntu Desktop 18.04 LTS 升级到 20.04,然后又升级到 22.04。在此过程中,我遇到了与 snap 无法连接到服务器或其他问题相关的错误,但我并不在意,因为我不需要/不使用 snap 包...
...除了升级过程还需要将 Firefox 从传统的 apt 版本更改为 snap 版本。所以现在我根本没有 Firefox。我试过了按照此步骤安装 apt 包但它不起作用,可能是因为这个错误:
W: Failed to fetch https://ppa.launchpadcontent.net/mozillateam/ppa/ubuntu/dists/jammy/InRelease Could not handshake: An unexpected TLS packet was received. [IP: 134.226.56.7 8080]
W: Some index files failed to download. They have been ignored, or old ones used instead.
现在如果我尝试安装,apt
我会得到以下信息:
> sudo apt install firefox
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package firefox is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'firefox' has no installation candidate
如果我尝试使用以下命令安装snap
:
> snap install firefox
error: cannot install "firefox": Post "https://api.snapcraft.io/v2/snaps/refresh": proxyconnect
tcp: tls: first record does not look like a TLS handshake
我迷路了,如何找回 Firefox?(最好是 apt 版本)
更新:代理
此计算机位于代理后面。代理的配置如下这个问题,apt
但apt update
仍然有错误:
> sudo apt update
Ign:1 https://ppa.launchpadcontent.net/mozillateam/ppa/ubuntu jammy InRelease
Hit:2 http://archive.ubuntu.com/ubuntu jammy InRelease
Hit:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Get:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [109 kB]
Hit:5 http://archive.ubuntu.com/ubuntu jammy-security InRelease
Hit:6 http://dl.google.com/linux/chrome/deb stable InRelease
Ign:1 https://ppa.launchpadcontent.net/mozillateam/ppa/ubuntu jammy InRelease
Ign:1 https://ppa.launchpadcontent.net/mozillateam/ppa/ubuntu jammy InRelease
Err:1 https://ppa.launchpadcontent.net/mozillateam/ppa/ubuntu jammy InRelease
Could not handshake: An unexpected TLS packet was received. [IP: 134.226.56.7 8080]
Fetched 109 kB in 7s (15.4 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
3 packages can be upgraded. Run 'apt list --upgradable' to see them.
W: Failed to fetch https://ppa.launchpadcontent.net/mozillateam/ppa/ubuntu/dists/jammy/InRelease Could not handshake: An unexpected TLS packet was received. [IP: 134.226.56.7 8080]
W: Some index files failed to download. They have been ignored, or old ones used instead.
答案1
我没有成功设置 Mozilla 存储库,所以无法安装该deb
版本的 Firefox。
然而我最终还是能够安装该snap
版本,结果发现这个问题确实是由于我的代理造成的(感谢@nobody 和这个答案):
sudo snap set system proxy.http="http://my-proxy"
sudo snap set system proxy.https="http://my-proxy"
然后 snap 就可以正常工作了:
snap install firefox