0

I am using this command sudo apt-get install php7.4-gd

E: Unable to locate package php7.4-gd
E: Couldn't find any package by glob 'php7.4-gd'
E: Couldn't find any package by regex 'php7.4-gd'

I am trying to install a gd library in php7.4 but can't install it. The above error is shown in the terminal.

Wai Ha Lee
  • 8,598
  • 83
  • 57
  • 92
dhaval kakani
  • 17
  • 1
  • 3
  • 1
    Does this answer your question? [install php70-gd on ubuntu](https://stackoverflow.com/questions/34367917/install-php70-gd-on-ubuntu) – catcon Jul 02 '21 at 06:15
  • Although the title of my suggested duplicate says php7.0, the accepted answer does show you how to install gd lib for php7.4 – catcon Jul 02 '21 at 06:17
  • i have use below command. sudo add-apt-repository ppa:ondrej/php sudo apt-get update sudo apt-get install php7.4-gd (THIS IS NOT WORKING) – dhaval kakani Jul 02 '21 at 06:21
  • do you have the same error? – catcon Jul 02 '21 at 06:24
  • yes, i am trying this commnd and show below errors in php version 7.4 E: Unable to locate package php7.4-gd E: Couldn't find any package by glob 'php7.4-gd' E: Couldn't find any package by regex 'php7.4-gd' – dhaval kakani Jul 02 '21 at 06:36
  • 1
    I'm just guessing that, since Ubuntu is based on Debian, version 7.4 of PHP isn't available yet on the stable branch. Check with `sudo apt search php7.4`. If that is the case, you'll need to install from an upstream repository. Preferrably from [Sury](https://deb.sury.org/). – Code4R7 Jul 02 '21 at 07:16

2 Answers2

0

keep it simple

apt-get install php-gd
cottontail
  • 10,268
  • 18
  • 50
  • 51
dave
  • 1
0

If you're Ubuntu version is < 16.04:

// Adding some compiled PHP extensions to your repository list
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update

Then properly install the GD extension

sudo apt-get install php7.4-gd