Score:0

Can't update my system using apt update

va flag

I am unable to Update my system.

root@Pi-Hole:~# apt update
Hit:1 http://archive.ubuntu.com/ubuntu jammy InRelease
Hit:2 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:3 http://archive.ubuntu.com/ubuntu jammy-security InRelease
Traceback (most recent call last):
  File "/usr/lib/cnf-update-db", line 3, in <module>
    import apt_pkg
ImportError: /usr/lib/python3/dist-packages/apt_pkg.cpython-310-x86_64-linux-gnu.so: invalid ELF header
Reading package lists... Error!
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
E: flAbsPath on /var/lib/dpkg/status failed - realpath (74: Bad message)
E: Encountered a section with no Package: header
E: Problem with MergeList /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_jammy-security_multiverse_binary-amd64_Packages
E: The package lists or status file could not be parsed or opened.
mchid avatar
bo flag
Does `sudo apt install --reinstall python3-apt` fix the issue?
bluenazgul avatar
va flag
Sadly Not, this results in: root@Pi-Hole:~# sudo apt install --reinstall python3-apt E: Could not open lock file /var/lib/dpkg/lock-frontend - open (74: Bad message) E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root? root@Pi-Hole:~#
mchid avatar
bo flag
If you are sure there's no running process, that is, if you have killed the process (apt or dpkg) that was running the update, then you can delete the lockfile: `sudo rm /var/lib/dpkg/lock-frontend` and then run apt again.
I sit in a Tesla and translated this thread with Ai:

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.