首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >curl没有在Ubuntu 18.04 LTS上工作

问curl没有在Ubuntu 18.04 LTS上工作
EN

Ask Ubuntu用户
提问于 2018-04-28 15:11:22
回答 5查看 72.6K关注 0票数 46

我不能使用“`curl”从网上获取内容。我试着安装它,得到了下面的输出:

代码语言:javascript
复制
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: libcurl4 (= 7.58.0-2ubuntu3) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

我已经用sudo apt-mark showheld和dpkg -l | grep ^h检查了保存的包,但也没有得到任何结果。

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

代码语言:javascript
复制
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

编辑

这是cat /etc/apt/sources.list的输出:

代码语言:javascript
复制
# 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

## N.B. 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

## N.B. 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

## N.B. 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
EN

回答 5

Ask Ubuntu用户

发布于 2018-07-04 02:22:39

这个问题在ubuntu最近的LTS中的多个包中很常见。预装包在版本约定中可能有错误,因为"18.04“和其他引用repo的字符串正在考虑作为包版本的一部分,而不是引用回购。

解决办法是卸载预装依赖项,然后重新安装。之后,您可以安装cURL。

代码语言:javascript
复制
apt remove -y libcurl4
apt install -y libcurl4 curl

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

此外,您还可以使用apt 降级机制 (因此,不需要卸载依赖于libcurl4的包)。

代码语言:javascript
复制
apt install -y libcurl4=7.58.0-2ubuntu3
apt install -y curl
票数 46
EN

Ask Ubuntu用户

发布于 2018-07-13 06:41:46

安装卷曲。对我起作用了。

代码语言:javascript
复制
git clone https://github.com/curl/curl.git
cd curl
./buildconf
./configure
make
make test # optional
sudo make install
票数 2
EN

Ask Ubuntu用户

发布于 2019-04-02 03:33:54

试着使用

代码语言:javascript
复制
sudo apt install libcurl4-openssl-dev

如果遇到任何错误,请尝试下面的命令,然后再使用上面的命令。

代码语言:javascript
复制
sudo apt update
sudo apt remove libcurl4
票数 2
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1029273

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档