1

I am using linux debian 8. I have webmin/virtualmin installed and 1 domain is running over the server. Php version is 7.1. But, i can not run curl on my server. i tried to install curl but it throws below error

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

I have tried all below commands which are not working:

sudo apt-get -f install 
sudo apt-get update 
sudo apt-get clean 
sudo apt-get upgrade

sudo apt-get update shows below errors:

W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://packages.sury.org jessie InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B188E2B695BD4743

W: Failed to fetch http://debian.mirrors.ovh.net/debian/dists/jessie-updates/InRelease  Unable to find expected entry 'main/source/Sources' in Release file (Wrong sources.list entry or malformed file)

W: Failed to fetch https://packages.sury.org/php/dists/jessie/InRelease

W: Some index files failed to download. They have been ignored, or old ones used instead.}

my sources.list file content:

# deb cdrom:[Debian GNU/Linux 8.7.1 _Jessie_ - Official amd64 NETINST Binary-1 20170116-10:57]/ jessie main

#deb cdrom:[Debian GNU/Linux 8.7.1 _Jessie_ - Official amd64 NETINST Binary-1 20170116-10:57]/ jessie main

deb http://debian.mirrors.ovh.net/debian jessie main
deb-src http://debian.mirrors.ovh.net/debian jessie main

deb http://security.debian.org/ jessie/updates main
deb-src http://security.debian.org/ jessie/updates main

# jessie-updates, previously known as 'volatile'
deb http://debian.mirrors.ovh.net/debian jessie-updates main
deb-src http://debian.mirrors.ovh.net/debian jessie-updates main
deb http://software.virtualmin.com/vm/6/gpl/apt virtualmin-jessie main
deb http://software.virtualmin.com/vm/6/gpl/apt virtualmin-universal main
GAD3R
  • 66,769
Amit
  • 7
  • Then you can see there is something wrong in your apt configuration... please add the content of /etc/apt/sources.list file in your post. And by the way, is your server connected on internet and able to go out? – darxmurf May 10 '19 at 06:07
  • yes, my website is live. only curl portion is not running. – Amit May 10 '19 at 06:09
  • I have added sources.list file in question part – Amit May 10 '19 at 06:13

2 Answers2

0

Well, not sure if you did run correctly your command as everything is in one line

apt-get clean
apt-get update
apt-get install php-curl

if you run apt-get upgrade this will upgrade all the package on your system, not install curl. But it's something to do anyway to keep your system up to date.

okay, it looks like you are in France, then I would suggest to change your sources.list as follow

deb http://ftp.fr.debian.org/debian/ jessie main  
deb http://security.debian.org/ jessie/updates main

# jessie-updates, previously known as 'volatile'
deb http://ftp.fr.debian.org/debian/ jessie-updates main

deb http://software.virtualmin.com/vm/6/gpl/apt virtualmin-jessie main
deb http://software.virtualmin.com/vm/6/gpl/apt virtualmin-universal main

it looks like you also have this "sury.org" repository for PHP, I don't know it but you will need to install it's key as described in his readme file.

wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg

As I don't know this repository at all, it's your decision to install this key and use it.

Then save your file and run apt-get update to see the result

darxmurf
  • 1,132
  • yes, i run each command separately. I just don't how to break line in stackexchange – Amit May 10 '19 at 05:49
  • if still not working, please paste the result of those 3 commands (edit your question to do that and use the "{}" button to format it the right way) – darxmurf May 10 '19 at 05:52
  • apt-get clean return no result – Amit May 10 '19 at 05:55
  • I have added result for apt-get update in the question part – Amit May 10 '19 at 06:00
  • i just want to resolve below error in my php file. let me know if there is any other way. Call to undefined function curl_init() – Amit May 10 '19 at 06:25
  • Yes, for that you need to install php-curl and to install php-curl you need to have a working apt configuration... without that nothing will work – darxmurf May 10 '19 at 06:30
  • I am in India, not in france. do you still want me to try your commands? – Amit May 10 '19 at 06:50
  • where is your server? Please edit the mirror address in your sources.list using the closest country from this list: https://www.debian.org/mirror/list then run apt-get update – darxmurf May 10 '19 at 07:02
  • i bought this server from OVH.com .. they allocated may be from north america or europe – Amit May 10 '19 at 07:04
  • Anyway, you can use the french or american address, it should works, the only difference will be the speed – darxmurf May 10 '19 at 07:14
  • You can use these in your source.list, should work wherever: deb http://cdn-fastly.deb.debian.org/debian jessie main and deb http://cdn-fastly.deb.debian.org/debian-security jessie/updates main . I would expect that OVH provides their own mirror, check their documentation. – wurtel May 10 '19 at 09:13
  • i tried your solutions. But, its not working. – Amit May 11 '19 at 01:32
  • @wurtel, i tried cdn urls, it gave below error. W: Failed to fetch http://cdn-fastly.deb.debian.org/debian/dists/jessie-updates/InRele ase Unable to find expected entry 'main/source/Sources' in Release file (Wrong source s.list entry or malformed file) – Amit May 11 '19 at 03:30
  • Could you please check your server is connected to internet and able to browse outside... – darxmurf May 12 '19 at 14:58
  • Closing this as a duplicate, as per the comment at https://unix.stackexchange.com/questions/518141/php-curl-not-getting-installed-on-debian-8#comment958074_518428 – Jeff Schaller May 12 '19 at 15:17
0

W: Failed to fetch http://debian.mirrors.ovh.net/debian/dists/jessie-updates/InRelease Unable to find expected entry 'main/source/Sources' in Release file (Wrong sources.list entry or malformed file)

You should remove the jessie-updates from your /etc/apt/sources.list:

deb http://debian.mirrors.ovh.net/debian jessie main
deb-src http://debian.mirrors.ovh.net/debian jessie main

deb http://security.debian.org/ jessie/updates main deb-src http://security.debian.org/ jessie/updates main

deb http://software.virtualmin.com/vm/6/gpl/apt virtualmin-jessie main deb http://software.virtualmin.com/vm/6/gpl/apt virtualmin-universal main

see : Failed to fetch jessie backports repository and Debian apt-get update says ''Unable to find expected entry"

W: Failed to fetch https://packages.sury.org/php/dists/jessie/InRelease

W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://packages.sury.org jessie InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B188E2B695BD4743

Because the the siging key has been changed in 18 Mars 2019 by Ondřej Surý (A debian developper, php maintainer and more ...). You need to update the signing key.

packages.sury.org Debian repository GPG key has been changed

DPA New Signing Key

I was informed that the current DPA signing key DF3D585DB8F0EB658690A554AC0E47584A7A714D was present on the server maintained by an other user of the repositories that got compromised. I do not believe that the users of the packages.sury.org repositories are at any risk because launching attack on the APT repositories using a compromised key would require also attacking other components in the path (HTTPS certificate and DNSSEC), but nevertheless, I have generated a new GPG key to sign the repositories with: 15058500A0235D97F5D10063B188E2B695BD4743. To verify the authenticity of the new key, you can check that there's a signature from my personal signing key: 30B9 33D8 0FCE 3D98 1A2D 38FB 0C99 B70E F4FC BB07.

To update the APT signing key, you can download the new key from the respective repositories, f.e. for the PHP, you would do:

wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg

This doesn't affect any of the Launchpad PPAs, only the Debian packages hosted at packages.sury.org.

GAD3R
  • 66,769
  • 1
    your above answer is not working. But one of your previous answer worked for me. below is your previous answer that worked for me. https://unix.stackexchange.com/questions/443192/debian-8-apt-get-update-showing-404-not-found – Amit May 12 '19 at 03:07