** curl **不适用于Ubuntu 18.04 LTS

我无法使用curl从网上获取内容。 我试着把它放在下面的输出中。

某些软件包无法安装。 这可能意味着您已经请求了一个不可能的情况,或者如果您正在使用不稳定的分发,那么某些必需的包尚未创建或已被移出Incoming。 以下信息可能有助于解决此问题:

以下包具有未满足的依赖项。 curl:取决于:libcurl4(= 7.58.0-2ubuntu3)但它不会被安装E:无法纠正问题,你已经破坏了包裹。

我已经检查了包含sudo apt-mark showhelddpkg -l | grep ^h dpkg -l | grep ^h希望得到一个包含列表的列表,但我没有得到任何结果。

此外,当我尝试安装libcurl4它几乎会破坏我的系统,因为它试图删除下面的这些包。

libcurl3 mongodb-enterprise mongodb-enterprise-server mongodb-enterprise-tools msodbcsql msodbcsql17 mssql-tools php7.1-curl r-base r-base-core r-base-dev r-base-html r-cran-boot r-cran -class r-cran-codetools r-cran-foreign r-cran-getopt r-cran-kernsmooth r-cran-lattice r-cran-littler r-cran-mass r-cran-matrix r-cran-mgcv r-cran -nlme r-cran-nnet r-cran-rpart r-cran-spatial r-cran-survival r-recommended slack-desktop virtualbox-5.2

编辑

 # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to # newer versions of the distribution. deb http://gb.archive.ubuntu.com/ubuntu/ bionic main restricted deb-src http://gb.archive.ubuntu.com/ubuntu/ bionic main restricted ## Major bug fix updates produced after the final release of the ## distribution. deb http://gb.archive.ubuntu.com/ubuntu/ bionic-updates main restricted deb-src http://gb.archive.ubuntu.com/ubuntu/ bionic-updates main restricted ## NB software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team. Also, please note that software in universe WILL NOT receive any ## review or updates from the Ubuntu security team. deb http://gb.archive.ubuntu.com/ubuntu/ bionic universe deb-src http://gb.archive.ubuntu.com/ubuntu/ bionic universe deb http://gb.archive.ubuntu.com/ubuntu/ bionic-updates universe deb-src http://gb.archive.ubuntu.com/ubuntu/ bionic-updates universe ## NB software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team, and may not be under a free licence. Please satisfy yourself as to ## your rights to use the software. Also, please note that software in ## multiverse WILL NOT receive any review or updates from the Ubuntu ## security team. deb http://gb.archive.ubuntu.com/ubuntu/ bionic multiverse deb-src http://gb.archive.ubuntu.com/ubuntu/ bionic multiverse deb http://gb.archive.ubuntu.com/ubuntu/ bionic-updates multiverse deb-src http://gb.archive.ubuntu.com/ubuntu/ bionic-updates multiverse ## NB software from this repository may not have been tested as ## extensively as that contained in the main release, although it includes ## newer versions of some applications which may provide useful features. ## Also, please note that software in backports WILL NOT receive any review ## or updates from the Ubuntu security team. # deb-src http://gb.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse ## Uncomment the following two lines to add software from Canonical's ## 'partner' repository. ## This software is not part of Ubuntu, but is offered by Canonical and the ## respective vendors as a service to Ubuntu users. deb http://archive.canonical.com/ubuntu bionic partner deb-src http://archive.canonical.com/ubuntu bionic partner deb http://security.ubuntu.com/ubuntu bionic-security main restricted deb-src http://security.ubuntu.com/ubuntu bionic-security main restricted deb http://security.ubuntu.com/ubuntu bionic-security universe deb-src http://security.ubuntu.com/ubuntu bionic-security universe deb http://security.ubuntu.com/ubuntu bionic-security multiverse deb-src http://security.ubuntu.com/ubuntu bionic-security multiverse deb http://gb.archive.ubuntu.com/ubuntu/ bionic-proposed main multiverse universe restricted #Not for humans during development stage of release bionic # ded-src http://archive.ubuntu.com/ubuntu/ trusty-backports main restricted ui=niverse deb http://gb.archive.ubuntu.com/ubuntu/ bionic-backports main restricted multiverse universe 

这个问题在ubuntu最近的LTS中的多个包中很常见。 预安装的软件包在版本约定中可能存在错误,因为“18.04”和其他引用repo的字符串正在考虑作为软件包版本的一部分而不是对repo的引用。
解决方法是卸载预安装的依赖项,然后重新安装。 之后,您可以安装cURL。

 apt remove -y libcurl4 apt install -y libcurl4 curl 

具有该问题的其他包是okular和libsdl2,解决方案是相同的,跟踪有问题的依赖项,删除并重新安装。

此外,您可以使用apt downgrade机制 (因此,不必卸载依赖于libcurl4的软件包)。

 apt install -y libcurl4=7.58.0-2ubuntu3 apt install -y curl 

从源安装curl。 这对我有用

git clone https://github.com/curl/curl.git

https://curl.haxx.se/docs/install.html

./buildconf ./configure make make test(可选)sudo make install