LM 20.2: Could not exec dpkg

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
a_subscriber
Level 3
Level 3
Posts: 162
Joined: Fri Dec 01, 2017 10:07 am

LM 20.2: Could not exec dpkg

Post by a_subscriber »

Linux Mint 20.2

In my host I accidentally delete file dpkg.

So I want to add this file again.
I try this

Code: Select all

sudo apt-get install dpkg
But I get error:

Reading package lists... Done
Building dependency tree
Reading state information... Done
dpkg is already the newest version (1.19.7ubuntu3).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Could not exec dpkg!
E: Sub-process /usr/bin/dpkg returned an error code (100)
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Moonstone Man
Level 16
Level 16
Posts: 6078
Joined: Mon Aug 27, 2012 10:17 pm

Re: Could not exec dpk

Post by Moonstone Man »

a_subscriber wrote: Thu Aug 05, 2021 3:32 am In my host I accidentally delete file dpkg.

Code: Select all

sudo apt install --reinstall dpkg
Try that first, otherwise:

Code: Select all

sudo apt remove --purge dpkg
sudo apt install dpkg
a_subscriber
Level 3
Level 3
Posts: 162
Joined: Fri Dec 01, 2017 10:07 am

Re: Could not exec dpk

Post by a_subscriber »

Code: Select all

sudo apt install --reinstall dpkg
I get error:

Code: Select all

Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 1,128 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu focal/main amd64 dpkg amd64 1.19.7ubuntu3 [1,128 kB]
Fetched 1,128 kB in 1s (1,543 kB/s)
Could not exec dpkg!
E: Sub-process /usr/bin/dpkg returned an error code (100)
I always got this error message:

Code: Select all

