我在 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
我该如何解决这个问题?
答案1
您必须先添加 Universe 存储库才能安装php5-mcrypt
-
Ubuntu 12.04 及以下版本 -
sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) universe"
Ubuntu 12.10 及以上版本 -
sudo add-apt-repository universe
更新您的软件列表 -
sudo apt-get update
安装软件包php5-mcrypt
-
sudo apt-get install php5-mcrypt
如果add-apt-repository
无法识别该命令,请运行以下命令 -
sudo apt-get install software-properties-common python-software-properties