I can't install php7.0-xml

I have a very strange problem.

I use: Ubuntu 16.04.6 LTS I have two running versions of php: php5 and php7.0

I want to install php7.0-xml but when I type in the following command:

apt-get install php7.0-xml

I get this:

Reading package lists... Done
Building dependency tree... 50%
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.0-xml : Depends: php7.0-common (= 7.0.33-1~dotdeb+8.1) but is to be installed
E: Unable to correct problems, you have held broken packages.

I do this:

sudo apt-get install php7.0-common

and I get this:

Reading package lists... Done
Building dependency tree
Reading state information... Done
php7.0-common is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 7 not upgraded.

I am very confused. How php7.0-common is installed but php7.0-xml does not want to be installed? How can I fix that?

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hey friend,

Great question! It looks to me like you may have added the dotdeb repositories to your Ubuntu install. I don’t know if you can reasonably work this backward without causing issues, because you’ve likely already installed packages from the dotdeb repo that you’re using.

You could try disabling the dotdeb repo first and see if that helps. That likely either means temporarily removing a file from /etc/apt/sources.list.d, or commenting out the lines for it (adding “#” before the lines) in /etc/apt/sources.list, followed by an “apt-get update” to refresh packages.

If that fails, and I were in your position, I would consider creating a new server and setting it up without the dotdeb repo. It wasn’t really made to compliment Ubuntu and will very likely cause package conflicts along the way.