1

I had an Ubuntu update days ago and I wasn't able to login my computer because of that, so I wrongly deleted in the kernel the version of the update, but I was able to continue working.

The problem now is that each time I use the apt-get command, it finishes with these lines (for example, trying to install ruby):

Reading package lists... Done
Building dependency tree       
Reading state information... Done
ruby is already the newest version (1:2.5.1).
The following packages were automatically installed and are no longer required:
  command-not-found-data gcc-5-base gir1.2-gst-plugins-base-1.0
  gir1.2-gstreamer-1.0 gir1.2-rb-3.0 gir1.2-totem-1.0 gir1.2-totemplparser-1.0
  gyp libdmapsharing-3.0-2 libgpod-common libgpod4 libgsoap-2.8.60
  libhttp-parser2.7.1 libjs-async libjs-inherits libjs-node-uuid libnetplan0
  libsgutils2-2 libssl1.0-dev libuv1 libuv1-dev libvncserver1 libxatracker2
  libxnvctrl0 libxvmc1 linux-hwe-5.4-headers-5.4.0-42
  linux-hwe-5.4-headers-5.4.0-56 linux-hwe-5.4-headers-5.4.0-58
  linux-hwe-5.4-headers-5.4.0-59 linux-hwe-5.4-headers-5.4.0-62 node-abbrev
  node-ansi node-ansi-color-table node-archy node-async node-balanced-match
  node-block-stream node-brace-expansion node-combined-stream node-concat-map
  node-cookie-jar node-delayed-stream node-forever-agent node-form-data
  node-fs.realpath node-fstream node-fstream-ignore node-github-url-from-git
  node-glob node-graceful-fs node-gyp node-hosted-git-info node-inflight
  node-inherits node-ini node-isexe node-json-stringify-safe node-lockfile
  node-lru-cache node-mime node-minimatch node-mkdirp node-mute-stream
  node-node-uuid node-nopt node-npmlog node-once node-osenv
  node-path-is-absolute node-pseudomap node-qs node-read node-request
  node-retry node-rimraf node-semver node-sha node-slide node-spdx-correct
  node-spdx-expression-parse node-spdx-license-ids node-tar node-tunnel-agent
  node-underscore node-validate-npm-package-license node-which node-wrappy
  node-yallist nodejs-doc pkg-config
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 6 not upgraded.
4 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
Setting up linux-image-5.4.0-65-generic (5.4.0-65.73~18.04.1) ...
Setting up linux-headers-5.4.0-65-generic (5.4.0-65.73~18.04.1) ...
/etc/kernel/header_postinst.d/dkms:
 * dkms: running auto installation service for kernel 5.4.0-65-generic
Error! Could not locate dkms.conf file.
File:  does not exist.
   ...fail!
run-parts: /etc/kernel/header_postinst.d/dkms exited with return code 4
dpkg: error processing package linux-headers-5.4.0-65-generic (--configure):
 installed linux-headers-5.4.0-65-generic package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of linux-headers-generic-hwe-18.04:
 linux-headers-generic-hwe-18.04 depends on linux-headers-5.4.0-65-generic; however:
  Package linux-headers-5.4.0-65-generic is not configured yet.

dpkg: error processing package linux-headers-generic-hwe-18.04 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of linux-generic-hwe-18.04: linux-generic-hwe-18.04 depends on linux-headers-generic-hwe-18.04 (= 5.4.0.65.73~18.04.60); however: Package linux-headers-generic-hwe-18.04 is not configured yet.

