dpkg error
Did someone experienced this kind of failure? If yes, any way to fix it?
Thanks in advance very much.
My best regards.
mhq@MaHq:~$ sudo apt install solc
Reading package lists... Done
Building dependency tree
Reading state information... Done
solc is already the newest version (1:0.8.
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
3 not fully installed or removed.
Need to get 0 B/863 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
dpkg: error processing package python-urlgrabber (--configure):
package is in a very bad inconsistent state; you should
reinstall it before attempting configuration
Setting up python-lzma (0.5.3-3) ...
/var/lib/
dpkg: error processing package python-lzma (--configure):
installed python-lzma package post-installation script subprocess returned error exit status 127
dpkg: dependency problems prevent configuration of yum:
yum depends on python-urlgrabber; however:
Package python-urlgrabber is not configured yet.
dpkg: error processing package yum (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
python-urlgrabber
python-lzma
yum
E: Sub-process /usr/bin/dpkg returned an error code (1)
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Ubuntu Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Manfred Hampl
- Solved:
- Last query:
- Last reply:
Revision history for this message
|
#1 |
mhq@MaHq:~$ LANG=C lsb_release -crid
Distributor ID: Ubuntu
Description: Ubuntu 20.04.2 LTS
Release: 20.04
Codename: focal
Revision history for this message
|
#2 |
python-lzma and python-urlgrabber seem to be the culprit, because they depend on python2, which is not part of the default focal installation.
What is the output of
apt-cache policy pathon-lzma python-urlgrabber yum
Revision history for this message
|
#4 |
apt-cache policy python-lzma python-urlgrabber yum
python-lzma:
Installed: 0.5.3-3
Candidate: 0.5.3-3
Version table:
*** 0.5.3-3 500
500 https:/
100 /var/lib/
0.5.3-2build1 500
500 http://
python-urlgrabber:
Installed: 3.9.1-4ubuntu3
Candidate: 3.10.2-1
Version table:
3.10.2-1 500
500 https:/
500 https:/
*** 3.9.1-4ubuntu3 500
500 http://
500 http://
100 /var/lib/
yum:
Installed: 3.4.3-2ubuntu1
Candidate: 3.4.3-3
Version table:
3.4.3-3 500
500 https:/
500 https:/
*** 3.4.3-2ubuntu1 500
500 http://
500 http://
100 /var/lib/
Revision history for this message
|
#5 |
Try:
sudo apt-get --reinstall install python-lzma
May help
Revision history for this message
|
#6 |
python-lzma python-urlgrabber and yum do not exist for Ubuntu focal. There is no supported way to install them on Ubuntu focal.
You are running Ubuntu 20.04, but you have repositories activated for Ubuntu bionic (18.04) and trusty (14.04)
This does not make any sense.
What is the output of the command
find /etc/apt -name '*.list' -exec bash -c 'echo -e "\n$1\n"; cat -n "$1"' _ '{}' \;
Revision history for this message
|
#7 |
mhq@MaHq:~$ find /etc/apt -name '*.list' -exec bash -c 'echo -e "\n$1\n"; cat -n "$1"' _ '{}' \;
/etc/apt/
1 deb http://
2 # deb-src http://
/etc/apt/
1 deb [arch=amd64 signed-
/etc/apt/
1 # deb cdrom:[Ubuntu 20.04.1 LTS _Focal Fossa_ - Release amd64 (20200731)]/ focal main restricted
2
3 # See http://
4 # newer versions of the distribution.
5 deb http://
6 # deb-src http://
7
8 ## Major bug fix updates produced after the final release of the
9 ## distribution.
10 deb http://
11 # deb-src http://
12
13 ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
14 ## team. Also, please note that software in universe WILL NOT receive any
15 ## review or updates from the Ubuntu security team.
16 deb http://
17 # deb-src http://
18 deb http://
19 # deb-src http://
20
21 ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
22 ## team, and may not be under a free licence. Please satisfy yourself as to
23 ## your rights to use the software. Also, please note that software in
24 ## multiverse WILL NOT receive any review or updates from the Ubuntu
25 ## security team.
26 deb http://
27 # deb-src http://
28 deb http://
29 # deb-src http://
30
31 ## N.B. software from this repository may not have been tested as
32 ## extensively as that contained in the main release, although it includes
33 ## newer versions of some applications which may provide useful features.
34 ## Also, please note that software in backports WILL NOT receive any review
35 ## or updates from the Ubuntu security team.
36 deb http://
37 # deb-src http://
38
39 ## Uncomment the following two lines to add software from Canonical's
40 ## 'partner' repository.
41 ## This software is not part of Ubuntu, but is offered by Canonical and the
42 ## respective vendors as a service to Ubuntu users.
43 # deb http://
44 # deb-src http://
45
46 deb http://
47 # deb-src http://
48 deb http://
49 # deb-src http://
50 deb http://
51 # deb-src http://
52
53 # This system was installed using small removable media
54 # (e.g. netinst, live or single CD). The matching "deb cdrom"
55 # entries were disabled at the end of the installation process.
56 # For information about how to configure apt package sources,
57 # see the sources.list(5) manual.
58 # deb https:/
59 deb https:/
60 # deb-src https:/
61 deb http://
62
63
64
65
66
67 # source of Tsinghua
68 deb https:/
69
70 deb-src https:/
71
72 deb https:/
73
74 deb-src https:/
75
76 deb https:/
77
78 deb-src https:/
79
80 deb https:/
81
82 deb-src https:/
83
84 deb https:/
85
86 deb-src https:/
87
88
/etc/apt/
1 deb http://
Revision history for this message
|
#8 |
My suggestion for repair:
sudo dpkg purge python-lzma python-urlgrabber yum
sudo rm /etc/apt/
sudo gedit /etc/apt/
in the editor window that opens scroll down to line 61 (the line that contains "trusty") and delete this line and everything that follows. Save the file and close the editor.
Finally execute the commands
sudo apt update
sudo dpkg --configure -a
sudo apt install -f
sudo apt full-upgrade
and report the results that we can check whether this has brought the package management system back into a consistent status.
Revision history for this message
|
#9 |
mhq@MaHq:~$ sudo dpkg --configure -a
dpkg: error processing package python-urlgrabber (--configure):
package is in a very bad inconsistent state; you should
reinstall it before attempting configuration
Setting up python-lzma (0.5.3-3) ...
/var/lib/
dpkg: error processing package python-lzma (--configure):
installed python-lzma package post-installation script subprocess returned error exit status 127
dpkg: dependency problems prevent configuration of yum:
yum depends on python-urlgrabber; however:
Package python-urlgrabber is not configured yet.
dpkg: error processing package yum (--configure):
dependency problems - leaving unconfigured
Setting up libcurl4:amd64 (7.68.0-1ubuntu2.5) ...
Setting up curl (7.68.0-1ubuntu2.5) ...
Setting up libcurl4-
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
Errors were encountered while processing:
python-urlgrabber
python-lzma
yum
mhq@MaHq:~$ sudo apt install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: The package python-urlgrabber needs to be reinstalled, but I can't find an archive for it.
mhq@MaHq:~$ sudo apt full-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: The package python-urlgrabber needs to be reinstalled, but I can't find an archive for it.
Revision history for this message
|
#10 |
What output do you receive for
sudo dpkg purge python-lzma python-urlgrabber yum
if you get
"E: The package python-urlgrabber needs to be reinstalled, but I can't find an archive for it."
then try the following:
wget https:/
sudo dpkg -i --force-depends python-
sudo dpkg purge python-lzma python-urlgrabber yum
and report the results.
Revision history for this message
|
#11 |
mhq@MaHq:
(Reading database ... 236394 files and directories currently installed.)
Removing python-lzma (0.5.3-3) ...
/var/lib/
dpkg: error processing package python-lzma (--purge):
installed python-lzma package pre-removal script subprocess returned error exit status 127
/var/lib/
dpkg: error while cleaning up:
installed python-lzma package post-installation script subprocess returned error exit status 127
dpkg: error processing package yum (--purge):
package is in a very bad inconsistent state; you should
reinstall it before attempting a removal
dpkg: dependency problems prevent removal of python-urlgrabber:
yum depends on python-urlgrabber; however:
Package python-urlgrabber is to be removed.
dpkg: error processing package python-urlgrabber (--purge):
dependency problems - not removing
Errors were encountered while processing:
python-lzma
yum
python-urlgrabber
mhq@MaHq:
dpkg: error: cannot access archive 'python-
mhq@MaHq:
dpkg: error: need an action option
Type dpkg --help for help about installing and deinstalling packages [*];
Use 'apt' or 'aptitude' for user-friendly package management;
Type dpkg -Dhelp for a list of dpkg debug flag values;
Type dpkg --force-help for a list of forcing options;
Type dpkg-deb --help for help about manipulating *.deb files;
Options marked [*] produce a lot of output - pipe it through 'less' or 'more' !
Revision history for this message
|
#12 |
Try the command:
sudo apt install python2-minimal -f
and report the results.
Revision history for this message
|
#13 |
mhq@MaHq:~$ sudo apt install python2-minimal -f
[sudo] password for mhq:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: The package python-urlgrabber needs to be reinstalled, but I can't find an archive for it.
Revision history for this message
|
#14 |
What is the output of
wget https:/
sudo dpkg -i --force-depends python-
Revision history for this message
|
#15 |
mhq@MaHq:~$ sudo dpkg -i --force-depends python-
[sudo] password for mhq:
Selecting previously unselected package python-urlgrabber.
(Reading database ... 236394 files and directories currently installed.)
Preparing to unpack python-
/var/lib/
dpkg: warning: old python-urlgrabber package pre-removal script subprocess returned error exit status 127
dpkg: trying script from the new package instead ...
/var/lib/
dpkg: error processing archive python-
new python-urlgrabber package pre-removal script subprocess returned error exit status 127
/var/lib/
dpkg: error while cleaning up:
installed python-urlgrabber package post-installation script subprocess returned error exit status 127
Errors were encountered while processing:
python-
Revision history for this message
|
#16 |
lvm2 package for Focal consists of: https:/
Revision history for this message
|
#17 |
(This question has nothing to do with lvm2. I am removing the link to that software and change it to Ubuntu)
Try the following command
sudo dpkg --force-
and report the results.
Revision history for this message
|
#18 |
mhq@MaHq:~$ sudo dpkg --force-
[sudo] password for mhq:
(Reading database ... 236394 files and directories currently installed.)
Removing python-lzma (0.5.3-3) ...
/var/lib/
dpkg: error processing package python-lzma (--purge):
installed python-lzma package pre-removal script subprocess returned error exit status 127
/var/lib/
dpkg: error while cleaning up:
installed python-lzma package post-installation script subprocess returned error exit status 127
dpkg: warning: overriding problem because --force enabled:
dpkg: warning: package is in a very bad inconsistent state; you should
reinstall it before attempting a removal
Removing yum (3.4.3-2ubuntu1) ...
/var/lib/
dpkg: error processing package yum (--purge):
installed yum package pre-removal script subprocess returned error exit status 127
dpkg: dependency problems prevent removal of python-urlgrabber:
yum depends on python-urlgrabber; however:
Package python-urlgrabber is to be removed.
dpkg: error processing package python-urlgrabber (--purge):
dependency problems - not removing
Errors were encountered while processing:
python-lzma
yum
python-urlgrabber
Revision history for this message
|
#19 |
The tricky problem is that there are half-installed packages for bionic on your system. They depend for installing and for uninstalling on certain python2 packages which are not installed. The standard way of installing python2 is blocked by the half-installed packages.
Let's try installing a minimal python2 package. This should then enable removing the broken packages, and then we can uninstall the python2 packages again.
Execute the following commands:
wget https:/
wget https:/
wget https:/
sudo dpkg -i libpython2.
sudo dpkg -i --force-depends python-
sudo dpkg --purge python-lzma python-urlgrabber yum
and copy/paste the output that we can check the progress.
Revision history for this message
|
#20 |
mhq@MaHq:~$ sudo dpkg --purge python-lzma python-urlgrabber yum
(Reading database ... 236394 files and directories currently installed.)
Removing python-lzma (0.5.3-3) ...
dpkg: error processing package yum (--purge):
package is in a very bad inconsistent state; you should
reinstall it before attempting a removal
dpkg: dependency problems prevent removal of python-urlgrabber:
yum depends on python-urlgrabber; however:
Package python-urlgrabber is to be removed.
dpkg: error processing package python-urlgrabber (--purge):
dependency problems - not removing
Errors were encountered while processing:
yum
python-urlgrabber
Revision history for this message
|
#21 |
mhq@MaHq:~$ sudo dpkg -i libpython2.
(Reading database ... 236394 files and directories currently installed.)
Preparing to unpack libpython2.
Unpacking libpython2.
Preparing to unpack python2.
Unpacking python2.7-minimal (2.7.18-1~20.04.1) over (2.7.18-1~20.04.1) ...
Preparing to unpack python2-
Unpacking python2-minimal (2.7.17-2ubuntu4) over (2.7.17-2ubuntu4) ...
Setting up libpython2.
Setting up python2.7-minimal (2.7.18-1~20.04.1) ...
Setting up python2-minimal (2.7.17-2ubuntu4) ...
Processing triggers for man-db (2.9.1-1) ...
mhq@MaHq:~$ sudo dpkg -i --force-depends python-
Selecting previously unselected package python-urlgrabber.
(Reading database ... 236394 files and directories currently installed.)
Preparing to unpack python-
Unpacking python-urlgrabber (3.9.1-4ubuntu3) over (3.9.1-4ubuntu3) ...
Setting up python-urlgrabber (3.9.1-4ubuntu3) ...
Processing triggers for man-db (2.9.1-1) ...
Revision history for this message
|
#22 |
This looks good.
What is now the output of the commands
sudo dpkg --audit
sudo dpkg --purge python-lzma python-urlgrabber yum
Revision history for this message
|
#23 |
mhq@MaHq:~$ sudo dpkg --audit
[sudo] password for mhq:
The following packages are in a mess due to serious problems during
installation. They must be reinstalled for them (and any packages
that depend on them) to function properly:
yum Advanced front-end for rpm
mhq@MaHq:~$ sudo dpkg --purge python-lzma python-urlgrabber yum
dpkg: warning: ignoring request to remove python-lzma which isn't installed
dpkg: error processing package yum (--purge):
package is in a very bad inconsistent state; you should
reinstall it before attempting a removal
dpkg: dependency problems prevent removal of python-urlgrabber:
yum depends on python-urlgrabber; however:
Package python-urlgrabber is to be removed.
dpkg: error processing package python-urlgrabber (--purge):
dependency problems - not removing
Errors were encountered while processing:
yum
python-urlgrabber
Revision history for this message
|
#24 |
I guess we are almost there.
wget https:/
sudo dpkg --force-depends -i yum_3.4.
sudo dpkg --purge python-urlgrabber yum
and report the results
Revision history for this message
|
#25 |
mhq@MaHq:~$ sudo dpkg --purge python-urlgrabber yum
dpkg: warning: ignoring request to remove python-urlgrabber which isn't installed
(Reading database ... 236367 files and directories currently installed.)
Removing yum (3.4.3-2ubuntu1) ...
Purging configuration files for yum (3.4.3-2ubuntu1) ...
dpkg: warning: while removing yum, directory '/var/lib/yum' not empty so not removed
dpkg: warning: while removing yum, directory '/var/cache/yum' not empty so not removed
dpkg: warning: while removing yum, directory '/etc/yum' not empty so not removed
Processing triggers for man-db (2.9.1-1) ...
Revision history for this message
|
#26 |
It seems that the problem has been resolved and the package management system is back in a consistent status.
What is now the output of the commands
sudo dpkg --audit
sudo apt install solc
Remark:
it would make sense to remove all packages that have been temporarily installed during the repair attempt:
sudo apt purge --autoremove libpython2.
Revision history for this message
|
#27 |
Thanks Manfred Hampl, that solved my question.
Revision history for this message
|
#28 |
Thank you very much,Manfred Hampl. This problem has been solved.Thanks you again。
Revision history for this message
|
#29 |
Cracking effort guys. I took a step back so as to not confuse things but awesome effort by Manfred getting to the goal. Nice on