Updating problem on Ubuntu 24.04.4 LTS

Ubuntu Version

Ubuntu 24.04 LTS

Desktop Environment (if applicable)

GNOME

Problem Description

Running a Lenovo T460, I have found a “no entry” (red circle with white rectangle) icon in the top right icons. Clicking this ‘An error occurred. Please run package manager . .the error message was: Opening the cache (E: Malformed entry 1 in sources file / etc / apt / sources.list.d/third-party sources (URI parse). E: The list of sources could not be read)’.
Trying to run Synaptic Package manager fails, producing the message:
“E: Malformed entry 1 in sources file /etc/apt/sources.list.d/third-party.sources (URI parse)
E: The list of sources could not be read.
E: _cache->open() failed, cannot continue.”
Clicking “Software and Upgrades” to start that produces no result.
I guess I have a corrupted file which needs replacing, and have access to another computer, but what file and where to replace?

Relevant System Information

Lenovo T460 (getting old - could be a hardware problem??)

Error Messages / Logs

andrew@andrew-thinkpad-b-t460:~$ sudo apt update
[sudo] password for andrew:
E: Malformed entry 1 in sources file /etc/apt/sources.list.d/third-party.sources (URI parse)
E: The list of sources could not be read.

What I’ve Tried

I can’t see how to get round the updating problem.

Is but a text file, and is fixable in all likely hood.
Let us start this process by looking at what there is to work with.
post back - between code tags - the terminal results from the command:

ls -al /etc/apt/sources.list.d/

To get this little ball rolling.

-ain’t nothing but a thing-

This would be more helpful:
cat /etc/apt/sources.list.d/third-party.sources

The directory “/etc/apt/sources.list.d/third-party.sources” does not exist on my 24.04 install, What is needed is to know if “ubuntu.sources” does exist. Then insure that is the target to direct apt to.

-just my thought-

Whether it exists on your system or a fresh Ubuntu install is irrelevant. It obviously exists on the OP’s system, and is causing the error:
'E: Malformed entry 1 in sources file /etc/apt/sources.list.d/third-party.sources (URI parse)'

Most likely, user typo’d or copy/pasted something incorrectly.

Thanks for taking time to answer. Here is some info:

andrew@andrew-thinkpad-b-t460:~$ cat /etc/apt/sources.list.d/third-party.sources
Types: deb
URIs: cdrom:[Ubuntu 20.04.6 LTS Focal Fossa - Release amd64 (20230316)]/
Suites: focal
Components: main restricted

and the earlier suggestion:

andrew@andrew-thinkpad-b-t460:~$ ls -al /etc/apt/sources.list.d/
total 24
drwxr-xr-x 2 root root 4096 Aug 21 13:48 .
drwxr-xr-x 8 root root 4096 Aug 21 13:48 ..
-rw-r–r-- 1 root root 128 Aug 21 13:48 third-party.sources
-rw-r–r-- 1 root root 140 Aug 21 13:48 third-party.sources.save
-rw-r–r-- 1 root root 385 Aug 21 13:48 ubuntu.sources
-rw-r–r-- 1 root root 385 Aug 21 13:48 ubuntu.sources.save

I hope that means something to you!

Running this command then updating should fix the problems:

sudo rm /etc/apt/sources.list.d/third-party.sources*

sudo apt update

Success! Thank you so much. It worked, and all is updated.

1 Like

Glad to hear it worked.

Please mark the relevant post as the solution to let the community know.

Thanks

1 Like

This topic was automatically closed 18 hours after the last reply. New replies are no longer allowed.