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
Situation
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
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
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 Truepython3-apt is included inside the Salt Bundle.
Additional Information
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
For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com