Thursday, October 28, 2021

[SOLVED] Cannot find php-curl package

Issue

I am struggling with the php-curl installation which cannot be found, I have seen plenty of topics related to it but it unfortunatelly did not help much. I want it for an curl function in a php program. I tried it via adding ppa:ondrej/php repository, but I think it simply does not help much.

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

More info about versions and system running it:

  1. My php version is 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 version
$ uname -irv
5.4.0-kali3-amd64 #1 SMP Debian 5.4.13-1kali1 (2020-01-20) unknown
  1. sources
$ cat /etc/apt/sources.list | grep -v "#"
deb-src http://http.kali.org/kali kali-rolling main non-free contrib

I found there might have been some bugs


Solution

It was an issue with sources.list changed a lot time ago.

I updated it with other repositiories and it started working.

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

Next I have run sudo apt-get update.

Now I am able to see all the packages that were missing before.



Answered By - Brochu