While doing a custom Ubuntu 25.04 installation by command line, I responded affirmatively to modernizing query as shown here:
root@ubuntu:~# apt update
Ign:1 cdrom://Ubuntu 25.04 _Plucky Puffin_ - Release amd64 (20250415.3) plucky InRelease
Hit:2 cdrom://Ubuntu 25.04 _Plucky Puffin_ - Release amd64 (20250415.3) plucky Release
Hit:4 http://security.ubuntu.com/ubuntu plucky-security InRelease
Hit:5 http://archive.ubuntu.com/ubuntu plucky InRelease
Hit:6 http://archive.ubuntu.com/ubuntu plucky-updates InRelease
Hit:7 http://archive.ubuntu.com/ubuntu plucky-backports InRelease
All packages are up to date.
Notice: Some sources can be modernized. Run 'apt modernize-sources' to do so.
root@ubuntu:~# ^C
root@ubuntu:~# apt modernize-sources
The following files need modernizing:
- /etc/apt/sources.list
Modernizing will replace .list files with the new .sources format,
add Signed-By values where they can be determined automatically,
and save the old files into .list.bak files.
This command supports the 'signed-by' and 'trusted' options. If you
have specified other options inside [] brackets, please transfer them
manually to the output files; see sources.list(5) for a mapping.
For a simulation, respond N in the following prompt.
Rewrite 1 sources? [Y/n] Y
Modernizing /etc/apt/sources.list...
- Writing /etc/apt/sources.list.d/ubuntu.sources
It appears modernizing was a mistake because I got this error in response to the next "apt update" command entry:
root@ubuntu:~# apt update
Error: Malformed entry 3 in sources file /etc/apt/sources.list.d/ubuntu.sources (URI parse)
Error: The list of sources could not be read.
The current content of that ubuntu.sources file is:
root@ubuntu:~# cat /etc/apt/sources.list.d/ubuntu.sources
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
Ubuntu distribution repository
The following settings can be adjusted to configure which packages to use from Ubuntu.
Mirror your choices (except for URIs and Suites) in the security section below to
ensure timely security updates.
Types: Append deb-src to enable the fetching of source package.
URIs: A URL to the repository (you may add multiple URLs)
Suites: The following additional suites can be configured
<name>-updates - Major bug fix updates produced after the final release of the
distribution.
<name>-backports - software from this repository may not have been tested as
extensively as that contained in the main release, although it includes
newer versions of some applications which may provide useful features.
Also, please note that software in backports WILL NOT receive any review
or updates from the Ubuntu security team.
Components: Aside from main, the following components can be added to the list
restricted - Software that may not be under a free license, or protected by patents.
universe - Community maintained packages. Software in this repository receives maintenance
from volunteers in the Ubuntu community, or a 10 year security maintenance
commitment from Canonical when an Ubuntu Pro subscription is attached.
multiverse - Community maintained of restricted. Software from this repository is
ENTIRELY UNSUPPORTED by the Ubuntu team, and may not be under a free
licence. Please satisfy yourself as to your rights to use the software.
Also, please note that software in multiverse WILL NOT receive any
review or updates from the Ubuntu security team.
See the sources.list(5) manual page for further settings.
Types: deb
URIs: http://archive.ubuntu.com/ubuntu/
Suites: plucky plucky-updates plucky-backports
Components: main universe restricted multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
Ubuntu security updates. Aside from URIs and Suites,
this should mirror your choices in the previous section.
Types: deb
URIs: http://security.ubuntu.com/ubuntu/
Suites: plucky-security
Components: main universe restricted multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
Modernized from /etc/apt/sources.list
Types: deb
URIs: cdrom://Ubuntu 25.04 Plucky Puffin - Release amd64 (20250415.3)/
Suites: plucky
Components: main restricted
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
If I interpret the error message right, the modernization introduced the error in this line:
URIs: cdrom://Ubuntu 25.04 _Plucky Puffin_ - Release amd64 (20250415.3)/
I do not know enough about this format to see the error. What went wrong here? How can this file be fixed?
Here is the content of the only .list.bak file currently in the system:
root@ubuntu:~# find / -iname *.list.bak
/etc/apt/sources.list.bak
root@ubuntu:~# cat /etc/apt/sources.list.bak
# Ubuntu sources have moved to the /etc/apt/sources.list.d/ubuntu.sources
# file, which uses the deb822 format. Use deb822-formatted .sources files
# to manage package sources in the /etc/apt/sources.list.d/ directory.
# See the sources.list(5) manual page for details.
deb cdrom:[Ubuntu 25.04 _Plucky Puffin_ - Release amd64 (20250415.3)]/ plucky main restricted