Score:0

after I installed python3.11 a red dot(like a no parking sign) appeared and when I click on it, it disappears and I ran into this apt error

gb flag

When I run sudo apt update, this is the output:

Ign:1 https://repo.vivaldi.com/stable/deb stable InRelease
Hit:2 https://repo.vivaldi.com/stable/deb stable Release                       
Hit:4 http://in.archive.ubuntu.com/ubuntu jammy InRelease                      
Hit:5 http://in.archive.ubuntu.com/ubuntu jammy-updates InRelease              
Get:6 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB]      
Hit:7 https://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu jammy InRelease   
Fetched 110 kB in 3s (43.5 kB/s)                                               
Traceback (most recent call last):
  File "/usr/lib/cnf-update-db", line 3, in <module>
    import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'
Reading package lists... Done
E: Problem executing scripts APT::Update::Post-Invoke-Success 'if /usr/bin/test -w /var/lib/command-not-found/ -a -e /usr/lib/cnf-update-db; then /usr/lib/cnf-update-db > /dev/null; fi'
E: Sub-process returned an error code

I've tried almost everything but the error is still there I'm a new in Ubuntu/Linux community pls help me fix this. I'm using Ubuntu 22.04 Desktop

David avatar
cn flag
No current version of Ubuntu runs 3.11 by default. Changing the default version of python corrupts the OS. Ubuntu needs to not have its default version of python changed. The tools in Ubuntu need the default version. BTW Your question needs the version of Ubuntu added to it with the edit command.
David avatar
cn flag
The fix is reinstall.
guiverc avatar
cn flag
Have you changed the default version of python3? You've not told us basic details such as what OS & release you're using, I note *jammy* in your pastes thus it's likely 22.04 but is that a Desktop or Server install? (or *flavor*). Changing the default python3 will cause breakage! esp. on desktop systems (on any tool that uses python3 which includes package tools like `apt`). Installing different python3 versions are fine as long as they're not your default... Did you change the default? What system are you using? Server? Desktop?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.