APT reports a malformed entry when a repository source file has a syntax error. The wording "(Suite component)" points at the deb822 .sources format; older systems use one-line .list files. Fix by correcting the offending file.
The "Malformed entry in list file" error means APT's parser hit a repository source definition it cannot interpret, so it refuses to read that file and aborts the update. APT supports two source formats, and which one you have determines the fix: - The classic one-line format used in `/etc/apt/sources.list` and `*.list` files under `/etc/apt/sources.list.d/`. Each line is: `deb [options] URL suite component [component2 ...]`. - The newer deb822 format used in `*.sources` files under `/etc/apt/sources.list.d/` (for example `ubuntu.sources` on Ubuntu 24.04). It uses keyed stanzas with fields like `Types:`, `URIs:`, `Suites:`, and `Components:`. The parenthetical token in the message tells you which field/part APT choked on. Words like `(Suite)`, `(Component)`, or `(Suite component)` are the names of deb822 stanza fields, which strongly indicates the offending file is a `.sources` (deb822) file with a missing or malformed `Suites:`/`Components:` field, or a broken stanza (bad indentation, blank line inside a stanza, or a missing `Types:`/`URIs:` line). A truly classic `.list` file with a broken one-line entry usually triggers wording such as "Malformed line". Identify the format first, then apply the matching fix.
APT names the file, the entry number, and the part it could not parse. For example:
E: Malformed entry 1 in list file /etc/apt/sources.list.d/docker.sources (Suite)Note two things: the file path, and the parenthetical token (here (Suite)). The parenthetical is the name of a deb822 field, which is a strong hint the file is in the newer keyed format. Also note the file extension: .sources means deb822 format, .list means the classic one-line format.
Print the file so you can see its structure:
cat /etc/apt/sources.list.d/docker.sourcesFor a deb822 .sources file you will see keyed stanzas separated by a blank line:
Types: deb
URIs: https://download.docker.com/linux/ubuntu
Suites: noble
Components: stable
Signed-By: /etc/apt/keyrings/docker.gpgFor a classic .list file you will see one entry per line:
deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu noble stableUse the format you actually have to pick the matching step below.
If the file is .sources, the error part (e.g. (Suite)) names the field at fault. Edit it:
sudo nano /etc/apt/sources.list.d/docker.sourcesMake sure the stanza follows deb822 rules:
- Each line is Field: value (note the space after the colon). Required fields are Types:, URIs:, Suites:, and Components:.
- Suites: holds the distribution codename(s), e.g. noble. Confirm yours with lsb_release -sc.
- Components: holds the channel(s), e.g. main (Ubuntu/Debian) or stable (Docker). It must not be empty.
- Separate multiple stanzas with exactly one blank line. Do not leave a blank line in the middle of a stanza.
- Continuation/value lines must belong to a Field: key; a stray bare value with no key triggers this error.
A correct minimal stanza:
Types: deb
URIs: https://download.docker.com/linux/ubuntu
Suites: noble
Components: stable
Signed-By: /etc/apt/keyrings/docker.gpgSave (Ctrl+X, Y, Enter).
If the file is .list, each repository must be a single line:
deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu noble stableBreakdown:
- deb (or deb-src for source packages)
- [arch=... signed-by=...] optional bracketed options
- the repository URL
- the suite/distribution codename (e.g. noble)
- one or more components (e.g. stable, or main universe)
Edit the file:
sudo nano /etc/apt/sources.list.d/docker.listCheck that the entry is on ONE line, that a single space separates each part, that the codename is present and matches lsb_release -sc, and that the scheme is spelled correctly (https, not heeps). Remove stray trailing spaces or non-ASCII characters. Save and exit.
If a repository is no longer needed, the cleanest fix is to disable or remove its source file. Prefer disabling first so you can restore it later, by renaming it out of the way:
sudo mv /etc/apt/sources.list.d/docker.sources /etc/apt/sources.list.d/docker.sources.disabledAPT only reads files ending in .list or .sources, so the renamed file is ignored. If you are certain you no longer need the repository, you can delete it instead:
sudo rm /etc/apt/sources.list.d/docker.sourcesOnly delete files you recognize; removing the wrong source can stop important updates. Never edit out a Signed-By:/signed-by= key just to silence an error, as that disables signature verification for the repository.
After fixing, disabling, or removing the file, verify APT can read all sources:
sudo apt updateIt should complete without the 'Malformed entry' error. If APT now reports the same error for a different file, repeat from step 1 for that file.
The parenthetical in the error message corresponds to a deb822 field name, so it is your best clue to the format: (Suite)/(Suites) and (Component)/(Components) indicate a .sources (deb822) stanza problem, whereas a broken classic one-line entry typically reports "Malformed line". On Ubuntu 24.04 (Noble) the default APT configuration moved to ubuntu.sources in deb822 format, so this error increasingly appears on .sources files rather than .list files.
You can mix both formats on one system, but never duplicate the same repository across a .list and a .sources file, as APT will warn about conflicting configured sources.
The modern Signed-By: (deb822) and signed-by= (one-line option) fields pin a repository to a specific key and are the recommended replacement for the deprecated apt-key. Keep keys in /etc/apt/keyrings/ and reference them explicitly rather than removing verification.
For fleets, manage these files with configuration management (Ansible, Puppet, cloud-init) to guarantee consistent, valid stanzas. When scripting deb822 files, remember that field names are case-insensitive but values are not, indentation/continuations must stay within a stanza, and stanzas are separated by a single blank line.
E: Could not connect to proxy server
Could not connect to proxy server
E: Package 'package:i386' has no installation candidate
How to fix "Package package:i386 has no installation candidate" in apt
E: The value 'value' is invalid for APT::Default-Release
How to fix invalid APT::Default-Release value in APT
dpkg: error: unable to create new file 'path': Permission denied
How to fix dpkg permission denied errors in APT
subprocess installed post-removal script returned error exit status 1
How to fix "subprocess installed post-removal script returned error exit status 1" in APT