Ubuntu 服务器 12.04.5 软件包 php5-mcrypt 不可用

f.f*_*rah 1 server 12.04

我在 Ubuntu Server 12.04.5 上我正在尝试安装 php5-mcrypt。我收到这个错误。

~$ 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
Run Code Online (Sandbox Code Playgroud)

我该如何解决这个问题?

Roh*_*van 5

您必须首先添加要安装的 Universe 存储库php5-mcrypt-

Ubuntu 12.04 及以下 -

sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) universe"
Run Code Online (Sandbox Code Playgroud)

Ubuntu 12.10 及更高版本 -

sudo add-apt-repository universe
Run Code Online (Sandbox Code Playgroud)

更新您的软件列表 -

sudo apt-get update
Run Code Online (Sandbox Code Playgroud)

安装包php5-mcrypt-

sudo apt-get install php5-mcrypt
Run Code Online (Sandbox Code Playgroud)

如果add-apt-repository无法识别该命令,请运行以下命令 -

sudo apt-get install software-properties-common python-software-properties
Run Code Online (Sandbox Code Playgroud)