找不到 php-curl 包

Cannot find php-curl package

我正在为无法找到的 php-curl 安装而苦苦挣扎,我已经看到了很多与之相关的主题,但不幸的是,它并没有太大帮助。我想要它用于 php 程序中的 curl 函数。 我通过添加 ppa:ondrej/php 存储库进行了尝试,但我认为它根本没有多大帮助。

kali@kali$ sudo apt-get install php7.3
php7.3           php7.3-common    php7.3-mysql     php7.3-readline          
php7.3-cli       php7.3-json      php7.3-opcache                            
kali@kali:$ sudo apt-get install php7.3-curl                 
Reading package lists... Done                                               
Building dependency tree                                                    
Reading state information... Done                                           
E: Unable to locate package php7.3-curl                                     
E: Couldn't find any package by glob 'php7.3-curl'                          
E: Couldn't find any package by regex 'php7.3-curl'                         
kali@kali:$ sudo apt-get install php7-curl
Reading package lists... Done                                               
Building dependency tree                                                    
Reading state information... Done                                                                            
E: Unable to locate package php7-curl
$ sudo apt-get install php-curl
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package php-curl
$ sudo add-apt-repository ppa:ondrej/php
 Co-installable PHP versions: PHP 5.6, PHP 7.x and most requested extensions are included. Only Supported Versions of PHP (http://php.net/supported-versions.php) for Supported Ubuntu Releases (https://wiki.ubuntu.com/Releases) are provided. Don't ask for end-of-life PHP versions or Ubuntu release, they won't be provided.

Debian oldstable and stable packages are provided as well: https://deb.sury.org/#debian-dpa

You can get more information about the packages at https://deb.sury.org

IMPORTANT: The <foo>-backports is now required on older Ubuntu releases.

BUGS&FEATURES: This PPA now has a issue tracker:
https://deb.sury.org/#bug-reporting

CAVEATS:
1. If you are using php-gearman, you need to add ppa:ondrej/pkg-gearman
2. If you are using apache2, you are advised to add ppa:ondrej/apache2
3. If you are using nginx, you are advised to add ppa:ondrej/nginx-mainline
   or ppa:ondrej/nginx

PLEASE READ: If you like my work and want to give me a little motivation, please consider donating regularly: https://donate.sury.org/

WARNING: add-apt-repository is broken with non-UTF-8 locales, see
https://github.com/oerdnj/deb.sury.org/issues/56 for workaround:

# LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php
 More info: https://launchpad.net/~ondrej/+archive/ubuntu/php
Press [ENTER] to continue or ctrl-c to cancel adding it

gpg: keybox '/tmp/tmpfx71elke/pubring.gpg' created
gpg: /tmp/tmpfx71elke/trustdb.gpg: trustdb created
gpg: key 4F4EA0AAE5267A6C: public key "Launchpad PPA for Ondřej Surý" imported
gpg: Total number processed: 1
gpg:               imported: 1
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
gpg: no valid OpenPGP data found.
$ sudo apt-get update
Ign:1 http://ppa.launchpad.net/ondrej/php/ubuntu hirsute InRelease
Hit:2 https://download.docker.com/linux/debian buster InRelease                                             
Err:3 http://ppa.launchpad.net/ondrej/php/ubuntu hirsute Release                                            
  404  Not Found [IP: 91.189.95.85 80]
Hit:4 http://kali.koyanet.lv/kali kali-rolling InRelease                                                  
Hit:5 https://packages.gitlab.com/gitlab/gitlab-ce/debian jessie InRelease
Reading package lists... Done
E: The repository 'http://ppa.launchpad.net/ondrej/php/ubuntu hirsute Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

$ sudo apt-get install php
php7.3           php7.3-common    php7.3-mysql     php7.3-readline  php-defaults     
php7.3-cli       php7.3-json      php7.3-opcache   php-common       php-mysql 
///// still cannot see curl module

有关版本和系统的更多信息运行它:

  1. 我的php版本是7.3.12
kali@kali:$ php -v

PHP 7.3.12-1 (cli) (built: Nov 28 2019 07:34:08) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.12, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.12-1, Copyright (c) 1999-2018, by Zend Technologies
kali@kali:$ apt list --installed | grep php

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

libapache2-mod-php7.3/now 7.3.12-1 amd64 [installed,local]
libapache2-mod-php/now 2:7.3+69 all [installed,local]
php-common/now 2:69 all [installed,local]
php-mysql/now 2:7.3+69 all [installed,local]
php7.3-cli/now 7.3.12-1 amd64 [installed,local]
php7.3-common/now 7.3.12-1 amd64 [installed,local]
php7.3-json/now 7.3.12-1 amd64 [installed,local]
php7.3-mysql/now 7.3.12-1 amd64 [installed,local]
php7.3-opcache/now 7.3.12-1 amd64 [installed,local]
php7.3-readline/now 7.3.12-1 amd64 [installed,local]
 php -m
[PHP Modules]
calendar
Core
ctype
date
exif
fileinfo
filter
ftp
gettext
hash
iconv
json
libxml
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
Phar
posix
readline
Reflection
session
shmop
sockets
sodium
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
Zend OPcache
zlib

[Zend Modules]
Zend OPcache

  1. Kali 版本
$ uname -irv
5.4.0-kali3-amd64 #1 SMP Debian 5.4.13-1kali1 (2020-01-20) unknown
  1. 来源
$ cat /etc/apt/sources.list | grep -v "#"
deb-src http://http.kali.org/kali kali-rolling main non-free contrib

我发现可能存在一些错误

这是 sources.list 很久以前更改的问题。

我用其他存储库更新了它,它开始工作了。

deb http://http.kali.org/kali kali-rolling main non-free contrib
deb https://http.kali.org/kali kali-rolling main contrib non-free
deb-src http://http.kali.org/kali kali-rolling main non-free contrib
deb-src https://http.kali.org/kali kali-rolling main contrib non-free

接下来我有 运行 sudo apt-get update.

现在我可以看到之前丢失的所有包了。