From a3c27a185bbd8760325bb7ae36b81a8d18a108be Mon Sep 17 00:00:00 2001 From: Joe Castle Date: Mon, 17 Aug 2026 01:02:18 -0400 Subject: [PATCH] Document deb822 sources for Ubuntu 24.04 and later Closes #1530. The dependency instructions tell you to uncomment `deb-src` lines in /etc/apt/sources.list. On Ubuntu 24.04 that file is a four line stub whose own comments say the sources have moved, and there is nothing to uncomment. A contributor following the guide gets: E: You must put some 'deb-src' URIs in your sources.list Verified on Ubuntu 24.04.4 LTS. `apt-get build-dep -s python3` fails exactly as above with the file as shipped. Adding `deb-src` to the `Types` field in /etc/apt/sources.list.d/ubuntu.sources and running `apt-get update` makes it resolve. Ubuntu's own generated file documents this at line 21: ## Types: Append deb-src to enable the fetching of source package. The 22.04 one-line instructions are kept rather than replaced, since releases still using that format need them. --- getting-started/setup-building.rst | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/getting-started/setup-building.rst b/getting-started/setup-building.rst index 8e35f8a64..28c299463 100644 --- a/getting-started/setup-building.rst +++ b/getting-started/setup-building.rst @@ -790,13 +790,32 @@ some of CPython's modules (for example, ``zlib``). dependencies for the Python you're working on by using the ``apt`` command. First, make sure you have enabled the source packages in the sources list. - You can do this by adding the location of the source packages, including - URL, distribution name and component name, to ``/etc/apt/sources.list``. - Take Ubuntu 22.04 LTS (Jammy Jellyfish) for example:: + Where those live depends on your release. + + On **Ubuntu 24.04 and later**, and on other releases using the deb822 + format, the sources are in ``/etc/apt/sources.list.d/ubuntu.sources``. + ``/etc/apt/sources.list`` is left as a stub with nothing to uncomment. + Add ``deb-src`` to the ``Types`` field of the entries you want sources + for:: + + $ sudo nano /etc/apt/sources.list.d/ubuntu.sources + + changing:: + + Types: deb + + to:: + + Types: deb deb-src + + On **Ubuntu 22.04 and other releases using the one-line format**, add the + location of the source packages, including URL, distribution name and + component name, to ``/etc/apt/sources.list``. Taking Ubuntu 22.04 LTS + (Jammy Jellyfish) as the example:: $ deb-src http://archive.ubuntu.com/ubuntu/ jammy main - Alternatively, uncomment lines with ``deb-src`` using an editor, for + Alternatively, uncomment the lines with ``deb-src`` using an editor, for example:: $ sudo nano /etc/apt/sources.list