Unable to run "apt-get -f install" - linux

I'm trying to run sudo apt-get purge postgresql*, but I get a dependency error and a suggestion to run sudo apt-get -f install, so I try to run it which gives me:
Unpacking linux-image-3.13.0-63-generic (3.13.0-63.104~precise1) over (3.13.0-63.103) ...
dpkg: error processing archive /var/cache/apt/archives/linux-image-3.13.0-63-generic_3.13.0-63.104~precise1_amd64.deb (--unpack):
trying to overwrite '/lib/modules/3.13.0-63-generic/kernel/mm/hwpoison-inject.ko', which is also in package linux-image-extra-3.13.0-63-generic 3.13.0-63.103
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.13.0-63-generic /boot/vmlinuz-3.13.0-63-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.13.0-63-generic /boot/vmlinuz-3.13.0-63-generic
Errors were encountered while processing:
/var/cache/apt/archives/linux-image-3.13.0-63-generic_3.13.0-63.104~precise1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
I'm on 14.04

It seems there is a problem with installer. This command should help:
sudo dpkg --configure -a
After this, you should be able to install required dependencies

Related

Error in after run command sudo apt upgrade

Having Problem after running sudo apt upgrade
**Unpacking nodejs (16.19.0-deb-1nodesource1) over (12.22.9~dfsg-1ubuntu3) ...
dpkg: error processing archive /var/cache/apt/archives/nodejs_16.19.0-deb-1nodes
ource1_amd64.deb (--unpack):
trying to overwrite '/usr/share/systemtap/tapset/node.stp', which is also in pa
ckage libnode72:amd64 12.22.9~dfsg-1ubuntu3
Errors were encountered while processing:
/var/cache/apt/archives/nodejs_16.19.0-deb-1nodesource1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
**
code should upgrade all the dependency

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
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.

dpkg/systemd error: cp: '/etc/resolv.conf' and '/run/systemd/resolve/stub-resolv.conf' are the same file

I am trying to install this package software-properties-common on Ubuntu 20.04 and I'm facing the following problem:
cp: '/etc/resolv.conf' and '/run/systemd/resolve/stub-resolv.conf' are the same file
dpkg: error processing package systemd (--configure):
installed systemd package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
systemd
E: Sub-process /usr/bin/dpkg returned an error code (1)
Any idea how I could solve it?
I am considering deleting the /run/systemd/resolve/stub-resolv.conf but I am not sure this is a good idea and if it would solve the problem.
I removed /run/systemd/resolve/stub-resolv.conf and ran sudo apt-get -f install again and it solved the issue.

How can I fix idle-python3.6?

I have a big problem with python idle. If I try to run for example
sudo apt-get install apache2 I get this error:
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
And it is not just for apache, it happens for all the apps that I try to install with sudo apt-get install
I've tried to unistall idle, but it doesen't work
If I run
sudo apt-fix broken install
I get this error:
dpkg: error processing archive /var/cache/apt/archives/idle-python3.6_3.6.8-1~18.04.york0_all.deb (--unpack): trying to overwrite '/usr/lib/python3.6/idlelib/CREDITS.txt', which is also in package libpython3.6-stdlib:amd64 3.6.8-1+xenial1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/idle-python3.6_3.6.8-1~18.04.york0_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
The output of
sudo dpkg --configure -a
is
dpkg: dependency problems prevent configuration of idle:
idle depends on idle-python3.6; however:
Package idle-python3.6 is not installed.
dpkg: error processing package idle (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
idle
The output of cat /etc/apt/sources.list is
deb http://archive.ubuntu.com/ubuntu bionic main universe
deb http://security.ubuntu.com/ubuntu/ bionic-security main universe
deb http://archive.ubuntu.com/ubuntu bionic-updates main universe
If I try to reinstall with the command:
sudo apt install idle-python3.6
I get this:
dpkg: error processing archive /var/cache/apt/archives/idle-python3.6_3.6.8-1~18.04.york0_all.deb (--unpack):
trying to overwrite '/usr/lib/python3.6/idlelib/CREDITS.txt', which is also in package libpython3.6-stdlib:amd64 3.6.8-1+xenial1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/idle-python3.6_3.6.8-1~18.04.york0_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
I don't know what to do
I think it is the dependency problem due to bad configuration.
You can refer the ubuntu forum which had similar problem :
https://askubuntu.com/questions/1065556/broken-python-dependencies-after-trying-to-re-install

How do I fix broken dependencies if apt-get --fix-broken is giving me a "not known" error?

I've been attempting to install OpenLDAP on Ubuntu, but I keep receiving a dependency error whenever I try to install it.
The console output is:
dpkg: error processing package libapache2-mpm-itk (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of apache2-mpm-itk:
apache2-mpm-itk depends on libapache2-mpm-itk; however:
Package libapache2-mpm-itk is not configured yet.
dpkg: error processing package apache2-mpm-itk (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
libapache2-mpm-itk
apache2-mpm-itk
I tried running the code below to fix these errors:
sudo apt-get -f
But I received the error:
E: Command line option 'f' [from -f] is not known.
I have also tried to use the alternative --fix-broken, but I get the same error. Has anyone ever experience this and know a way around this?
First you'll have to resolve the problem with libapache2-mpm-itk. There isn't enough info in what you posted above to see why it's failing to install, but a quick workaround would be to just remove it:
sudo apt-get purge libapache2-mpm-itk apache2-mpm-itk
After that you should be able to install other packages again.
-f has to be used with an action, for example: sudo apt-get -f install (you don't need to provide any packages names when doing this.)
Whilst
sudo apt --fix-broken install
should work to repair damage. You might also find
sudo apt-get -f install
yeilds better result. Even though it's meant to be same.
You need to run sudo apt-get -f install NOT just sudo apt-get -f.

Resources