Skip to content

Commit a3c27a1

Browse files
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.
1 parent 3f36f40 commit a3c27a1

1 file changed

Lines changed: 23 additions & 4 deletions

File tree

getting-started/setup-building.rst

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -790,13 +790,32 @@ some of CPython's modules (for example, ``zlib``).
790790
dependencies for the Python you're working on by using the ``apt`` command.
791791

792792
First, make sure you have enabled the source packages in the sources list.
793-
You can do this by adding the location of the source packages, including
794-
URL, distribution name and component name, to ``/etc/apt/sources.list``.
795-
Take Ubuntu 22.04 LTS (Jammy Jellyfish) for example::
793+
Where those live depends on your release.
794+
795+
On **Ubuntu 24.04 and later**, and on other releases using the deb822
796+
format, the sources are in ``/etc/apt/sources.list.d/ubuntu.sources``.
797+
``/etc/apt/sources.list`` is left as a stub with nothing to uncomment.
798+
Add ``deb-src`` to the ``Types`` field of the entries you want sources
799+
for::
800+
801+
$ sudo nano /etc/apt/sources.list.d/ubuntu.sources
802+
803+
changing::
804+
805+
Types: deb
806+
807+
to::
808+
809+
Types: deb deb-src
810+
811+
On **Ubuntu 22.04 and other releases using the one-line format**, add the
812+
location of the source packages, including URL, distribution name and
813+
component name, to ``/etc/apt/sources.list``. Taking Ubuntu 22.04 LTS
814+
(Jammy Jellyfish) as the example::
796815

797816
$ deb-src http://archive.ubuntu.com/ubuntu/ jammy main
798817

799-
Alternatively, uncomment lines with ``deb-src`` using an editor, for
818+
Alternatively, uncomment the lines with ``deb-src`` using an editor, for
800819
example::
801820

802821
$ sudo nano /etc/apt/sources.list

0 commit comments

Comments
 (0)