Notice: Some sources can be modernized. Run 'apt modernize-sources' to do so

In Ubuntu 25.04 why cannot this terminal line-option be hidden or removed if I do not which to use it.

Gort

The notice “Some sources can be modernized. Run ‘apt modernize-sources’ to do so” appears because your Ubuntu system has detected software repository configurations using the older, traditional format (.list files, typically /etc/apt/sources.list and files in /etc/apt/sources.list.d/).

Ubuntu (and Debian) are transitioning to a newer, more structured format called “deb822” using .sources files (usually placed in /etc/apt/sources.list.d/). This format is generally considered more readable, less prone to certain types of errors, and easier for tools to parse.

The apt modernize-sources command is a helper tool provided to automatically convert your existing .list files into the new .sources format.

There isn’t a specific configuration option within apt designed solely to turn off only this modernization notice while keeping the old .list files active. The notice is there specifically because the condition (presence of .list files) exists.

Therefore, the primary ways to stop seeing the notice are:

  1. Run the Modernization Command (Recommended):

    • This is the intended solution. Running sudo apt modernize-sources will analyze your existing .list files and attempt to convert them into the new .sources format.
    • It typically backs up your old configuration files before making changes (e.g., adding a .bak extension or similar).
    • Once your sources are successfully converted and the old .list files are no longer the primary configuration (they might be commented out or removed by the tool), apt will no longer detect sources needing modernization, and the notice will disappear.
    • Before running: It’s always wise to manually back up your /etc/apt/sources.list file and the contents of the /etc/apt/sources.list.d/ directory, just in case something unexpected happens during the conversion.
      sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
      sudo cp -R /etc/apt/sources.list.d/ /etc/apt/sources.list.d.backup
      
      Then run the modernization:
      sudo apt modernize-sources
      
      After running it, test with sudo apt update to ensure everything still works correctly.
  2. Use Quiet Flags (Not Ideal for Suppressing Just This):

    • You could potentially use flags like -q or -qq with apt commands (e.g., sudo apt -q update).
    • However, this is a blunt approach. It suppresses much more than just this notice, including progress indicators and potentially other useful warnings or information. It doesn’t target this specific message.

The best and intended way to “suppress” the notice is to address the underlying reason it’s appearing: run sudo apt modernize-sources to convert your repository configuration files to the newer format. While you can technically ignore the notice and continue using the .list files (they still work), the notice will likely persist until you modernize or use general quiet flags that hide other output too. Modernizing is generally safe and aligns with the direction the distribution is heading.

3 Likes

@popey It’s good to see back posting
Feed the Addiction


1 Like

|### Henry Wyatt hwyattjr100@gmail.com|3:57 PM (0 minutes ago)||

|
| — | — | — |
|to Rick

|

I used it previously and some sources are not compatible, which kept listing these sources every time I run apt update. The modernize line is only one line, but the incompatible sources list was multiple lines and bugged the hell out of me so I did a fresh install and did not run the modernize command anymore.

Based on your idea the “Quiet Flags” would not be safe for me. It might even make me “Quiet”

Gort

1 Like