SUSE Support

Here When You Need Us

Ubuntu server disk full, caused by /etc/apt/sources.list file very large size

This document (000021226) is provided subject to the disclaimer at the end of this document.

Environment

SUSE Manager 4.3 Ubuntu clients

Situation

When the salt "highstate" is run against an Ubuntu client, in some cases the repository URL is appended to the sources.list file instead of overwriting the file.

Example sources.list before running the salt highstate:
deb [arch=amd64 signed-by=/etc/apt/keyrings/nginx.key] http://nginx.org/packages/ubuntu/ focal nginx

Example sources.list after running salt highstate twice:
deb [arch=amd64 signed-by=/etc/apt/keyrings/nginx.key] http://nginx.org/packages/ubuntu/ focal nginxdeb [arch=amd64 signed-by=/etc/apt/keyrings/nginx.key] http://nginx.org/packages/ubuntu/ focal nginxdeb [arch=amd64 signed-by=/etc/apt/keyrings/nginx.key] http://nginx.org/packages/ubuntu/ focal nginx

Resolution

While waiting for an official maintenance package to be released, customers may open a Support Case with SUSE Support to request a TEST package or deploy one of the following workaround options.

Workaround 1:
Remove just this text from the sources.list file:
 "signed-by=/etc/apt/keyrings/nginx.key" 
 
Workaround 2:
Comment the entire line in the sources.list file and let the salt highstate add it back:
#deb [arch=amd64 signed-by=/etc/apt/keyrings/nginx.key] http://nginx.org/packages/ubuntu/ focal nginx

Cause

This is actually a bug in "python3-apt" package. The "aptsources" module (provided by python-apt package) is used by Salt "aptpkg" module and is currently conflicting with the "signed-by" repo option.

The current code only accepts "arch" and "trust" options, any other option, even if valid ones is currently making "aptsources" to consider this repo as invalid. 

Per the sources.list man page, "signed-by" is a valid option:
https://manpages.ubuntu.com/manpages/focal/en/man5/sources.list.5.html

The conflicting code still existing in upstream python-apt:
https://git.launchpad.net/python-apt/tree/aptsources/sourceslist.py?id=main#n360

This is a reproducer outside of Salt usage:
# python3
Python 3.8.10 (default, Nov 14 2022, 12:59:47) 
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from aptsources.sourceslist import SourcesList
>>> a = SourcesList()
>>> a.list[-1]

<aptsources.sourceslist.SourceEntry object at 0x7ff1ce7fe790>
>>> a.list[-1].line

'deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu focal stable\n'
>>> a.list[-1].invalid

True
python3-apt is included inside the Salt Bundle.

Additional Information

Reported to SUSE engineering who have reported to Upstream, waiting for acceptance.
https://github.com/uyuni-project/uyuni/issues/6801
https://bugs.launchpad.net/ubuntu/+source/python-apt/+bug/1862764
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1051852

Disclaimer

This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.

  • Document ID:000021226
  • Creation Date: 05-Oct-2023
  • Modified Date:06-Oct-2023
    • SUSE Manager Server
    • SUSE Manager

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.