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

尝试为mediawiki安装程序安装php-mbstring

在第一次尝试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 

您缺少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 

您知道的包裹信息已过期。

使用rmadison工具,我们可以在repos中看到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 

虽然我只在这里展示Bionic项目。

因为您的系统不知道安全性或更新repos中的较新的php7.2-mbstring ,所以您的版本不匹配。

运行这个:

 sudo apt-get update sudo apt-get upgrade sudo apt-get install php7.2-mbstring 

这应该有助于将您的版本恢复到他们需要的位置。 (注意,您可能希望使用dist-upgrade而不是upgrade以便更新的内核包等软件包也得到安装和升级)