![Ubuntu 18.04 中 php7.2-mbstring 软件包未满足依赖关系](https://linux22.com/image/1064674/Ubuntu%2018.04%20%E4%B8%AD%20php7.2-mbstring%20%E8%BD%AF%E4%BB%B6%E5%8C%85%E6%9C%AA%E6%BB%A1%E8%B6%B3%E4%BE%9D%E8%B5%96%E5%85%B3%E7%B3%BB.png)
尝试安装php-mbstring用于 mediawiki 设置。
第一次尝试后已经添加了宇宙存储库:Ubuntu 18.04 中缺少 php7.2-mbstring 软件包
但让我很难这里详细信息:
usertilo@myserver4:~$ sudo apt-get 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.
usertilo@myserver4:~$ sudo apt-get 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.
usertilo@myserver4:~$ uname -a
Linux myserver4 4.15.0-29-generic #31-Ubuntu SMP Tue Jul 17 15:39:52 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
usertilo@myserver4:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.1 LTS
Release: 18.04
Codename: bionic
usertilo@myserver4:~$ sudo apt-get install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
usertilo@server4:~$ sudo apt-get install php7.2-common
Reading package lists... Done
Building dependency tree
Reading state information... Done
php7.2-common is already the newest version (7.2.7-0ubuntu0.18.04.2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
- 更新添加评论请求的信息
usertilo@myserver4:~$ sudo apt-cache policy php7.2-common php7.2-mbstring
php7.2-common:
Installed: 7.2.7-0ubuntu0.18.04.2
Candidate: 7.2.7-0ubuntu0.18.04.2
Version table:
*** 7.2.7-0ubuntu0.18.04.2 500
500 http://archive.ubuntu.com/ubuntu bionic-security/main amd64 Packages
500 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
100 /var/lib/dpkg/status
7.2.3-1ubuntu1 500
500 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages
php7.2-mbstring:
Installed: (none)
Candidate: 7.2.3-1ubuntu1
Version table:
7.2.3-1ubuntu1 500
500 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
usertilo@myserver4:~$ cat /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu bionic main universe
deb http://archive.ubuntu.com/ubuntu bionic-security main
# deb-src http://archive.ubuntu.com/ubuntu bionic universe
deb http://archive.ubuntu.com/ubuntu bionic-updates main
usertilo@myserver4:~$ cat /etc/apt/sources.list.d/*
cat: '/etc/apt/sources.list.d/*': No such file or directory
答案1
您缺少 的一些必要渠道sources.list
。请sudo gedit /etc/apt/sources.list
按照以下步骤操作:
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
保存并退出。然后更新你的存储库:
sudo apt update
然后安装php-mbstring
:
sudo apt install php7.2-mbstring
答案2
您所了解的包裹信息apt
已过期。
使用该工具,我们可以看到存储库中rmadison
的所有版本:php7.2-mbstring
php7.2-mbstring | 7.2.3-1ubuntu1 | bionic/universe | amd64, arm64, armhf, i386, ppc64el, s390x
php7.2-mbstring | 7.2.7-0ubuntu0.18.04.2 | bionic-security/universe | amd64, arm64, armhf, i386, ppc64el, s390x
php7.2-mbstring | 7.2.7-0ubuntu0.18.04.2 | bionic-updates/universe | amd64, arm64, armhf, i386, ppc64el, s390x
尽管我在这里只展示仿生物品。
由于您的系统不知道php7.2-mbstring
安全或更新存储库中的较新版本,因此您收到版本不匹配的情况。
运行这个:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install php7.2-mbstring
这将有助于将您的版本恢复到所需的状态。(请注意,您可能希望使用dist-upgrade
而不是upgrade
,以便更新的内核软件包等软件包也能安装和升级)