dpkg: error processing package linux-generic-hwe-18.04 (--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. Processing triggers for linux-image-5.4.0-65-generic (5.4.0-65.73~18.04.1) ... /etc/kernel/postinst.d/dkms:

  • dkms: running auto installation service for kernel 5.4.0-65-generic

Error! Could not locate dkms.conf file. File: does not exist. ...fail! run-parts: /etc/kernel/postinst.d/dkms exited with return code 4 dpkg: error processing package linux-image-5.4.0-65-generic (--configure): installed linux-image-5.4.0-65-generic package post-installation script subprocess returned error exit status 1 No apport report written because MaxReports is reached already Errors were encountered while processing: linux-headers-5.4.0-65-generic linux-headers-generic-hwe-18.04 linux-generic-hwe-18.04 linux-image-5.4.0-65-generic E: Sub-process /usr/bin/dpkg returned an error code (1)

How could I fix it? (Maybe it's a dumb thing, but I'm not a pro using Ubuntu, so sorry if in advance).

EDIT:

After running sudo apt autoremove:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
4 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up linux-image-5.4.0-65-generic (5.4.0-65.73~18.04.1) ...
Setting up linux-headers-5.4.0-65-generic (5.4.0-65.73~18.04.1) ...
/etc/kernel/header_postinst.d/dkms:
 * dkms: running auto installation service for kernel 5.4.0-65-generic
Error! Could not locate dkms.conf file.
File:  does not exist.
   ...fail!
run-parts: /etc/kernel/header_postinst.d/dkms exited with return code 4
dpkg: error processing package linux-headers-5.4.0-65-generic (--configure):
 installed linux-headers-5.4.0-65-generic package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of linux-headers-generic-hwe-18.04:
 linux-headers-generic-hwe-18.04 depends on linux-headers-5.4.0-65-generic; however:
  Package linux-headers-5.4.0-65-generic is not configured yet.

dpkg: error processing package linux-headers-generic-hwe-18.04 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of linux-generic-hwe-18.04: linux-generic-hwe-18.04 depends on linux-headers-generic-hwe-18.04 (= 5.4.0.65.73~18.04.60); however: Package linux-headers-generic-hwe-18.04 is not configured yet.

dpkg: error processing package linux-generic-hwe-18.04 (--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. Processing triggers for linux-image-5.4.0-65-generic (5.4.0-65.73~18.04.1) ... /etc/kernel/postinst.d/dkms:

  • dkms: running auto installation service for kernel 5.4.0-65-generic

Error! Could not locate dkms.conf file. File: does not exist. ...fail! run-parts: /etc/kernel/postinst.d/dkms exited with return code 4 dpkg: error processing package linux-image-5.4.0-65-generic (--configure): installed linux-image-5.4.0-65-generic package post-installation script subprocess returned error exit status 1 No apport report written because MaxReports is reached already Errors were encountered while processing: linux-headers-5.4.0-65-generic linux-headers-generic-hwe-18.04 linux-generic-hwe-18.04 linux-image-5.4.0-65-generic E: Sub-process /usr/bin/dpkg returned an error code (1)

After running sudo apt purge

Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
4 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up linux-image-5.4.0-65-generic (5.4.0-65.73~18.04.1) ...
Setting up linux-headers-5.4.0-65-generic (5.4.0-65.73~18.04.1) ...
/etc/kernel/header_postinst.d/dkms:
 * dkms: running auto installation service for kernel 5.4.0-65-generic
Error! Could not locate dkms.conf file.
File:  does not exist.
   ...fail!
run-parts: /etc/kernel/header_postinst.d/dkms exited with return code 4
dpkg: error processing package linux-headers-5.4.0-65-generic (--configure):
 installed linux-headers-5.4.0-65-generic package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of linux-headers-generic-hwe-18.04:
 linux-headers-generic-hwe-18.04 depends on linux-headers-5.4.0-65-generic; however:
  Package linux-headers-5.4.0-65-generic is not configured yet.

dpkg: error processing package linux-headers-generic-hwe-18.04 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of linux-generic-hwe-18.04: linux-generic-hwe-18.04 depends on linux-headers-generic-hwe-18.04 (= 5.4.0.65.73~18.04.60); however: Package linux-headers-generic-hwe-18.04 is not configured yet.

dpkg: error processing package linux-generic-hwe-18.04 (--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. Processing triggers for linux-image-5.4.0-65-generic (5.4.0-65.73~18.04.1) ... /etc/kernel/postinst.d/dkms:

  • dkms: running auto installation service for kernel 5.4.0-65-generic

Error! Could not locate dkms.conf file. File: does not exist. ...fail! run-parts: /etc/kernel/postinst.d/dkms exited with return code 4 dpkg: error processing package linux-image-5.4.0-65-generic (--configure): installed linux-image-5.4.0-65-generic package post-installation script subprocess returned error exit status 1 No apport report written because MaxReports is reached already Errors were encountered while processing: linux-headers-5.4.0-65-generic linux-headers-generic-hwe-18.04 linux-generic-hwe-18.04 linux-image-5.4.0-65-generic E: Sub-process /usr/bin/dpkg returned an error code (1)

After running sudo apt-get -f install

Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
4 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up linux-image-5.4.0-65-generic (5.4.0-65.73~18.04.1) ...
Setting up linux-headers-5.4.0-65-generic (5.4.0-65.73~18.04.1) ...
/etc/kernel/header_postinst.d/dkms:
 * dkms: running auto installation service for kernel 5.4.0-65-generic
Error! Could not locate dkms.conf file.
File:  does not exist.
   ...fail!
run-parts: /etc/kernel/header_postinst.d/dkms exited with return code 4
dpkg: error processing package linux-headers-5.4.0-65-generic (--configure):
 installed linux-headers-5.4.0-65-generic package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of linux-headers-generic-hwe-18.04:
 linux-headers-generic-hwe-18.04 depends on linux-headers-5.4.0-65-generic; however:
  Package linux-headers-5.4.0-65-generic is not configured yet.

dpkg: error processing package linux-headers-generic-hwe-18.04 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of linux-generic-hwe-18.04: linux-generic-hwe-18.04 depends on linux-headers-generic-hwe-18.04 (= 5.4.0.65.73~18.04.60); however: Package linux-headers-generic-hwe-18.04 is not configured yet.

dpkg: error processing package linux-generic-hwe-18.04 (--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. Processing triggers for linux-image-5.4.0-65-generic (5.4.0-65.73~18.04.1) ... /etc/kernel/postinst.d/dkms:

  • dkms: running auto installation service for kernel 5.4.0-65-generic

Error! Could not locate dkms.conf file. File: does not exist. ...fail! run-parts: /etc/kernel/postinst.d/dkms exited with return code 4 dpkg: error processing package linux-image-5.4.0-65-generic (--configure): installed linux-image-5.4.0-65-generic package post-installation script subprocess returned error exit status 1 No apport report written because MaxReports is reached already Errors were encountered while processing: linux-headers-5.4.0-65-generic linux-headers-generic-hwe-18.04 linux-generic-hwe-18.04 linux-image-5.4.0-65-generic E: Sub-process /usr/bin/dpkg returned an error code (1)

After running sudo dpkg-reconfigure linux-image-5.4.0-65-generic

/usr/sbin/dpkg-reconfigure: linux-image-5.4.0-65-generic is broken or not fully installed

After running sudo dpkg-reconfigure --force linux-image-5.4.0-65-generic there is no output

iam_agf
  • 111

1 Answers1

0

with apt-get you mean apt-get install?

first, the output tells you, that ruby is already installed.

then it lists not required packages and tells you at the end how you can remove them sudo apt autoremove I'd suggest your run afterwards sudo apt purge as well

in the second bunch of error messages dpkg (which is basically the programm apt invokes) tells you a) that there are non existing config files and b) that you have dependencies problems so I would try to sudo apt-get -f install (-f steht für fix-missing)

probably the config errors still remain, so I would try to reconfigure sudo dpkg-reconfigure linux-image-5.4.0-65-generic and the same for linux-headers-generic-hwe-18.04 linux-generic-hwe-18.04 linux-image-5.4.0-65-generic

if you get an error or if it doesnt solve the problem try sudo dpkg-reconfigure --force linux-image-5.4.0-65-generic etc. However, be aware, that I am not certain about this last command. I think it shouldn't be dangerous, but I am not 100% sure.

Thank you for giving me the opportunity to learn myself!

sidenote apt and apt-get is practically the same, but apt is more user friendly

pro-beginner tipp: try to use man yourprogram often or better man yourprogramm | less -p "specific function inside the program". then scroll with "n" to the different instances where the searched expression has been found (and shift+n to go back one search term) example: man less | less -p "-p" searches in the manual of the programm less for the search-pattern "-p". this works with the help flag as well. egs. less --help | less -p "-p". mostly --help or -h provides only a rougher help than the man(ual) but sometimes there is no manual. | pipes the outpout of the first command to te second command. so less searches via -p the whole man page and starts its output at the first occurance of the searche pattern.

with man -K "Search-Pattern" your search every man page for a search-pattern (slow!) with apropos "search-pattern" you search in the programm description for a pattern and the result is programm names.

final pro-beginner tip: install tldr (too long didnt read) with sudo apt install tldr because with tldr programm you get a lot of the most used use-cases of a programm and often inspiration.

and finally: !! repeats the last command. so with sudo !! you can repeat a command where you forgot to put sudo ;)

  • 1
    I followed all what you said, but in each of the instructions I found the same error in the end: Errors were encountered while processing:.... I understand that every output of the terminal explains the error, but I don't get how to solve them because it says "file does not exist", where I find that in other questions there is a name. – iam_agf Feb 15 '21 at 20:03
  • can you repost the outpout please? – Josomeister Feb 15 '21 at 20:34
  • and the outpout of locate dkms – Josomeister Feb 15 '21 at 20:37
  • Yes, let me a second. I'm re-running them again to copy-paste it :-) – iam_agf Feb 15 '21 at 20:37
  • I added everything but locate dkms is pretty long and I can't add that much of output. Let me add it in a gist. – iam_agf Feb 15 '21 at 20:42
  • Here it is: https://gist.github.com/iam-agf/89fe904548ca5344f6ae90c5b732c6a6 – iam_agf Feb 15 '21 at 20:43