After automatically installing a new kernel, Ubuntu 24.04 has lost the ethernet network. This frustrating issue occurred for me a second time, so I'm documenting the solution here to help others facing the same problem.
Commands to Fix Network Issues
Here are the commands that restored my network connectivity. First, check your kernel version with uname -r (it will show something like 6.14.0-37-generic), then replace the version number in the commands below:
# Check the network interfaces and IP addresses
ifconfig
# Check the kernel version
uname -r
# Update package lists and upgrade system
sudo apt update
sudo apt upgrade
# Install kernel extra modules for the version discovered above
# Replace 6.14.0-37-generic with your actual kernel version
sudo apt install linux-modules-extra-6.14.0-37-generic
# Rebuild the initramfs to include the new kernel modules
sudo update-initramfs -u
# Install recommended proprietary drivers (primarily for NVIDIA graphics)
sudo ubuntu-drivers autoinstall
# Reboot to apply changes
sudo reboot
Understanding the Problem and Solution
When Ubuntu automatically upgrades to a new kernel version (which happens during regular system updates), sometimes the network drivers aren't properly included in the new kernel's boot filesystem. This is particularly common with Ubuntu 24.04 after kernel upgrades, especially on systems with specific network hardware that requires additional kernel modules.
Why This Happens
- Kernel modules are version-specific: Each kernel version requires its own set of driver modules
- Initramfs may be incomplete: The initial RAM filesystem (initramfs) loaded during boot might not contain all necessary network drivers
-
Extra modules package missing: The
linux-modules-extrapackage for the new kernel version may not have been automatically installed
How the Solution Works
The commands above fix the issue by:
Installing kernel extra modules: The
linux-modules-extra-<version>-genericpackage contains additional kernel modules, including many network drivers that aren't included in the base kernel package. Without these modules, your network hardware won't be recognized.Rebuilding the initramfs: The
update-initramfs -ucommand ensures that all necessary kernel modules (including your network drivers) are packaged into the initramfs. This is critical because the initramfs is loaded before the root filesystem is mounted, and it needs to contain drivers for essential hardware like network interfaces.Installing proprietary drivers: The
ubuntu-drivers autoinstallcommand primarily handles graphics drivers (especially NVIDIA) and doesn't directly fix network issues. However, if your system lost multiple drivers during the kernel upgrade, this ensures all proprietary drivers are properly installed.Rebooting: This loads the new kernel with the properly configured initramfs, restoring network connectivity.
After rebooting, your network should be restored. You can verify by running ifconfig or ip a again to see your network interfaces with assigned IP addresses. If you need to check your Ubuntu version to ensure compatibility, there are several methods available.
If you're working with a server and need to configure network settings after restoring connectivity, you might find our guide on how to change a static IP address in Ubuntu Server helpful for further network configuration.
Top comments (1)
Crazy how most of these commands won't work when you don't have networking....
Like all of these will NOT work:
Even
ifconfigwill not work on most modern Ubuntu systems, you should useip addressinstead. Either AI wrote this and wasn't audited by a human or you lack the most basic understanding of networking and debian based systems, i.e. can not download if no internet, apt use Internet.Not trying to be rude, but if someone inexperienced were to read this article, they would leave frustrated.
What you can actually do without internet:
Download the .deb package on a different system. The package would be
linux-module-extra-{kernel-version}where kernel version is what was shown after runninguname -rPut that package on a USB or external hard drive
Connect and mount that drive. Use
lsblkto list the drives on the machine and mount the correct one by usingsudo mount /dev/{your-usb} {path-to-an-empty-folder-you-own}. If you get confused about which drive it is unplug the drive and runlsblkagain and look for what is different.Install the package:
sudo dpkg -i {path-to-the-pkg}.debPick up after the install command in the guide.
Seriously, if you're going to use AI to write guides, at least read them. I really want to assume a human would have caught this.