Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 23 additions & 4 deletions getting-started/setup-building.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down