My wifi adapter stopped working suddenly and after some research I found out it was due to a recent kernel update.
I was trying to follow this solution to fix the issue but after step 1:
Purge all packages related to kernel 5.8.0-34-generic:
sudo apt purge linux-image-5.8.0-34-generic linux-image-unsigned-5.8.0-34-generic linux-modules-5.8.0-34-generic linux-headers-5.8.0-34-generic
I am getting the following error:
(Reading database ... 266336 files and directories currently installed.)
Removing linux-image-5.8.0-34-generic (5.8.0-34.37~20.04.2) ...
E: Aborting removal of the running kernel
dpkg: error processing package linux-image-5.8.0-34-generic (--remove):
installed linux-image-5.8.0-34-generic package pre-removal script subprocess returned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
linux-image-5.8.0-34-generic
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)
How can I fix this?