Skip to content

Instantly share code, notes, and snippets.

@StrixROX
Last active February 8, 2026 08:31
Show Gist options
  • Select an option

  • Save StrixROX/2a6104488e96d0f39cd0456dcd7a1cf4 to your computer and use it in GitHub Desktop.

Select an option

Save StrixROX/2a6104488e96d0f39cd0456dcd7a1cf4 to your computer and use it in GitHub Desktop.
Getting `sudo apt update` to work on Raspberry Pi Zero W with Raspbian Trixie (Jan 26)

Getting sudo apt update to work on Raspberry Pi Zero W with Raspbian Trixie (Jan 26)

PS: Please use a power backup next time instead of raw-dogging life.

Preface

Right after first boot, tried running sudo apt update but it kept breaking with the error:

E: Encountered a section with no Package: header
E: Problem with MergeList /var/lib/apt/lists/raspbian.raspberrypi.com_raspbian_dists_trixie_main_binary-armhf_Packages (1)
E: The package lists or status file could not be parsed or opened.

After days of searching around on the internet and some fixes temporarily working (like the one described in this thread), I have finally figured out the permanent fix for this.

I still don't get how this works, or what the issue really is, maybe Raspberry Pi has forsaken Pi Zero W...

The Fix

Step 1 (on first boot): Remove the corrupted file

Confirm that the error message is similar to:

E: Encountered a section with no Package: header
E: Problem with MergeList /var/lib/apt/lists/raspbian.raspberrypi.com_raspbian_dists_trixie_main_binary-armhf_Packages (1)
E: The package lists or status file could not be parsed or opened.

If yes, then remove the corrupted list using

sudo rm /var/lib/apt/lists/raspbian.raspberrypi.com_raspbian_dists_trixie_main_binary-armhf_Packages

Step 2: Upgrade all upgradable pacakges

At this point, sudo apt update should start working already. But this will only work once. After you run the update command successfully, you will then get the same error again, ie, it will be fixed only temporarily. To fix it permanently, run upgrade command first instead.

After removing the corrupted list, run upgrade command

sudo apt upgrade

Step 3: Done! Confirm everything is stable

Check that all apt commands are now stable.

sudo apt update
sudo apt upgrade
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment