Apt modernize-sources

A test:

apt update --audit

did show:

Audit: The sources.list(5) entry for 'https://deb.debian.org/debian' should be upgraded to deb822 .sources
Audit: Missing Signed-By in the sources.list(5) entry for 'https://deb.debian.org/debian'
Audit: The sources.list(5) entry for 'https://deb.debian.org/debian' should be upgraded to deb822 .sources
Audit: Missing Signed-By in the sources.list(5) entry for 'https://deb.debian.org/debian'
Audit: The sources.list(5) entry for 'https://deb.debian.org/debian-security' should be upgraded to deb822 .sources
Audit: Missing Signed-By in the sources.list(5) entry for 'https://deb.debian.org/debian-security'
Audit: The sources.list(5) entry for 'https://deb.debian.org/debian' should be upgraded to deb822 .sources
Audit: Missing Signed-By in the sources.list(5) entry for 'https://deb.debian.org/debian'
Audit: The sources.list(5) entry for 'https://dietpi.com/apt' should be upgraded to deb822 .sources
Audit: Missing Signed-By in the sources.list(5) entry for 'https://dietpi.com/apt'
Audit: Consider migrating all sources.list(5) entries to the deb822 .sources format
Audit: The deb822 .sources format supports both embedded as well as external OpenPGP keys
Audit: See apt-secure(8) for best practices in configuring repository signing.
Audit: Some sources can be modernized. Run 'apt modernize-sources' to do so.
Some sources can be modernized. Run 'apt modernize-sources' to do so.

Is that recommended to do that?

I run these services:

[  OK  ] DietPi-Services | nmbd                 active (running) since Mon 2025-11-24 11:55:11 CET; 18h ago
[  OK  ] DietPi-Services | smbd                 active (running) since Mon 2025-11-24 11:55:11 CET; 18h ago
[  OK  ] DietPi-Services | roonserver           active (running) since Mon 2025-11-24 11:55:11 CET; 18h ago
[  OK  ] DietPi-Services | cron                 active (running) since Mon 2025-11-24 11:55:11 CET; 18h ago
[  OK  ] DietPi-Services | dropbear             active (running) since Mon 2025-11-24 11:53:18 CET; 18h ago
[ INFO ] DietPi-Services | dietpi-vpn           inactive (dead)
[ INFO ] DietPi-Services | dietpi-cloudshell    inactive (dead)
[  OK  ] DietPi-Services | dietpi-dashboard     active (running) since Mon 2025-11-24 11:53:18 CET; 18h ago
[  OK  ] DietPi-Services | dietpi-ramlog        active (exited) since Mon 2025-11-24 11:52:45 CET; 18h ago
[  OK  ] DietPi-Services | dietpi-preboot       active (exited) since Mon 2025-11-24 11:52:45 CET; 18h ago
[  OK  ] DietPi-Services | dietpi-postboot      active (exited) since Mon 2025-11-24 11:53:18 CET; 18h ago
[ INFO ] DietPi-Services | dietpi-wifi-monitor  inactive (dead)
root@DietPi:~# echo $G_DISTRO_NAME $G_RASPBIAN
trixie
root@DietPi:~#

THX

Torben

I quite often used apt modernize-sources.

Sometimes afterwards, apt update gave a message
Notice: Missing Signed-By in the sources.list(5) entry for 'https://deb.debian.org/debian'

The reason for this then was that in the file
/etc/apt/sources.list.d/debian-backports.sources
there was the line Signed-By: empty.
I had to change it to
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
and then all worked fine (i.e. the identical entry as in the file debian.sources).
The file /usr/share/keyrings/debian-archive-keyring.gpg should exist (at least a logical link of that name) on your system.

1 Like

I did look at

/ etc / apt / sources.list.d / dietpi.list

but the only information there is:

deb https://dietpi.com/apt trixie main

and

/ etc / apt / sources.list
deb https://deb.debian.org/debian/ trixie main contrib non-free non-free-firmware
deb https://deb.debian.org/debian/ trixie-updates main contrib non-free non-free-firmware
deb https://deb.debian.org/debian-security trixie-security main contrib non-free non-free-firmware
deb https://deb.debian.org/debian/ trixie-backports main contrib non-free non-free-firmware

Torben

I got the message after I executed apt modernize-sources. Then the system generates sources files in a different format.

Example: The “modernized” file /etc/apt/sources.list.d/debian-backports.sources e.g. then looks like

# Modernized from /etc/apt/sources.list
Types: deb
URIs: https://deb.debian.org/debian/
Suites: trixie-backports
Components: main contrib non-free non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg

after I corrected it.

1 Like

I did a test with “n”:

root@DietPi:~# apt modernize-sources
The following files need modernizing:
  - /etc/apt/sources.list
  - /etc/apt/sources.list.d/dietpi.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 2 sources? [Y/n]
Simulating only...
Modernizing /etc/apt/sources.list...

# Would write to: /etc/apt/sources.list.d/debian.sources
# Modernized from /etc/apt/sources.list
Types: deb
URIs: https://deb.debian.org/debian/
Suites: trixie
Components: main contrib non-free non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg

# Would write to: /etc/apt/sources.list.d/debian.sources
# Modernized from /etc/apt/sources.list
Types: deb
URIs: https://deb.debian.org/debian/
Suites: trixie-updates
Components: main contrib non-free non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg

# Would write to: /etc/apt/sources.list.d/debian.sources
# Modernized from /etc/apt/sources.list
Types: deb
URIs: https://deb.debian.org/debian-security/
Suites: trixie-security
Components: main contrib non-free non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg

# Would write to: /etc/apt/sources.list.d/debian-backports.sources
# Modernized from /etc/apt/sources.list
Types: deb
URIs: https://deb.debian.org/debian/
Suites: trixie-backports
Components: main contrib non-free non-free-firmware
Signed-By:
Warning: Could not determine Signed-By for URIs: https://deb.debian.org/debian/, Suites: trixie-backports

Modernizing /etc/apt/sources.list.d/dietpi.list...

# Would write to: /etc/apt/sources.list.d/dietpi.sources
Types: deb
URIs: https://dietpi.com/apt/
Suites: trixie
Components: main
Signed-By: /etc/apt/trusted.gpg.d/dietpi.asc

There is a warning:

Warning: Could not determine Signed-By for URIs: https://deb.debian.org/debian/, Suites: trixie-backports

Torben

That’s the message I described above to get rid of by editing the debian-backports.sources file.

@StephanStS - Thanks

/ etc / apt / sources.list.d / debian-backports.sources
# Modernized from /etc/apt/sources.list
Types: deb
URIs: https://deb.debian.org/debian/
Suites: trixie-backports
Components: main contrib non-free non-free-firmware
Signed-By: 

so I just need to add: Signed-By:

/usr/share/keyrings/debian-archive-keyring.gpg

It now shows:

root@DietPi:~# apt modernize-sources
All sources are modern.
root@DietPi:~#

Torben