Giter Club home page Giter Club logo

bookworm-apt-add-repository-issue's Introduction

Issue

The command apt-add-repository does not work correctly when there are no .list files on the system. Either /etc/apt/sources.list or any .list file in /etc/apt/sources.list.d/ with at least one line in it (this can be a comment) is required for the command to work.

The Debian bookworm docker images (debian:bookworm and debian:bookworm-slim) ship with no .list files. The default repository is configured in /etc/apt/sources.list.d/debian.sources. Debian bullseye ships with .list files and does not have this issue.

This will break some CI pipelines that use the bookworm docker images and later use apt-add-repository. An example of this is the LLVM install script.

See bullseye, issue and issue-minimal for examples.

Workaround

The workaround is to create a /etc/apt/sources.list file (even with only 1 comment line) or add a .list file to /etc/apt/sources.list.d/.

See workaround-1 and workaround-2.

Fix

A low risk fix is to have add-apt-repository create the /etc/apt/sources.list if there are no (.list) sources. The save() function already does this.

--- apt-add-repository-0.99.30-4
+++ apt-add-repository
@@ -36,6 +36,9 @@
         gettext.textdomain("software-properties")
         self.distro = get_distro()
         self.sourceslist = SourcesList()
+        if len(self.sourceslist.list) == 0:
+            self.sourceslist.save()
+            self.sourceslist = SourcesList()
         self.distro.get_sources(self.sourceslist)

     def parse_args(self, args):

Examples

bullseye

issue

issue-minimal

workaround-1

workaround-2

fix

bookworm-apt-add-repository-issue's People

Contributors

hof avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.