4

When I try to use sudo apt-get install php5-mcrypt to install php5-mcrypt, I receive the following error. I used sudo apt-get install lamp-server^ to install the php5

ahmad@ubuntu:/var/www/html$ sudo apt-get install php5-mcrypt
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package php5-mcrypt 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

E: Package 'php5-mcrypt' has no installation candidate
2
  • What version of Ubuntu are you using?
    – edwinksl
    Jul 21, 2016 at 10:59
  • @edwinksl 16.04
    – Ahmad
    Jul 21, 2016 at 11:05

1 Answer 1

7

php5-mcrypt (MCrypt module for php5) has been updated to php7.0-mcrypt (libmcrypt module for PHP) in Ubuntu 16.04, 16.10 and 17.04. The command sudo apt-get install lamp-server^ in Ubuntu 16.04 searches the package list files for all Task: fields and gets all with lamp-server, among them is php7.0. Then it installs those packages the standard way with sudo apt-get install package1 package2...

In Ubuntu 16.04 open the terminal and type:

sudo apt-get install php7.0-mcrypt  

In Ubuntu 17.10 and 18.04 php5-mcrypt has been updated to php7.1-mcrypt.

2
  • This does not answer the question since we don't need mcrypt for PHP 7 but for PHP 5. Sep 12, 2018 at 19:05
  • 1
    The latest version that has php5-mcrypt in its default repositories is Ubuntu 14.04. php5-mcrypt can be downloaded manually from packages.ubuntu.com/trusty/php5-mcrypt.
    – karel
    Sep 12, 2018 at 19:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .