First of all, I believe I should say that I just installed Ubuntu 18.04 LTS earlier this week so I basically don't know anything.
I was installing the python3 idle today and encountred an error:
dpkg: error processing package linux-modules-4.15.0-22-generic (--configure):
package is in a very bad inconsistent state; you should
reinstall it before attempting configuration
No apport report written because the error message indicates its a followup error from a previous failure.
dpkg: dependency problems prevent configuration of linux-image-4.15.0-22-generic:
linux-image-4.15.0-22-generic depends on linux-modules-4.15.0-22-generic; however:
Package linux-modules-4.15.0-22-generic is not configured yet.
dpkg: error processing package linux-image-4.15.0-22-generic (--configure):
dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.27-3ubuntu1) ...
dpkg: dependency problems prevent configuration of linux-modules-extra-4.15.0-22-generic:
linux-modules-extra-4.15.0-22-generic depends on linux-image-4.15.0-22-generic | linux-image-unsigned-4.15.0-22-generic; however:
Package linux-image-4.15.0-22-generic is not configured yet.
Package linux-image-unsigned-4.15.0-22-generic is not installed.
dpkg: error processing package linux-modules-extra-4.15.0-22-generic (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Processing triggers for man-db (2.8.3-2) ...
Processing triggers for gnome-menus (3.13.3-11ubuntu1) ...
Setting up libtcl8.6:amd64 (8.6.8+dfsg-3) ...
dpkg: dependency problems prevent configuration of linux-image-generic:
linux-image-generic depends on linux-image-4.15.0-22-generic; however:
Package linux-image-4.15.0-22-generic is not configured yet.
linux-image-generic depends on linux-modules-extra-4.15.0-22-generic; however:
Package linux-modules-extra-4.15.0-22-generic is not configured yet.
dpkg: error processing package linux-image-generic (--configure):
dependency problems - leaving unconfigured
Setting up libtk8.6:amd64 (8.6.8-4) ...
No apport report written because MaxReports is reached already
Setting up tk8.6-blt2.5 (2.5.3+dfsg-4) ...
dpkg: dependency problems prevent configuration of linux-generic:
linux-generic depends on linux-image-generic (= 4.15.0.22.23); however:
Package linux-image-generic is not configured yet.
dpkg: error processing package linux-generic (--configure):
dependency problems - leaving unconfigured
Setting up blt (2.5.3+dfsg-4) ...
No apport report written because MaxReports is reached already
Setting up python3-tk:amd64 (3.6.5-3) ...
Setting up idle-python3.6 (3.6.5-3) ...
Setting up idle (3.6.5-3) ...
Setting up idle3 (3.6.5-3) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Errors were encountered while processing:
linux-modules-4.15.0-22-generic
linux-image-4.15.0-22-generic
linux-modules-extra-4.15.0-22-generic
linux-image-generic
linux-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
So I ran Sudo apt-get upgrade
thinking it's just about upgrading the linux modules and I got the same error message. I look up the error message online and I find this post that has the same error message. So I first ran the command the asker used: sudo apt-get install -f
and got this error message:
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
5 not fully installed or removed.
Need to get 0 B/12.9 MB of archives.
After this operation, 0 B of additional disk space will be used.
dpkg: error processing package linux-modules-4.15.0-22-generic (--configure):
package is in a very bad inconsistent state; you should
reinstall it before attempting configuration
dpkg: dependency problems prevent configuration of linux-image-4.15.0-22-generic:
linux-image-4.15.0-22-generic depends on linux-modules-4.15.0-22-generic; however:
Package linux-modules-4.15.0-22-generic is not configured yet.
dpkg: error processing package linux-image-4.15.0-22-generic (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
No apport report written because the error message indicates its a followup error from a previous failure.
dpkg: dependency problems prevent configuration of linux-modules-extra-4.15.0-22-generic:
linux-modules-extra-4.15.0-22-generic depends on linux-image-4.15.0-22-generic | linux-image-unsigned-4.15.0-22-generic; however:
Package linux-image-4.15.0-22-generic is not configured yet.
Package linux-image-unsigned-4.15.0-22-generic is not installed.
dpkg: error processing package linux-modules-extra-4.15.0-22-generic (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-image-generic:
linux-image-generic depends on linux-image-4.15.0-22-generic; however:
Package linux-image-4.15.0-22-generic is not configured yet.
linux-image-generic depends on linux-modules-extra-4.15.0-22-generic; however:
Package linux-modules-extra-4.15.0-22-generic is not configured yet.
dpkg: error processing package linux-image-generic (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-genNo apport report written because MaxReports is reached already
No apport report written because MaxReports is reached already
eric:
linux-generic depends on linux-image-generic (= 4.15.0.22.23); however:
Package linux-image-generic is not configured yet.
dpkg: error processing package linux-generic (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
linux-modules-4.15.0-22-generic
linux-image-4.15.0-22-generic
linux-modules-extra-4.15.0-22-generic
linux-image-generic
linux-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
Which from what I understood differs a bit from the first in that the first said the package is not configured and the second said I should reinstall it because it's in a bad state before configuring. It gives an almost identical error message to that of the asker. so I tried the steps mentioned in the accepted answer. I ran this command sudo rm /etc/apt/sources.list
and then this one sudo software-properties-gtk
and I get this error message:
WARNING:root:could not open file '/etc/apt/sources.list'
WARNING:root:could not open file '/etc/apt/sources.list'
So I wrote the second command again and it opened software-properties-gtk and wrote this into the terminal:
Gtk-Message: 20:43:48.389: GtkDialog mapped without a transient parent. This is discouraged.
So I used these settings. I hit Revert, nothing happened. I hit it again and still nothing happened. So, I hit Close and got this error message/notification. I realized that I can't follow with that tutorial because he just purged chrome and I can't purge linux modules. So, I reran sudo apt-get -f install
and now, it shows a way shorter error message:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: The package linux-modules-4.15.0-22-generic needs to be reinstalled, but I can't find an archive for it.
I tried sudo apt-get clean
and nothing showed up on the terminal and then I tried to use this command I saw on this post: sudo apt-get install --reinstall linux-modules-4.15.0-22-generic
I don't know if that's the name of the package to reinstall but it was worth a try. I got the same error message.
Did I break something? Do I need to reformat my system?
Edit: Output of ls -la /etc/apt/sources.list
is -rw-r--r-- 1 root root 84 May 26 20:43 /etc/apt/sources.list
Output of uname -a
is Linux Oussema 4.15.0-20-generic #21-Ubuntu SMP Tue Apr 24 06:16:15 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
sudo apt clean
,sudo apt update
,sudo apt install --reinstall linux-generic
. As of now there is a newer kernel available. Other problem which could have been is that the packages where corrupted as you downloaded them while updating. – Videonauth May 26 '18 at 21:27E: The package linux-modules-4.15.0-22-generic needs to be reinstalled, but I can't find an archive for it.
– Oussema May 26 '18 at 21:30ls -la /etc/apt/sources.list
? if you get an empty line you need to recreate your sources.list file. Just tell me. And pleas [edit] your question to include the output ofuname -a
. – Videonauth May 26 '18 at 21:35ls -la /etc/apt/sources.list
is-rw-r--r-- 1 root root 84 May 26 20:43 /etc/apt/sources.list
Output ofuname -a
isLinux Oussema 4.15.0-20-generic #21-Ubuntu SMP Tue Apr 24 06:16:15 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
– Oussema May 26 '18 at 21:39cat /etc/apt/sources.list
? – Videonauth May 26 '18 at 22:00deb http://us.archive.ubuntu.com/ubuntu/ bionic main universe restricted multiverse
– Oussema May 26 '18 at 22:10bionic-proposed
with a#
. That is a repository for patches which are in testing and development. After you edited your sources.list file you need to runsudo apt update
again. – Videonauth May 26 '18 at 22:13sudo apt dist-upgrade
this should fix your problem hopefully, if not tell me. – Videonauth May 26 '18 at 22:17sudo apt install --reinstall linux-modules-4.15.0-22-generic linux-image-4.15.0-22-generic linux-modules-extra-4.15.0-22-generic
then. – Videonauth May 26 '18 at 22:36Reading state information... Done E: Unable to locate package reinstall – Oussema May 26 '18 at 22:36
sudo dpkg-reconfigure -a
and please give me the output of that (sometimes I wish I would sit in front of that system) – Videonauth May 26 '18 at 22:48Unknown option: a
You know what, would you mind PMing me and remoting into my computer – Oussema May 26 '18 at 22:50