How to fix E: The list of sources could not be read in APT

APTBEGINNERMEDIUMUpdated Apr 21, 2026· 606 views

This error occurs when one or more files in your apt sources directory contain syntax errors or malformed entries. Identifying and fixing the problematic source file restores apt functionality.

Quick fix

Fixes E: The list of sources could not be read

sudo apt-get check
  1. Run apt-get check to identify the broken file
  2. Open the problematic source file
  3. Fix or remove the malformed line
  4. Save and verify the fix
apt — error
sudo apt-get check
E: The list of sources could not be read

What this error means

The apt package manager reads repository source configuration from /etc/apt/sources.list and files in /etc/apt/sources.list.d/. When these files contain malformed entries—syntax errors, invalid URIs, or broken formatting—apt cannot parse them during update or install operations. This prevents apt from accessing any software repositories until the broken source file is corrected or removed.

Typical symptoms

  • apt update or apt install fails immediately with "list of sources could not be read" error
  • Error message includes file path like "/etc/apt/sources.list.d/thirdparty.list"
  • apt-get check command displays "malformed entry" in specific file
  • Software Update GUI tools fail to open or refresh
  • All apt operations fail regardless of which package is being installed

Common causes

  1. Malformed entry in sources.list or sources.list.d file from manual editing
  2. Corrupted or incomplete source line after software installation/uninstallation
  3. Invalid URI format or missing required fields in a repository entry
  4. Stray characters, missing quotes, or indentation errors in source files
  5. PPA (Personal Package Archive) with incorrect syntax

How to fix "E: The list of sources could not be read"

1Run apt-get check to identify the broken file

Run the diagnostic command:

bash
sudo apt-get check

This will output which file contains the malformed entry, for example:

bash
E: Malformed entry 1 in sources file /etc/apt/sources.list.d/rethinkdb.list (Component)
E: The list of sources could not be read

Note the file path and line number mentioned in the error.

2Open the problematic source file

Use a text editor to open the file identified in the previous step:

bash
sudo nano /etc/apt/sources.list.d/rethinkdb.list

If the error is in the main sources list, edit:

bash
sudo nano /etc/apt/sources.list
3Fix or remove the malformed line

Look at the line number mentioned in the error. Check for:

- Missing or extra spaces
- Incomplete repository URL
- Invalid component name
- Missing distribution codename

A valid source line looks like:

bash
deb https://archive.ubuntu.com/ubuntu/ bionic main universe multiverse

Either fix the syntax or delete the entire line if you don't recognize the repository.

4Save and verify the fix

Save the file (in nano: Ctrl+O, then Ctrl+X).

Run apt-get check again:

bash
sudo apt-get check

If the error is gone, continue to the next step. If the same file is still reported, check for additional broken lines.

5Update the package cache

Now rebuild the package cache with:

bash
sudo apt update

This downloads fresh package lists from all configured sources. The error should not appear.

6If unsure, remove the entire source file

If the file contains only a third-party repository you no longer need, remove it entirely:

bash
sudo rm /etc/apt/sources.list.d/rethinkdb.list
sudo apt update

Do NOT remove /etc/apt/sources.list itself, as it contains the main Ubuntu/Debian repositories. Only remove files in the .d/ directory if they are causing issues.

Advanced notes

You can view all currently configured sources with apt-cache policy or by listing the entire sources.list.d directory: ls /etc/apt/sources.list.d/. If multiple files are broken, use grep -r "^deb" /etc/apt/sources.list.d/ to inspect all of them. For PPA sources added via add-apt-repository, use sudo add-apt-repository --remove ppa:username/ppaname to cleanly remove them instead of manually editing. After fixing sources, if you see "Failed to fetch" errors, the repository URL may be down or your network connection may be unreachable—verify the URL is current and accessible before reporting it as broken.

Frequently asked questions

What does "E: The list of sources could not be read" mean?
d/. When these files contain malformed entries—syntax errors, invalid URIs, or broken formatting—apt cannot parse them during update or install operations. This prevents apt from accessing any software repositories until the broken source file is corrected or removed.
How do I fix "E: The list of sources could not be read"?
This error occurs when one or more files in your apt sources directory contain syntax errors or malformed entries. Identifying and fixing the problematic source file restores apt functionality.
What causes "E: The list of sources could not be read"?
Malformed entry in sources.list or sources.list.d file from manual editing Corrupted or incomplete source line after software installation/uninstallation Invalid URI format or missing required fields in a repository entry
Is the "E: The list of sources could not be read" error serious?
It is a medium-severity error — more of a blocker than a risk. The steps above resolve it.

Official resources & further reading