Problems with login in Ubuntu 18.04 - Failed to start Load Kernel Modules

12,419

First thing you need to do in recovery mode is remount the main drive read/write:

sudo mount -o remount,rw /

Then you can try to reconfigure your packages:

sudo dpkg --configure -a

You might need to add a DNS server to connect to the internet:

sudo nano /etc/resolv.conf

and add the following to the end:

nameserver 8.8.8.8

Save and close.

NOTE - Op had issues writing directly to /etc/resolv.conf:

The only difficulty I encountered was to save the resolv.conf file in /root directory first and then move it manually to /etc/resolv.conf manually using

sudo nano resolv.conf
sudo mv resolv.conf /etc/resolv.conf

Then restart networking:

sudo service networking restart
sudo ifconfig enp2s0f0 up
sudo dhclient enp2s0f0

Then try to run your updates:

sudo apt update
sudo apt upgrade && sudo apt dist-upgrade
sudo apt -f install

If all goes well reboot.

Share:
12,419
Andrea Caldiroli
Author by

Andrea Caldiroli

Updated on September 18, 2022

Comments

  • Andrea Caldiroli
    Andrea Caldiroli almost 2 years

    I upgraded my Ubuntu release from 16.04 to 18.04 using sudo do-release-upgrade and following the instructions; the system boots correctly to the login page, but when I click on my user name, it says automatically (I do not enter any password) "Autentication error". Then the screen goes black in just a second and a message "Failed to start Load Kernel Modules" appears, along with many other lines:

    Modules Load Error

    So I restarted in recovery mode, used the root shell to run sudo systemctl status systemd-modules-load.service, and that's the result:

    Modules Load Status

    As suggested in many other topics (for example: What to do after Failed to start Load Kernel Modules), I tried to enter apt-get update apt-get dist-upgrade apt-get -f install but I get the message Could not resolve 'archive.ubuntu.com' (i.e., there is no internet connection), while for dpkg --configure -a I get dpkg: error: unable to access dpkg status area: Read-only file system.

    Running ifconfig I see this result:

    Ifconfig Output

    so I cannot connect to any network.

    I could appreciate any help in resolving this (I'm not an expert in Ubuntu)


    EDIT:

    Result from ifconfig -a:

    ifconfig -a result

    • Joshua Besneatte
      Joshua Besneatte almost 6 years
      what kind of connection? wifi or eth? have you seen this? ubuntuforums.org/showthread.php?t=1124454
    • Joshua Besneatte
      Joshua Besneatte almost 6 years
      also, if possible, it's better to copy/paste text from command output into your question instead of posting an image of it. thanks!
    • Joshua Besneatte
      Joshua Besneatte almost 6 years
      also, for ifconfig, did you do: ifconfig -a to show all interfaces?
    • Andrea Caldiroli
      Andrea Caldiroli almost 6 years
      I tried both wifi and eth. I looked at the link you posted but didn't help. I posted above the result from ifconfig -a. I'm currently unable to connect to network or using any kind of GUI, so I'm writing from another computer, my only possibility is to take pictures. I'm sorry ( I know copying and pasting would be much better)
    • Joshua Besneatte
      Joshua Besneatte almost 6 years
      do you have a wired or wireless connection?
    • Andrea Caldiroli
      Andrea Caldiroli almost 6 years
      I can connect directly to my router via ethernet cable or use the wifi
    • Joshua Besneatte
      Joshua Besneatte almost 6 years
      ok, use the direct ethernet connection... I posted an answer, let me know if that works out for you
  • Andrea Caldiroli
    Andrea Caldiroli almost 6 years
    It finally worked! Thank you a lot! The only difficulty I encountered was to save the resolv.conf file in /root directory first and then move it manually to /etc/resolv.conf manually using sudo mv resolv.conf /etc/resolv.conf
  • Andrés Parada
    Andrés Parada almost 5 years
    I followed your procedure but something failed, I noticed that now, trying again resolv.conf isn't modified as the above steps required. It seems upon reboot I am loosing this...
  • Joshua Besneatte
    Joshua Besneatte almost 5 years
    resolve.conf will be rewritten at reboot.... this is OK as once you get your system fixed in recovery mode, you will likely need to reconfigure via network settings gui once you get booted into normal mode