更新了ubuntu20.04的内核后,缺失网卡驱动与无线网卡驱动,导致无法上网,需要重新安装网卡驱动,本教程仅适合ubuntu20.04安装I219-V有线网卡驱动,无线网卡驱动暂未解决。
1. 查看网卡型号
使用以下命令查看网卡型号,可以看到网卡为I219-V
lspci -v
2. 下载对应网卡驱动
在intel官网找到I219-V驱动程序
点击下载e1000e-3.8.4.tar.gz
3. 解压对应网卡驱动
cd ~/Downloads/
tar -xzvf e1000e-3.8.4.tar.gz
解压后会看到对应e1000e-3.8.4文件夹,文件夹内容如下
4. 安装网卡驱动
打开readme就能看到详细的安装方法,我们直接从第三步开始
To manually build the driver
-
Move the base driver tar file to the directory of your choice.
For example, use ‘/home/username/e1000e’ or ‘/usr/local/src/e1000e’. -
Untar/unzip the archive, where <x.x.x> is the version number for the
driver tar file:
# tar zxf e1000e-<x.x.x>.tar.gz
————————————————从这里开始安装网卡驱动—————————————————
3. Change to the driver src directory, where <x.x.x> is the version number
for the driver tar:
# cd e1000e-<x.x.x>/src/
- Compile the driver module:
# make install
The binary will be installed as:
/lib/modules//updates/drivers/net/ethernet/intel/e1000e/e1000e.ko
The install location listed above is the default location. This may differ
for various Linux distributions.
-
Load the module using the modprobe command.
To check the version of the driver and then load it:
# modinfo e1000e
# modprobe e1000e
Alternately, make sure that any older e1000e drivers are removed from the
kernel before loading the new module:
# rmmod e1000e; modprobe e1000e
——————————————————以下可以不用操作——————————————————
6. Assign an IP address to the interface by entering the following,
where is the interface name that was shown in dmesg after modprobe:
# ip address add <IP_address>/<netmask bits> dev <ethX>
- Verify that the interface works. Enter the following, where IP_address
is the IP address for another machine on the same subnet as the interface
that is being tested:
# ping <IP_address>
—————————————————————重要——————————————————————
Note: For certain distributions like (but not limited to) Red Hat Enterprise
Linux 7 and Ubuntu, once the driver is installed, you may need to update the
initrd/initramfs file to prevent the OS loading old versions of the e1000e
driver. Use the dracut utility on Red Hat distributions:
# dracut --force
For Ubuntu:
# update-initramfs -u
至此完成安装