3

apt-get install php5-cgi says:

Package php5-cgi is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

The package php5-cgi has obviously been removed from Ubuntu Xenial. So what are my options? Is there a new version of this package that I should use? Can I just download a .deb from an older repository? Does it mean that applications that were using this package will stop working?

3 Answers3

7

The new package is php7.0-cgi. php5 is being replaced with 7.0. I would strongly installing the newest version.

sudo apt-get install php7.0-cgi

However I would recommend installing php-cgi meta package that depends on php7.0-cli for Ubuntu 16.04 to ensure you will always get latest PHP version on upgrades:

sudo apt-get install php-cgi

anonymous2
  • 4,298
  • That's correct! The only way to give commands independent of version numbers! That "meta package" showed me the way! – centurian Oct 12 '16 at 15:14
2

Yes php5 has completely been removed from 16.04 LTS and uses php7.0 but you can fix that easily by :

sudo apt-get install php7.0-cgi
Videonauth
  • 33,355
  • 17
  • 105
  • 120
2

For installing old software in a new Ubuntu Version, the old repositories have to be included.

Just replacing new by old packages

Be aware that old packages might replace new packages with this first way, but apt will warn you if this is the case and you still have the option to interrupt the downgrade:

  1. Open the file /etc/apt/sources.list
  2. Open the page https://repogen.simplylinux.ch/ and create a repository-list with your needs.
  3. Copy the repository-list in the file /etc/apt/sources.list ADDITIONALLY to the existing content. You can mark the old repositories with Ubuntu Version in a comment like ## Trusty 14.04 ##, then save the file.
  4. in the Terminal (Bash, Sh, ...) run apt update apt search php5 If you search something else than php5, just replace it by your own requirement.
  5. Search the package(s) you want to install and run

    apt-get install php5-cgi

Here you can enter also another package instead if php5-cgi, you shouldn't install what you never need.

Installing different PHP versions side by side

For php exist different possibilities, the list is not complete, some examples:

For other software than php you've to find different solutions for parallel installation.

David
  • 121