Ubuntu 16.04.5 LTS:安装 curl 时出现问题

Ubuntu 16.04.5 LTS:安装 curl 时出现问题

我正在开始全新安装 Ubuntu 16.04.5 LTS 桌面,但无法安装 curl:

student@laptop:~/osm-install$ sudo apt install curl
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 curl : Depends: libcurl3-gnutls (= 7.47.0-1ubuntu2) but 7.47.0-1ubuntu2.8         is to be installed
E: Unable to correct problems, you have held broken packages.

VLC 和其他软件包也会出现同样的问题(其他依赖项也是如此)。我使用的是 Ubuntu 16.04.5,坦率地说,作为 LTS,我没想到会出现所有这些问题。

最好的,/佩德罗A

添加 apt 策略 curl libcurl3-gnutls:

student@laptop:~$ apt policy curl libcurl3-gnutls
curl:
  Installed: (none)
  Candidate: 7.47.0-1ubuntu2
  Version table:
     7.47.0-1ubuntu2 500
        500 http://es.archive.ubuntu.com/ubuntu xenial/main amd64 Packages
libcurl3-gnutls:
  Installed: 7.47.0-1ubuntu2.8
  Candidate: 7.47.0-1ubuntu2.8
  Version table:
 *** 7.47.0-1ubuntu2.8 100
        100 /var/lib/dpkg/status
     7.47.0-1ubuntu2 500
        500 http://es.archive.ubuntu.com/ubuntu xenial/main amd64 Packages

答案1

首先,使用以下命令清除本地包缓存

sudo apt clean

这可以防止apt尝试安装目前无法从存储库下载的缓存包版本。

然后,由于您已经安装了不兼容的版本libcurl3-gnutls,因此您需要在安装时curl通过指定所需的确切版本来降级该版本:

sudo apt install curl libcurl3-gnutls=7.47.0-1ubuntu2

如果您对其他包也遇到同样的错误,则可以使用相同的方法。

相关内容