文章目录
1. 问题:E: Package 'curl' has no installation candidate2. 解决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
2. 解决
备份系统自带的源:
sudo cp /etc/apt/sources.list /etc/apt/sources.list.back
复制阿里或者清华源:
阿里源: /mirror
清华源:https://mirrors.tuna./help/ubuntu/
本人使用的是阿里源,以及是Ubuntu系统,ubuntu 18.04(bionic) 配置如下:
deb /ubuntu/ bionic main restricted universe multiversedeb-src /ubuntu/ bionic main restricted universe multiversedeb /ubuntu/ bionic-security main restricted universe multiversedeb-src /ubuntu/ bionic-security main restricted universe multiversedeb /ubuntu/ bionic-updates main restricted universe multiversedeb-src /ubuntu/ bionic-updates main restricted universe multiversedeb /ubuntu/ bionic-proposed main restricted universe multiversedeb-src /ubuntu/ bionic-proposed main restricted universe multiversedeb /ubuntu/ bionic-backports main restricted universe multiversedeb-src /ubuntu/ bionic-backports main restricted universe multiverse
打开/etc/apt/sources.list文件,将原来的内容删除,然后将上述ubuntu 18.04(bionic) 的配置,粘贴上,保存:
sudo vi /etc/apt/sources.list
输入命令sudo apt-get update进行更新:
sudo apt-get update
最后,下载curl:
sudo apt-get install curl
Reading package lists... DoneBuilding dependency tree Reading state information... DoneThe following additional packages will be installed:libcurl4The following NEW packages will be installed:curlThe following packages will be upgraded:libcurl41 upgraded, 1 newly installed, 0 to remove and 448 not upgraded.Need to get 378 kB of archives.After this operation, 411 kB of additional disk space will be used.Do you want to continue? [Y/n] yGet:1 /ubuntu bionic-security/main amd64 libcurl4 amd64 7.58.0-2ubuntu3.16 [220 kB]Get:2 /ubuntu bionic-security/main amd64 curl amd64 7.58.0-2ubuntu3.16 [159 kB]Fetched 378 kB in 0s (1,739 kB/s)(Reading database ... 228625 files and directories currently installed.)Preparing to unpack .../libcurl4_7.58.0-2ubuntu3.16_amd64.deb ...Unpacking libcurl4:amd64 (7.58.0-2ubuntu3.16) over (7.58.0-2ubuntu3.9) ...Selecting previously unselected package curl.Preparing to unpack .../curl_7.58.0-2ubuntu3.16_amd64.deb ...Unpacking curl (7.58.0-2ubuntu3.16) ...Setting up libcurl4:amd64 (7.58.0-2ubuntu3.16) ...Setting up curl (7.58.0-2ubuntu3.16) ...Processing triggers for man-db (2.8.3-2ubuntu0.1) ...Processing triggers for libc-bin (2.27-3ubuntu1) ...