受欢迎的博客标签

Debian 12:E: Package ‘curl‘ has no installation candidate

Published

E: Package ‘curl‘ has no installation candidate

 

 

 

 

OS

lsb_release -a
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 12 (bookworm)
Release:	12
Codename:	bookworm

 

1. 问题:E: Package ‘curl’ has no installation candidate

@debian:~# sudo apt install curl

output

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
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
 
 

2. 解决

备份系统自带的源:

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

复制源:


本人使用的是源,以及是debian系统,debian 12.1(bookworm) 配置如下:

打开/etc/apt/sources.list文件,将原来的内容删除,然后将上述debian 12.1(bookworm)
的配置,粘贴上,保存:
sudo vi /etc/apt/sources.list
#deb cdrom:[Debian GNU/Linux 12.1.0 _Bookworm_ - Official amd64 DVD Binary-1 with firmware 20230722-10:49]/ bookworm main non-free-firmware
deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware
deb http://deb.debian.org/debian-security/ bookworm-security main contrib non-free non-free-firmware
deb http://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware
 

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

sudo apt-get update
output
Get:1 http://deb.debian.org/debian bookworm InRelease [151 kB]
Get:2 http://deb.debian.org/debian-security bookworm-security InRelease [48.0 kB]
Get:3 http://deb.debian.org/debian bookworm-updates InRelease [55.4 kB]
Get:4 http://deb.debian.org/debian bookworm/main amd64 Packages [8,786 kB]
Get:5 http://deb.debian.org/debian bookworm/main Translation-en [6,109 kB]                                
Get:6 http://deb.debian.org/debian bookworm/main amd64 DEP-11 Metadata [4,492 kB]                         
Get:7 http://deb.debian.org/debian bookworm/main DEP-11 48x48 Icons [3,595 kB]     
 

最后,下载curl:

sudo apt install curl
output
sudo apt install curl
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  libcurl3-gnutls libcurl4
The following NEW packages will be installed:
  curl
The following packages will be upgraded:
  libcurl3-gnutls libcurl4
2 upgraded, 1 newly installed, 0 to remove and 201 not upgraded.
Need to get 1,090 kB of archives.
After this operation, 520 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://deb.debian.org/debian bookworm/main amd64 libcurl4 amd64 7.88.1-10+deb12u5 [390 kB]
Get:2 http://deb.debian.org/debian bookworm/main amd64 curl amd64 7.88.1-10+deb12u5 [315 kB]              
Get:3 http://deb.debian.org/debian bookworm/main amd64 libcurl3-gnutls amd64 7.88.1-10+deb12u5 [385 kB]   
Fetched 1,090 kB in 1min 29s (12.3 kB/s)