0

So, I was updating my ubuntu 20.04 to 22.04 yesterday. I left it on updating and when I woke up I found that the laptop had turned off due to low power. I wasn't able to run ubuntu on my system after charging it.

I immediately switched to recovery mode and accessed the root shell. There, I tried to run the command sudo apt update but I am getting the error - No module named apt_pkg as shown in the image.

Error message

How to solve this issue ?

Anurag
  • 101

1 Answers1

1

An interrupted release-upgrade during downloading is easy to fix.

An interrupted release-upgrade during installation is about the worst thing you can to your system short of physical destruction of the hardware. Sometimes it is easy to fix. Sometimes it is impossible to fix. Depends what was being installed at the moment of interruption, and what was left dangling.

Your output suggests a situation leaning toward 'impossible', or at least not worthwhile. The error means that the version of Python3 installed no longer matches the required bindings for apt. An expert might be able to laboriously troubleshoot and fix it...if nothing else is wrong. It is likely safer and faster to reinstall Ubuntu.

Advice: Use a friend's machine to create a 24.04 Live USB. Boot into the "Try Ubuntu" environment. Backup your data to some other media. Then reinstall Ubuntu.

user535733
  • 68,493