首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法安装php-mbstring

无法安装php-mbstring
EN

Ask Ubuntu用户
提问于 2018-08-12 11:53:13
回答 5查看 65.1K关注 0票数 11

我试图在一个已经安装了apache2、php和mariadb的Ubuntu18.04服务器上安装php。我尝试使用以下命令序列:

代码语言:javascript
复制
jonathan@samuel:~$ sudo apt update
[sudo] password for jonathan:
Hit:1 http://archive.ubuntu.com/ubuntu bionic InRelease
Hit:2 http://downloads.mariadb.com/MariaDB/mariadb-10.3/repo/ubuntu bionic InRelease
Get:3 http://archive.ubuntu.com/ubuntu bionic-security InRelease [83.2 kB]
Ign:4 http://downloads.mariadb.com/MaxScale/2.2/ubuntu bionic InRelease
Hit:5 http://downloads.mariadb.com/Tools/ubuntu bionic InRelease
Get:6 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Hit:7 http://downloads.mariadb.com/MaxScale/2.2/ubuntu bionic Release
Fetched 172 kB in 2s (91.6 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
jonathan@samuel:~$ sudo apt install php-mbstring
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 php-mbstring : Depends: php7.2-mbstring but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
jonathan@samuel:~$ sudo apt -f install php7.2-mbstring
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 php7.2-mbstring : Depends: php7.2-common (= 7.2.3-1ubuntu1) but 7.2.7-0ubuntu0.18.04.2 is to be installed
E: Unable to correct problems, you have held broken packages.

似乎存在一个无法解决的依赖关系。我怎样才能纠正这种情况?这个问题阻碍了我安装phpMyAdmin的尝试。

EN

回答 5

Ask Ubuntu用户

发布于 2018-08-12 16:29:06

我不得不在我的sources.list

中启用宇宙

代码语言:javascript
复制
sudo vi /etc/apt/sources.list

将文件改为如下所示:

代码语言:javascript
复制
deb http://archive.ubuntu.com/ubuntu bionic main universe
deb http://archive.ubuntu.com/ubuntu bionic-security main universe
deb http://archive.ubuntu.com/ubuntu bionic-updates main universe

更新了apt-get

代码语言:javascript
复制
sudo apt update

然后我可以安装php7.2-mbstring

票数 14
EN

Ask Ubuntu用户

发布于 2018-09-10 22:16:11

在Ubuntu18.04#编辑文件/etc/apt/ same中,我也遇到了同样的问题。

代码语言:javascript
复制
deb http://archive.ubuntu.com/ubuntu bionic main multiverse restricted universe
deb http://archive.ubuntu.com/ubuntu bionic-security main multiverse restricted universe
deb http://archive.ubuntu.com/ubuntu bionic-updates main multiverse restricted universe

#PHP7.2 ->保存并运行:

代码语言:javascript
复制
sudo apt update && sudo apt-get upgrade
sudo apt-get install php7.2-mbstring

#PHP7.3 ->保存并运行:

代码语言:javascript
复制
sudo apt update && sudo apt-get upgrade
sudo apt-get install php7.3-mbstring

一切都结束了

票数 8
EN

Ask Ubuntu用户

发布于 2019-08-17 01:44:51

只需使用:

代码语言:javascript
复制
sudo apt-get install php-mbstring

然后必须重新启动Apache服务,请使用:

代码语言:javascript
复制
sudo service apache2 restart
票数 1
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1064634

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档