Killian Fortman
Killian Fortman

Reputation: 106

issue with dpkg when trying --fix-broken with apt

I am trying to fix some issues with broken libs after failed to install another package. I ran sudo apt --fix-broken install and it failed with this result:

dpkg: error processing archive /var/cache/apt/archives/libglx-dev_1.3.2-1_amd64.deb (--unpack):
 trying to overwrite '/usr/include/GL/glx.h', which is also in package mesa-common-dev:amd64 20.0.8-0ubuntu1~18.04.1
Preparing to unpack .../libgl-dev_1.3.2-1_amd64.deb ...
Unpacking libgl-dev:amd64 (1.3.2-1) ...
dpkg: error processing archive /var/cache/apt/archives/libgl-dev_1.3.2-1_amd64.deb (--unpack):
 trying to overwrite '/usr/include/GL/gl.h', which is also in package mesa-common-dev:amd64 20.0.8-0ubuntu1~18.04.1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Preparing to unpack .../libegl-dev_1.3.2-1_amd64.deb ...
Unpacking libegl-dev:amd64 (1.3.2-1) ...
dpkg: error processing archive /var/cache/apt/archives/libegl-dev_1.3.2-1_amd64.deb (--unpack):
 trying to overwrite '/usr/include/EGL/egl.h', which is also in package libegl1-mesa-dev:amd64 20.0.8-0ubuntu1~18.04.1
Preparing to unpack .../libgles-dev_1.3.2-1_amd64.deb ...
Unpacking libgles-dev:amd64 (1.3.2-1) ...
dpkg: error processing archive /var/cache/apt/archives/libgles-dev_1.3.2-1_amd64.deb (--unpack):
 trying to overwrite '/usr/include/GLES2/gl2.h', which is also in package libgles2-mesa-dev:amd64 20.0.8-0ubuntu1~18.04.1
No apport report written because MaxReports is reached already
                                                              Errors were encountered while processing:
 /var/cache/apt/archives/libglx-dev_1.3.2-1_amd64.deb
 /var/cache/apt/archives/libgl-dev_1.3.2-1_amd64.deb
 /var/cache/apt/archives/libegl-dev_1.3.2-1_amd64.deb
 /var/cache/apt/archives/libgles-dev_1.3.2-1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

I can not run some applications that require gtk due to that series of libs being broken.

Any suggestions for a fix?

uname -a

Linux ubuntu 5.4.0-84-generic #94~18.04.1-Ubuntu SMP Thu Aug 26 23:17:46 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Upvotes: 1

Views: 36374

Answers (2)

user3426959
user3426959

Reputation: 1

Nethunter kali arm64 deb

Exit the terminal Termux App info force stop

Run termux again nh -r

lsof /var/lib/dpkg/lock

ps cax | grep PID

Kill any pid running

sudo rm /var/lib/dpkg/lock

sudo dpkg --configure -a If there is still a process Run sudo rm /var/lib/dpkg/lock Again

 dpkg --force-all --configure -a

Cd /var/cache/apt/archives

dpkg --force-depends -i

Then add the package you want to remove For me

dpkg --force-depends -i kali-themes-common Next dpkg --force-depends -i desktop-file-utils

Then sudo apt-get install kali-themes-common Next desktop-file-utils

Sudo apt-get upgrade

Upvotes: -1

Killian Fortman
Killian Fortman

Reputation: 106

I fixed this.

I had to remove some packages with dpkg

sudo dpkg --remove --force-remove-reinstreq libgtk-3-dev
sudo dpkg --remove --force-remove-reinstreq mesa-common-dev
sudo dpkg --remove --force-remove-reinstreq libegl1-mesa-dev
sudo dpkg --remove libgles2-mesa-dev

Then I ran sudo apt --fix-broken install

I had to also run all updates and upgrades to fix everything.

Upvotes: 4

Related Questions