在Ubuntu 18.04中打包php7.2-mbstring unmet依赖项


8

尝试安装php-mbstring进行MediaWiki设置。

第一次尝试Universe存储库后已添加: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
请向我们显示以下内容的输出,我想看看是否启用或禁用了不同的存储库可能是您遇到问题的原因,这将有助于您了解一些信息:(apt-cache policy php7.2-common php7.2-mbstring 此外,仅供参考,默认情况下,Universe已启用Ubuntu 18.04)
Thomas Ward

@TiloBunt您拥有哪些资源/etc/apt/sources.list?同样的问题来自/etc/apt/sources.list.d/*。这些就是您从中获取所有软件包的来源。因此,请确保一切正常。获取要安装的软件包的存储库,并检查是否在上述列表中包含其源代码。
苏格拉底

@ThomasWard和Socrates,向我的问题添加了信息。让我知道是否应该检查其他事项。这是一个全新的安装
TiloBunt

Answers:


16

您缺少的一些必要渠道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

这些命令对我不起作用。错误是一样的。我必须http://security.ubuntu.com/ubuntu/pool/universe/p/php7.2/php7.2-mbstring_7.2.15-0ubuntu0.18.04.1_amd64.deb通过dpkg -i命令进行下载并安装
Redbob,

谢谢您的修复,我只花了几个小时就知道这是解决方案。
Jeff Lange

0

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安装和升级更新的内核包之类的包)


尝试了这个,但结果相同。
TiloBunt

1
听起来好像您的系统未正确配置。向我们显示apt-cache policy我在注释中询问的同一命令的输出,以再次对其进行编辑,因为它看起来像您的存储库没有更新
Thomas Ward

感谢你的帮助。现在添加restricted固定的修复程序,我很好。该系统是在VM上的新安装,因此不确定如何快速搞乱配置,但可能会搞砸。干杯
TiloBunt
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.