How to fix E: Encountered a section with no Package: header in APT

APTBEGINNERMEDIUMUpdated Mar 10, 2026· 241 views

This error occurs when apt encounters corrupted package list files in /var/lib/apt/lists/. Corrupted files can result from network interruptions, gateway redirects to HTML pages, or hardware issues. The fix involves removing and regenerating package lists.

Quick fix

Fixes E: Encountered a section with no Package: header

sudo rm -rf /var/lib/apt/lists/*
  1. Remove corrupted package lists
  2. Regenerate package lists
  3. Verify the fix
  4. Alternative: Clean and update with fix-missing
apt — error
sudo rm -rf /var/lib/apt/lists/*
E: Encountered a section with no Package: header

What this error means

apt is unable to parse package metadata files because they lack the required "Package:" header field. This header is essential for apt to understand and catalog available packages. When apt downloads package lists from repositories, they should contain properly formatted metadata with package information. If a file is corrupted, truncated, or an HTML error page is downloaded instead of the package file, apt will fail to parse it and throw this error.

Typical symptoms

  • apt update command fails with the error message
  • Unable to install or upgrade packages
  • Synaptic or other package managers fail to refresh
  • System cannot retrieve available packages from repositories

Common causes

  1. Network interruption during package list download
  2. Gateway or router redirecting to an HTML error page instead of package files
  3. Corrupted or incomplete files in /var/lib/apt/lists/
  4. Repository providing malformed package metadata
  5. Disk corruption or faulty hardware

How to fix "E: Encountered a section with no Package: header"

1Remove corrupted package lists

The most direct fix is to delete all cached package lists and regenerate them. Open a terminal and run:

bash
sudo rm -rf /var/lib/apt/lists/*

This removes all files in the apt cache directory that have become corrupted.

2Regenerate package lists

After removing the corrupted files, regenerate them by updating apt:

bash
sudo apt-get update

This downloads fresh package lists from all configured repositories.

3Verify the fix

Check that apt is working correctly by attempting to update or install a package:

bash
sudo apt-get upgrade

If this command completes without errors, the issue is resolved.

4Alternative: Clean and update with fix-missing

If the issue persists, try a more conservative approach that uses apt's built-in recovery:

bash
sudo apt-get clean
sudo apt-get update --fix-missing

This cleans the cache and updates while attempting to skip missing or incomplete files.

Advanced notes

If you continue experiencing this error after the basic fixes, check your network connection and any captive portals. Some corporate networks or coffee shop WiFi redirect failed requests to login/help pages. These HTML pages end up in apt cache and cause parsing errors. You can also inspect /etc/apt/sources.list and /etc/apt/sources.list.d/ for invalid PPAs or third-party repositories that might be providing malformed metadata. Remove or fix any suspicious entries. In rare cases where /var/lib/dpkg/status is corrupted (as opposed to package lists), do not delete it directly—first backup the file from /var/backups/status, then restore it or consult system recovery guides.

Frequently asked questions

What does "E: Encountered a section with no Package: header" mean?
apt is unable to parse package metadata files because they lack the required "Package:" header field. This header is essential for apt to understand and catalog available packages. When apt downloads package lists from repositories, they should contain properly formatted metadata with package information.
How do I fix "E: Encountered a section with no Package: header"?
This error occurs when apt encounters corrupted package list files in /var/lib/apt/lists/. Corrupted files can result from network interruptions, gateway redirects to HTML pages, or hardware issues. The fix involves removing and regenerating package lists.
What causes "E: Encountered a section with no Package: header"?
Network interruption during package list download Gateway or router redirecting to an HTML error page instead of package files Corrupted or incomplete files in /var/lib/apt/lists/
Is the "E: Encountered a section with no Package: header" error serious?
It is a medium-severity error — more of a blocker than a risk. The steps above resolve it.

Official resources & further reading