错误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 sourceE: 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 multiversedeb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiversedeb 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