E: Package ‘curl‘ has no installation candidate

错误1:

E: Package 'curl' has no installation candidate

Package curl 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 'curl' has no installation candidate

解决方法:

可能是因为源的问题

1、备份系统自带的源:

sudo cp /etc/apt/sources.list /etc/apt/sources.list.back

2、复制阿里或者清华源:

阿里源: 阿里巴巴开源镜像站-OPSX镜像站-阿里云开发者社区
清华源:ubuntu | 镜像站使用帮助 | 清华大学开源软件镜像站 | Tsinghua Open Source Mirror

配置如下:

deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

3、打开/etc/apt/sources.list文件,将原来的内容删除,然后将上述ubuntu 18.04(bionic)
的配置,粘贴上,保存:

sudo vi /etc/apt/sources.list

4、输入命令sudo apt-get update进行更新:

sudo apt-get update

5、最后,下载curl:

sudo apt-get install curl

错误2:

curl : Depends: libcurl4 (= 7.58.0-2ubuntu3.24) but 7.68.0-1ubuntu4 is to be installed

其实按照字面描述就是curl依赖的libcurl4这个模块的这个版本装高了,换个低版本

sudo apt install libcurl4=7.58.0-2ubuntu3.19
sudo apt install curl

  • 2
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值