E: Sub-process /usr/bin/dpkg returned an error code (100)[
Moonstone Man
Level 16
Level 16
Posts: 6078
Joined: Mon Aug 27, 2012 10:17 pm

Re: Could not exec dpk

Post by Moonstone Man »

a_subscriber wrote: Thu Aug 05, 2021 3:37 am

Code: Select all

sudo apt install --reinstall dpkg
I get error:
See above, "Try that first, otherwise:"
a_subscriber
Level 3
Level 3
Posts: 162
Joined: Fri Dec 01, 2017 10:07 am

Re: Could not exec dpk

Post by a_subscriber »

Code: Select all

sudo apt remove --purge dpkg
Result:
Reading package lists... Done
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:
dictionaries-common : Depends: debconf (>= 1.5.5) but it is not going to be installed or
debconf-2.0
Depends: libtext-iconv-perl but it is not going to be installed
libicu66 : Depends: tzdata (> 2019c-3ubuntu1~) but it is not going to be installed
nginx : Depends: nginx-core (< 1.18.0-0ubuntu1.2.1~) but it is not going to be installed or
nginx-full (< 1.18.0-0ubuntu1.2.1~) but it is not going to be installed or
nginx-light (< 1.18.0-0ubuntu1.2.1~) but it is not going to be installed or
nginx-extras (< 1.18.0-0ubuntu1.2.1~) but it is not going to be installed
Depends: nginx-core (>= 1.18.0-0ubuntu1.2) but it is not going to be installed or
nginx-full (>= 1.18.0-0ubuntu1.2) but it is not going to be installed or
nginx-light (>= 1.18.0-0ubuntu1.2) but it is not going to be installed or
nginx-extras (>= 1.18.0-0ubuntu1.2) but it is not going to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
Moonstone Man
Level 16
Level 16
Posts: 6078
Joined: Mon Aug 27, 2012 10:17 pm

Re: Could not exec dpk

Post by Moonstone Man »

a_subscriber wrote: Thu Aug 05, 2021 3:52 am

Code: Select all

E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
Start Synaptic package manager and on the Edit menu, select Fix broken packages, then exit. Then try the commands again.
a_subscriber
Level 3
Level 3
Posts: 162
Joined: Fri Dec 01, 2017 10:07 am

Re: Could not exec dpk

Post by a_subscriber »

Synaptic Package Manager -> Edit -> Fix broken packages

but nothing happend.

And as result

Code: Select all

sudo apt remove --purge dpkg
return same error
Moonstone Man
Level 16
Level 16
Posts: 6078
Joined: Mon Aug 27, 2012 10:17 pm

Re: Could not exec dpk

Post by Moonstone Man »

a_subscriber wrote: Thu Aug 05, 2021 4:18 am return same error
Urgh. Please post the output of inxi -Fxxxrz from a terminal and enclose it in code tags [code]output.here[/code]. You'll see the code tags icon </> when you reply. Note the capital F in inxi -Fxxxrz.
a_subscriber
Level 3
Level 3
Posts: 162
Joined: Fri Dec 01, 2017 10:07 am

Re: Could not exec dpk

Post by a_subscriber »

Here result:

Code: Select all

inxi -Fxxxrz
System:    Kernel: 5.11.0-25-generic x86_64 bits: 64 compiler: N/A Desktop: Cinnamon 5.0.5 wm: muffin 5.0.1 dm: LightDM 1.30.0 
           Distro: Linux Mint 20.2 Uma base: Ubuntu 20.04 focal 
Machine:   Type: Desktop System: HP product: HP ProDesk 600 G6 Microtower PC v: N/A serial: <filter> Chassis: type: 3 
           serial: <filter> 
           Mobo: HP model: 8712 v: KBC Version 09.94.00 serial: <filter> UEFI: HP v: S02 Ver. 02.05.01 date: 01/05/2021 
CPU:       Topology: 6-Core model: Intel Core i5-10500 bits: 64 type: MT MCP arch: N/A L2 cache: 12.0 MiB 
           flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 74399 
           Speed: 3238 MHz min/max: 800/4500 MHz Core speeds (MHz): 1: 1931 2: 829 3: 800 4: 800 5: 800 6: 800 7: 800 8: 800 
           9: 800 10: 800 11: 800 12: 978 
Graphics:  Device-1: Intel vendor: Hewlett-Packard driver: i915 v: kernel bus ID: 00:02.0 chip ID: 8086:9bc8 
           Display: x11 server: X.Org 1.20.11 driver: modesetting unloaded: fbdev,vesa 
           resolution: 1600x900~60Hz, 1920x1200~60Hz, 1920x1080~60Hz 
           OpenGL: renderer: Mesa Intel UHD Graphics 630 (CML GT2) v: 4.6 Mesa 21.0.3 direct render: Yes 
Audio:     Device-1: Intel Comet Lake PCH cAVS vendor: Hewlett-Packard driver: snd_hda_intel v: kernel bus ID: 00:1f.3 
           chip ID: 8086:06c8 
           Device-2: Plantronics Audio 655 DSP type: USB driver: plantronics,snd-usb-audio,usbhid bus ID: 1-2.4:4 
           chip ID: 047f:c008 
           Sound Server: ALSA v: k5.11.0-25-generic 
Network:   Device-1: Intel Ethernet I219-LM vendor: Hewlett-Packard driver: e1000e v: kernel port: efa0 bus ID: 00:1f.6 
           chip ID: 8086:0d4c 
           IF: eno1 state: up speed: 1000 Mbps duplex: full mac: <filter> 
Drives:    Local Storage: total: 298.23 GiB used: 73.81 GiB (24.8%) 
           ID-1: /dev/nvme0n1 model: KBG40ZNV256G KIOXIA size: 238.47 GiB speed: 31.6 Gb/s lanes: 4 serial: <filter> 
           rev: HP00AE00 scheme: GPT 
           ID-2: /dev/sda type: USB vendor: Samsung model: Flash Drive size: 59.75 GiB serial: <filter> rev: 1100 scheme: MBR 
Partition: ID-1: / size: 233.24 GiB used: 68.00 GiB (29.2%) fs: ext4 dev: /dev/nvme0n1p2 
Sensors:   System Temperatures: cpu: 38.0 C mobo: N/A 
           Fan Speeds (RPM): N/A 
Repos:     No active apt repos in: /etc/apt/sources.list 
           Active apt repos in: /etc/apt/sources.list.d/additional-repositories.list 
           1: deb https://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main
           Active apt repos in: /etc/apt/sources.list.d/anydesk-stable.list 
           1: deb http://deb.anydesk.com/ all main
           Active apt repos in: /etc/apt/sources.list.d/google-chrome.list 
           1: deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main
           Active apt repos in: /etc/apt/sources.list.d/official-package-repositories.list 
           1: deb http://packages.linuxmint.com uma main upstream import backport #id:linuxmint_main
           2: deb http://archive.ubuntu.com/ubuntu focal main restricted universe multiverse
           3: deb http://archive.ubuntu.com/ubuntu focal-updates main restricted universe multiverse
           4: deb http://archive.ubuntu.com/ubuntu focal-backports main restricted universe multiverse
           5: deb http://security.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
           6: deb http://archive.canonical.com/ubuntu/ focal partner
           Active apt repos in: /etc/apt/sources.list.d/pgadmin4.list 
           1: deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/uma pgadmin4 main
           Active apt repos in: /etc/apt/sources.list.d/pgdg.list 
           1: deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main
           Active apt repos in: /etc/apt/sources.list.d/postgresql.list 
           1: deb http://apt.postgresql.org/pub/repos/apt/ focal-pgdg main
           Active apt repos in: /etc/apt/sources.list.d/teams.list 
           1: deb [arch=amd64] https://packages.microsoft.com/repos/ms-teams stable main
           Active apt repos in: /etc/apt/sources.list.d/teamviewer.list 
           1: deb https://linux.teamviewer.com/deb stable main
           Active apt repos in: /etc/apt/sources.list.d/virtualbox.list 
           1: deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian focal contrib
           Active yum repos in: /etc/yum.repos.d/pgpool-II-release-36.repo 
           1: pgpool36 ~ http://www.pgpool.net/yum/rpms/3.6/redhat/rhel-$releasever-$basearch
Info:      Processes: 380 Uptime: 18h 53m Memory: 30.71 GiB used: 4.77 GiB (15.5%) Init: systemd v: 245 runlevel: 5 Compilers: 
           gcc: 9.3.0 alt: 9 Shell: bash v: 5.0.17 running in: mc inxi: 3.0.38 
Moonstone Man
Level 16
Level 16
Posts: 6078
Joined: Mon Aug 27, 2012 10:17 pm

Re: Could not exec dpk

Post by Moonstone Man »

a_subscriber wrote: Thu Aug 05, 2021 4:39 am Here result:

Code: Select all

           1: deb https://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main
           1: deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main
           1: deb http://apt.postgresql.org/pub/repos/apt/ focal-pgdg main
There's the problem. You need to delete those three repositories and update apt.

I did mention that in your other thread, and this is the same problem.
a_subscriber
Level 3
Level 3
Posts: 162
Joined: Fri Dec 01, 2017 10:07 am

Re: Could not exec dpk

Post by a_subscriber »

after remove

Code: Select all

inxi -Fxxxrz
System:    Kernel: 5.11.0-25-generic x86_64 bits: 64 compiler: N/A Desktop: Cinnamon 5.0.5 wm: muffin 5.0.1 dm: LightDM 1.30.0 
           Distro: Linux Mint 20.2 Uma base: Ubuntu 20.04 focal 
Machine:   Type: Desktop System: HP product: HP ProDesk 600 G6 Microtower PC v: N/A serial: <filter> Chassis: type: 3 
           serial: <filter> 
           Mobo: HP model: 8712 v: KBC Version 09.94.00 serial: <filter> UEFI: HP v: S02 Ver. 02.05.01 date: 01/05/2021 
CPU:       Topology: 6-Core model: Intel Core i5-10500 bits: 64 type: MT MCP arch: N/A L2 cache: 12.0 MiB 
           flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 74399 
           Speed: 800 MHz min/max: 800/4500 MHz Core speeds (MHz): 1: 800 2: 4180 3: 2709 4: 1421 5: 804 6: 800 7: 800 8: 964 
           9: 937 10: 3577 11: 2159 12: 977 
Graphics:  Device-1: Intel vendor: Hewlett-Packard driver: i915 v: kernel bus ID: 00:02.0 chip ID: 8086:9bc8 
           Display: x11 server: X.Org 1.20.11 driver: modesetting unloaded: fbdev,vesa 
           resolution: 1600x900~60Hz, 1920x1200~60Hz, 1920x1080~60Hz 
           OpenGL: renderer: Mesa Intel UHD Graphics 630 (CML GT2) v: 4.6 Mesa 21.0.3 direct render: Yes 
Audio:     Device-1: Intel Comet Lake PCH cAVS vendor: Hewlett-Packard driver: snd_hda_intel v: kernel bus ID: 00:1f.3 
           chip ID: 8086:06c8 
           Device-2: Plantronics Audio 655 DSP type: USB driver: plantronics,snd-usb-audio,usbhid bus ID: 1-2.4:4 
           chip ID: 047f:c008 
           Sound Server: ALSA v: k5.11.0-25-generic 
Network:   Device-1: Intel Ethernet I219-LM vendor: Hewlett-Packard driver: e1000e v: kernel port: efa0 bus ID: 00:1f.6 
           chip ID: 8086:0d4c 
           IF: eno1 state: up speed: 1000 Mbps duplex: full mac: <filter> 
Drives:    Local Storage: total: 238.47 GiB used: 74.93 GiB (31.4%) 
           ID-1: /dev/nvme0n1 model: KBG40ZNV256G KIOXIA size: 238.47 GiB speed: 31.6 Gb/s lanes: 4 serial: <filter> 
           rev: HP00AE00 scheme: GPT 
Partition: ID-1: / size: 233.24 GiB used: 74.92 GiB (32.1%) fs: ext4 dev: /dev/nvme0n1p2 
Sensors:   System Temperatures: cpu: 33.0 C mobo: N/A 
           Fan Speeds (RPM): N/A 
Repos:     No active apt repos in: /etc/apt/sources.list 
           No active apt repos in: /etc/apt/sources.list.d/additional-repositories.list 
           Active apt repos in: /etc/apt/sources.list.d/anydesk-stable.list 
           1: deb http://deb.anydesk.com/ all main
           Active apt repos in: /etc/apt/sources.list.d/google-chrome.list 
           1: deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main
           Active apt repos in: /etc/apt/sources.list.d/official-package-repositories.list 
           1: deb http://packages.linuxmint.com uma main upstream import backport #id:linuxmint_main
           2: deb http://archive.ubuntu.com/ubuntu focal main restricted universe multiverse
           3: deb http://archive.ubuntu.com/ubuntu focal-updates main restricted universe multiverse
           4: deb http://archive.ubuntu.com/ubuntu focal-backports main restricted universe multiverse
           5: deb http://security.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
           6: deb http://archive.canonical.com/ubuntu/ focal partner
           Active apt repos in: /etc/apt/sources.list.d/pgadmin4.list 
           1: deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/uma pgadmin4 main
           No active apt repos in: /etc/apt/sources.list.d/pgdg.list 
           No active apt repos in: /etc/apt/sources.list.d/postgresql.list 
           Active apt repos in: /etc/apt/sources.list.d/teams.list 
           1: deb [arch=amd64] https://packages.microsoft.com/repos/ms-teams stable main
           Active apt repos in: /etc/apt/sources.list.d/teamviewer.list 
           1: deb https://linux.teamviewer.com/deb stable main
           Active apt repos in: /etc/apt/sources.list.d/virtualbox.list 
           1: deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian focal contrib
           Active yum repos in: /etc/yum.repos.d/pgpool-II-release-36.repo 
           1: pgpool36 ~ http://www.pgpool.net/yum/rpms/3.6/redhat/rhel-$releasever-$basearch
Info:      Processes: 375 Uptime: 19h 11m Memory: 30.71 GiB used: 4.92 GiB (16.0%) Init: systemd v: 245 runlevel: 5 Compilers: 
           gcc: 9.3.0 alt: 9 Shell: bash v: 5.0.17 running in: mc inxi: 3.0.38 
update

Code: Select all

sudo apt-get update

Code: Select all

sudo apt-get upgrade

Code: Select all

sudo apt remove --purge dpkg
Same error:

Code: Select all

Reading package lists... Done
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:
 dictionaries-common : Depends: debconf (>= 1.5.5) but it is not going to be installed or
                                debconf-2.0
                       Depends: libtext-iconv-perl but it is not going to be installed
 libxml2 : Depends: libicu66 (>= 66.1-1~) but it is not going to be installed
 nginx : Depends: nginx-core (< 1.18.0-0ubuntu1.2.1~) but it is not going to be installed or
                  nginx-full (< 1.18.0-0ubuntu1.2.1~) but it is not going to be installed or
                  nginx-light (< 1.18.0-0ubuntu1.2.1~) but it is not going to be installed or
                  nginx-extras (< 1.18.0-0ubuntu1.2.1~) but it is not going to be installed
         Depends: nginx-core (>= 1.18.0-0ubuntu1.2) but it is not going to be installed or
                  nginx-full (>= 1.18.0-0ubuntu1.2) but it is not going to be installed or
                  nginx-light (>= 1.18.0-0ubuntu1.2) but it is not going to be installed or
                  nginx-extras (>= 1.18.0-0ubuntu1.2) but it is not going to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
Moonstone Man
Level 16
Level 16
Posts: 6078
Joined: Mon Aug 27, 2012 10:17 pm

Re: Could not exec dpk

Post by Moonstone Man »

a_subscriber wrote: Thu Aug 05, 2021 4:59 am

Code: Select all

E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
Go back and fix the broken packages as before. If that still doesn't get you going, you're probably better off restoring a timeshift snapshot.
User avatar
karlchen
Level 23
Level 23
Posts: 18187
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: Could not exec dpkg

Post by karlchen »

Hi, a_subscriber and Kadaitcha Man.

I guess that you are stuck in an almost unresolvable error loop.
Synaptic and apt, both are merely frontends. In the end, on the lower level, they all make use of dpkg in order to install, update, remove software packages.
The moment that the executable file dpkg (/usr/bin/dpkg) had been deleted, the worker dpkg was gone.
In this situation I would not hope that any Synaptic or apt operation will succeed, which depends on dpkg.

In case a_subscriber's statement was right
In my host I accidentally delete file dpkg.
then at this point in time it might still have been possible to use a matching live system e.g. and to copy the /usr/bin/dpkg executable from the live system to the installed system (and hope the copied dpkg has got the right version. So the live system should have been the same version as the installed one: LM 20.2.)

Now, I suspect, the best chance may be
+ booting from the live system LM 20.2
+ creating a chroot environment
+ installing dpkg on the installed system from the chroot environment
(No, please, do not ask me to explain the details. I would have to look them up myself. :oops: I simply do not screw up my systems frequently enough in order to know such steps by heart. :wink: )

Hope this puts you on the right track at least.
Regards,
Karl
Image
The people of Alderaan have been bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine for 762 days now.
Lifeline
Locked

Return to “Software & Applications”