1

I am using Ubuntu 22.04. Somehow, whenever I try to install a package in Ubuntu, I get this error

libjpeg-dev : Depends: libjpeg62-turbo-dev (>= 1:1.5.2-2+deb10u1) but it is not going to be installed

So I tried sudo apt -f install

But I got

dpkg: error processing archive /var/cache/apt/archives/libjpeg62-turbo-dev_1%3a1.5.2-2+deb10u1_amd64.deb (--unpack):
 trying to overwrite '/usr/include/jerror.h', which is also in package libjpeg-turbo8-dev:amd64 2.1.2-0ubuntu1

I tried to remove libjpeg8, but got an error

sudo apt-get remove libjpeg-turbo8-dev

The following packages have unmet dependencies: libjpeg-dev : Depends: libjpeg62-turbo-dev (>= 1:1.5.2-2+deb10u1) but it is not going to be installed

I tried to install libjpeg62

sudo apt-get install libjpeg62-turbo-dev

dpkg: error processing archive /var/cache/apt/archives/libjpeg62-turbo-dev_1%3a1.5.2-2+deb10u1_amd64.deb (--unpack): trying to overwrite '/usr/include/jerror.h', which is also in package libjpeg-turbo8-dev:amd64 2.1.2-0ubuntu1

I tried to install aptitude because it is said to be able to resolve package conflict, but got the same error

sudo apt-get install aptitude
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 aptitude : Depends: aptitude-common (= 0.8.13-3ubuntu1) but it is not going to be installed
            Depends: libcwidget4 (>= 0.5.18-1) but it is not going to be installed
            Depends: libxapian30 (>= 1.4.17~) but it is not going to be installed
 libjpeg-dev : Depends: libjpeg62-turbo-dev (>= 1:1.5.2-2+deb10u1) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

Output when I tried to run dpkg --configure

sudo dpkg --configure -a && sudo apt clean
dpkg: dependency problems prevent configuration of libjpeg-dev:
 libjpeg-dev depends on libjpeg62-turbo-dev (>= 1:1.5.2-2+deb10u1); however:
  Package libjpeg62-turbo-dev:amd64 is not installed.

dpkg: error processing package libjpeg-dev (--configure): dependency problems - leaving unconfigured Errors were encountered while processing: libjpeg-dev

Basically, in my system now there is a conflict in libjpeg8 and libjpeg62 which can't be fixed. What can I do to resolve this?

manh.vu
  • 111
  • 4
  • What OS & release are you using? Your pasted details show a debian old-old-stable package version and not a Ubuntu package. The Debian old old stable release will only ~align with non-LTS releases from EOL Ubuntu products (Debian releases on an odd year); you've polluted your system if it was Ubuntu. – guiverc Jul 27 '23 at 03:44
  • I am using Ubuntu 22.04 – manh.vu Jul 27 '23 at 03:48
  • If I polluted my system, how should I clean it? – manh.vu Jul 27 '23 at 03:48
  • Your detail shows deb10u1 where Debian 12 is stable, 11 being old-stable & 10 being old-old-stable, ie. you've polluted your system by adding old-old Debian packages which need removal. I'd start by checking your sources (apt update or read sources), then look at where/why & who added Debian packages to it. Those need to be removed which maybe quick/difficult depending on how polluted your system is; you can re-install. I'm not familiar with the packages thus don't know how easy/difficult it will be; I'd thus look at why/when installed & backtrack what was done – guiverc Jul 27 '23 at 03:52
  • Package mentioned is libjpeg62-turbo-dev | 1:1.5.2-2+deb10u1 | oldoldstable | amd64, arm64, armel, armhf, i386, mips, mips64el, mipsel, ppc64el, s390x which you'll NOTE isn't Ubuntu, but DEBIAN. My search on Ubuntu resources with it returned blank; only results being Debian from 2019 – guiverc Jul 27 '23 at 03:55

1 Answers1

0

The solution was to remove by running

sudo apt-get remove libjpeg-dev

after that, I can do package installation as normal

manh.vu
  • 111
  • 4