How can I install a package with specific PHP versions if the package itself does not contrain it?

Ask Ubuntu Asked on January 3, 2022

My package does not define specific PHP version in its dependency, but only works with older PHP versions (7.2). On Ubuntu 20.04 the apt install <my-package> will want to install php7.4-mysql, unless I explicitelly install php7.2-mysql.

Is there a solution to configure PHP (repositories, versions) and/or apt in a way that apt install <my-package> can only install its dependency for specific PHP versions?

One Answer

If the repository contains more than on version it is possible to install that certain version with:

sudo apt install <my-package>=<X.Y> e.g.

sudo apt install php=7.2

but the chances are low that there are more versions of php. (They must be compiled against the current libraries, so maintenance of different versions costs quite some time)

You could add a ppa which is compatible with 20.04, or you can download the appropriate deb files.

Those files can be installed either with the gdebi installer (GUI frontend( or by hand: `sudo dpkg -i <name-of-debfile.deb>

Answered by kanehekili on January 3, 2022

Add your own answers!

Related Questions

Ubuntu emulator not boot up with fglrx

0  Asked on October 31, 2021 by inglebard


Unable to process upgrades due to error with snmpd

1  Asked on October 31, 2021 by malchesador


apache2 welcome page not showing

1  Asked on October 31, 2021


command ‘go’ not found

5  Asked on October 31, 2021


a2dp-sink profile connect failed

5  Asked on October 31, 2021 by keddad


Only “Dummy output” (sound) in Ubuntu 20.04 after reboot – Broken driver / module

8  Asked on October 31, 2021 by sancho-s-reinstatemonicacellio


arrow/exclamation symbol on top bar

1  Asked on October 31, 2021


Samsung printer m2070 no working on ubuntu

1  Asked on October 31, 2021 by vladimir-usora


Wine in Ubuntu cannot create temporary directory error?

0  Asked on October 31, 2021 by aman-grover


Malformed security header

1  Asked on October 31, 2021 by mh-shuvo


Evince shows small frame in Presentation mode

2  Asked on October 31, 2021 by popoolmica


Keyboard Stops working after flashing not allowed sign

0  Asked on October 31, 2021 by piyush-sharma


Can’t get 4k @ 60hz, only 30hz

2  Asked on October 31, 2021 by tumdum


Clamav – OnAccessMountPath & OnAccessPrevention

0  Asked on October 31, 2021 by polik989


Ask a Question

Get help from others!

© 2023 All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP