4

I'd like to upgrade to python-pillow but the default install (Ubuntu 14.04.5) has given me python-pil.

> sudo apt-get install python-pillow
...
dpkg: error processing archive /var/cache/apt/archives/python-pillow_2.7.0-1_amd64.deb (--unpack):
 trying to overwrite '/usr/bin/pilfont.py', which is also in package python-pil 2.3.0-1ubuntu3
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
...

OK, a conflict. Let me just remove that package cos I don't want it...

> sudo apt-get remove -f python-pil
...
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 python-allspeak-rest : Depends: python-pillow (>= 2.7.0)
 python-imaging : Depends: python-pil but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

Might as well give what it says a shot...

> sudo apt-get -f install
...
The following NEW packages will be installed:
  python-pillow
...
dpkg: error processing archive /var/cache/apt/archives/python-pillow_2.7.0-1_amd64.deb (--unpack):
 trying to overwrite '/usr/bin/pilfont.py', which is also in package python-pil 2.3.0-1ubuntu3
...

Back where I started. Can't remove the old or install the new. What can I do now?


UPDATE:

I can force uninstall python-pil with the following (from here):

sudo dpkg -r --force-depends python-pil

But now I end up with errors such as:

The following packages have unmet dependencies:
 python-allspeak-rest : Depends: python-pillow (>= 2.7.0)
 python-imaging : Depends: python-pil but it is not going to be installed

I can't have both installed at the same time and yet dependencies say I need to.

jozxyqk
  • 1,181
  • 1
  • 15
  • 28

2 Answers2

2

This isn't a good solution at all, but it's what worked for me (copied from the comments):

Well, I finally got everything behaving by allowing file overwriting during the install sudo dpkg -i --force-overwrite /var/cache/apt/archives/python-pillow_2.7.0-1_amd64.deb (see this). Not a nice solution since the package manager won't know which package those files came from. But at least I can get on with what I'm doing.

jozxyqk
  • 1,181
  • 1
  • 15
  • 28
2

If you are still looking for correct answer, then it is to raise bug report versus python-pillow about this.

apport-bug python-pillow

Possible solutions:

  • Change the name of /usr/bin/pilfont.py in python-pillow, because it's the fork.
  • Change the name of /usr/bin/pilfont.py in both python-pillow & python-pil and both should use update-alternatives to create /usr/bin/pilfont.py symlink.
  • python-pillow declare python-pil in Breaks: field, so they could not get installed together in same system (It like pulling the trigger for a war :D).

BTW, python-pillow is removed from Ubuntu 16.04.

user.dz
  • 49,176