Repositories are configured multiple times

I’m using MAAS 3.4.

I deployed ubuntu 24.04 image to a server. The image is MAAS official image.

As a result, the below warning occurred when I ran “apt update” on the deployed server.

W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:1 and /etc/apt/sources.list.d/ubuntu.sources:1

(And,  there were similar warnings about other repositories. )

I confirmed /etc/apt/sources.list and /etc/apt/sources.list.d/ubuntu.sources. As a result, same repository was defined.

I couldn’t understand why this multiple definition occurs.

/etc/apt/sources.list contained in the following MAAS images is blank.

https://images.maas.io/ephemeral-v3/stable/noble/amd64/

Does anyone know the cause of this?

[NOTE]
This issue doesn’t occur in other ubuntu version image.

I comfirmed my custom preseed files. But it doesn’t modify files under /etc/apt.

Yeah, just empty the file /etc/apt/sources.list and it’ll stop complaining. There’s a new file format now for APT.

@honjo-rikimaru-c6 could you please open a bug?

from cloud-init docs:

When the value of sources_list does not appear to be deb822 format, or stable distribution releases disable deb822 format, /etc/apt/sources.list will be written instead.

MAAS sources are not in deb822, but Noble defaults to this format, so the end result is that cloud-init creates new files instead of replacing the image source configuration

Thank you for replies.

@Tiagonix @r00ta @alexsander-souza

Thanks, I understood that following.

  • MAAS sources are not in deb822.
  • /etc/apt/sources.list will be written when the value of sources_list does not appear to be deb822 format.
  • So sources.list was not empty.

I open a bug report after this.

I opened a bug report.

1 Like

I continue to watch the bug report.

So I’d like to close this discussion now.

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