Skip to content
This repository was archived by the owner on Feb 13, 2026. It is now read-only.

Commit d9cff87

Browse files
authored
Propose changes how-to doc (#144)
* first draft of propose changes how-to doc * remove redundant instructions and link to the how-to page on getting the source code instead * implement feedback from @julian-klode
1 parent b3389ca commit d9cff87

3 files changed

Lines changed: 333 additions & 0 deletions

File tree

docs/.custom_wordlist.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
AArch
2+
Apport
23
ARMv
34
Backport
45
Backports
56
BitBucket
7+
Bitesize
68
boolean
9+
Canonistack
710
CET
811
Changelog
912
CISC
1013
CVE
1114
Cryptographic
15+
debdiff
1216
dch
1317
DebSrc
1418
DNS
@@ -74,18 +78,24 @@ lintian
7478
listinfo
7579
localhost
7680
lp
81+
Libera
7782
mailto
83+
manpages
84+
Maintainer's
7885
Matic
7986
MoM
8087
motu
8188
noreply
8289
o'p
90+
Papercuts
91+
patchfile
8392
ppa
8493
schroot
8594
schroots
8695
sftp
8796
subiquity
8897
synonymously
98+
testbed
8999
textarea
90100
textareas
91101
ubuntu

docs/how-to/get-package-source.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. _get-package-source:
2+
13
Get the source of a package
24
===========================
35

docs/how-to/propose-changes.rst

Lines changed: 321 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,323 @@
11
Propose changes
22
===============
3+
4+
This guide walks you through the process for proposing changes to Ubuntu. The process is straightforward. When you find a problem, you obtain the code, work on a solution, test the fix, push your changes to :term:`Launchpad`, and then request a review and merge.
5+
6+
.. attention::
7+
8+
There are information placed within angle brackets in this guide. Ensure you replace them with the appropriate values. For example, replace ``<package-name>`` with the name of the package you are working on.
9+
10+
Find a bug to fix
11+
-----------------
12+
13+
Start by identifying an issue to work on. This can be a bug you encountered while using an application, a problem described in a bug report, or a known issue in the Ubuntu community.
14+
15+
You can also explore known bugs using these resources:
16+
17+
- `Bitesize bugs on Launchpad <https://bugs.launchpad.net/ubuntu/+bugs?field.tag=bitesize>`_: These are small, well-scoped bugs that are great for new contributors.
18+
- `One Hundred Papercuts <https://launchpad.net/hundredpapercuts>`_: This resource focuses on fixing minor bugs that negatively affect the user experience.
19+
- `Launchpad's bug tracker <https://bugs.launchpad.net/ubuntu>`_ and `Debian's bug trackers <https://www.debian.org/Bugs/>`_: These contain issue reports for Ubuntu and Debian packages.
20+
21+
22+
Evaluate the bug report
23+
-----------------------
24+
25+
Once you find a bug report on Launchpad that you want to work on, the next step is to evaluate the bug.
26+
27+
Read the bug description carefully and look for:
28+
29+
- steps to reproduce the problem
30+
- crash logs or terminal output
31+
- details about the affected version and package
32+
- attached ``.crash`` files or `Apport crash files <https://github.com/canonical/ubuntu-maintainers-handbook/blob/main/PackageFixing.md#evaluate-the-bug>`_
33+
34+
For example, this `bug report <https://bugs.launchpad.net/ubuntu/+source/postfix/+bug/1753470>`_ shows a segmentation fault in ``postconf`` on Ubuntu 18.04. It includes logs from ``/var/log/kern.log``, shell commands that reproduce the issue, and metadata about the system environment. This information helps confirm whether the bug still affects current versions and if the report is complete.
35+
36+
If the bug includes a ``.crash`` file, extract and inspect the stack trace. Use the information to better understand where the failure occurred in the code.
37+
38+
For more details, see `Evaluate the bug <https://github.com/canonical/ubuntu-maintainers-handbook/blob/main/PackageFixing.md#evaluate-the-bug>`_.
39+
40+
Identify the source package
41+
---------------------------
42+
43+
After selecting a bug to fix, the first step is to identify the source package that contains the code related to the issue.
44+
45+
Start by identifying the name of the binary package. If you know the path or part of the filename of the affected program, run the following command:
46+
47+
.. code-block:: bash
48+
49+
apt-file find <filename-or-path>
50+
51+
.. note::
52+
53+
Replace ``<filename-or-path>`` with either the full path or part of the filename.
54+
55+
For example, both of the following work:
56+
57+
.. code-block:: bash
58+
59+
apt-file find /usr/games/bumprace
60+
apt-file find bumprace
61+
62+
Running the command returns an output similar to:
63+
64+
.. code-block:: text
65+
66+
bumprace: /usr/games/bumprace
67+
68+
In the preceding output, the part before the colon is the name of the binary package.
69+
70+
After identifying the name of the binary package, the next step is to find the source package. Use the following command:
71+
72+
.. code-block:: bash
73+
74+
apt show <binary-package-name>
75+
76+
.. note::
77+
78+
Replace ``<binary-package-name>`` with the actual name of the binary package.
79+
80+
For example:
81+
82+
.. code-block:: bash
83+
84+
apt show bumprace
85+
86+
Now check the output for the ``Source`` field. This field indicates the name of the source package.
87+
88+
It's possible for the name of a binary package to be the same as its source package. If this is the case, then the ``apt show <binary-package-name>`` command won't display the ``Source`` field in its output. In such cases, you can assume the source package name is the same as the binary package name.
89+
90+
Check if the bug has been fixed
91+
-------------------------------
92+
93+
Once you identify the source package, make sure the issue still exists. A fix may already exist in a newer Ubuntu release, in Debian, or upstream. Checking first will save time and avoid duplicate work.
94+
95+
Follow the steps in the following subsections to check whether the problem has already been addressed.
96+
97+
Check if the bug is fixed in a newer Ubuntu
98+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
99+
100+
Use ``rmadison`` to review the versions of the package available across Ubuntu releases.
101+
102+
.. code-block:: bash
103+
104+
rmadison <package-name>
105+
106+
This shows you which versions are available in different Ubuntu series. Look for a newer version than the one you are using. If a fix was introduced in a later version, check the changelog or commit history to verify.
107+
108+
To review changes, clone the package with `git ubuntu`:
109+
110+
.. code-block:: bash
111+
112+
git ubuntu clone postfix postfix
113+
cd postfix
114+
git log -b pkg/ubuntu/<ubuntu-series>
115+
116+
Look through the commit messages and patch files to identify if the issue has been resolved.
117+
118+
Check if the bug is fixed in Debian
119+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
120+
121+
Debian is a key source for Ubuntu packages. Search for bug reports or patches applied there.
122+
123+
First, check Debian’s bug tracker using the URL ``https://bugs.debian.org/src:<package-name>``.
124+
125+
To inspect changes in more detail, find the source repository used by Debian. You can do this in a few ways:
126+
127+
- use ``debcheckout``:
128+
129+
.. code-block:: shell
130+
131+
debcheckout <package-name>
132+
cd <package-name>
133+
git log
134+
135+
- look for the ``Vcs-Git`` and ``Vcs-Browser`` fields from the ``apt showsrc`` command output. These point to the package's source code repository and its web interface:
136+
137+
.. code-block:: shell
138+
139+
apt showsrc --only-source <package-name>
140+
141+
Now, look for commit messages that describe fixes relevant to your issue. If a bug number is referenced, open the link and review the context.
142+
143+
Check if the bug is fixed upstream
144+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
145+
146+
If the problem originates from the software itself and not the package, investigate upstream. Each project has its own bug tracker and code repository.
147+
148+
You can find the upstream project by doing the following:
149+
150+
- search the package homepage listed by running the command ``apt show <package>``
151+
- look up the project through web search if no homepage is set
152+
- check the metadata in the package description or Debian tracker
153+
154+
Once you find the upstream repository, do the following:
155+
156+
1. look through open and closed issues
157+
#. search the commit history for relevant fixes
158+
#. clone the upstream Git repository if available and inspect the logs
159+
160+
If upstream has resolved the problem, consider if that version has reached Debian or Ubuntu. If not, you may propose packaging the new version or backporting the patch.
161+
162+
Offer to help
163+
-------------
164+
165+
Once you confirm the issue still exists, a bug report is open, and no one is working on it, you can offer to help. This step signals your interest in resolving the issue and helps prevent duplicated efforts.
166+
167+
Start by commenting on the bug report in Launchpad. Let others know that you intend to work on the issue. Include any relevant details you have, such as:
168+
169+
- when and how the bug occurred
170+
- how you plan to fix the issue, or what you've tried so far
171+
- any testing you’ve done or plan to do
172+
173+
If the bug doesn't yet exist in Launchpad, create a new bug report. Provide a clear title and description. Explain how the issue can be reproduced, and add logs or screenshots if helpful.
174+
175+
Get the source code
176+
-------------------
177+
178+
Once you're assigned to the bug, get the source code for the affected package. You can get the source code using any of these four methods:
179+
180+
- ``git-ubuntu``
181+
- ``pull-pkg``
182+
- ``apt-get source``
183+
- ``dget``
184+
185+
For detailed instructions on using these methods to get the source code, see :ref:`get-package-source`.
186+
187+
Create a patch to fix the issue
188+
-------------------------------
189+
190+
You may need to create a patch to make changes to a package. Start by checking where your changes are located. If your changes are only within the ``debian/`` directory, for example, in ``debian/control``, you don't need to create a patch. However, if you changed upstream source code, that is anything outside ``debian/``, then you must create a patch and include it in ``debian/patches``.
191+
192+
There are two main methods for creating patches for Ubuntu packages. The method you choose will depend on the workflow that the package source uses:
193+
194+
- If the package uses **quilt**, use the ``quilt`` tool to create and manage patches. To learn how to create a patch using ``quilt``, see `Making a patchfile <https://github.com/canonical/ubuntu-maintainers-handbook/blob/main/DebianPatch.md>`_.
195+
- If the package is maintained using ``git-ubuntu``, commit your changes directly in Git.
196+
197+
Document the fix
198+
----------------
199+
200+
It’s important to document your changes so future developers can understand your reasoning and assumptions without having to guess.
201+
202+
Explain your changes in the ``debian/changelog`` file. This file tracks every change uploaded to Ubuntu or Debian, and future developers rely on it to understand what changed, where it happened, and why.
203+
204+
Run the following command to create a new changelog entry:
205+
206+
.. code-block:: bash
207+
208+
dch -i
209+
210+
This command generates a new entry and opens your text editor. The top and bottom lines will be filled out for you automatically. The top line includes the package name, version, Ubuntu release, and urgency. The bottom line shows your name, email, and a timestamp.
211+
212+
You should also write a short and informative message between the top and bottom lines. This message should include:
213+
214+
- where you made the change, such as file or component
215+
- what the change does
216+
- why you made the change
217+
- link to the Launchpad bug or mailing list discussion, if available
218+
219+
An example of the changelog entry is as follows:
220+
221+
.. code-block:: text
222+
223+
my-package <version> UNRELEASED; urgency=low
224+
225+
* fix crash in system monitor when reading temperature sensors
226+
- updated <script.py> to handle missing sensor values
227+
- added error handling to prevent crashes
228+
229+
-- name <name@example.com> Tue, 13 May 2025 15:42:10 +0000
230+
231+
Reference Launchpad bugs like this:
232+
233+
.. code-block:: text
234+
235+
LP: #<bug-number>
236+
237+
This ensures the bug will close automatically when the fix is uploaded.
238+
239+
Test the fix
240+
------------
241+
242+
Run package tests to check that your change doesn't introduce regressions. Ubuntu uses :term:`autopkgtest` to automate this process. You can run tests in several ways:
243+
244+
- in a local virtual machine (VM)
245+
- through a :term:`Personal Package Archive` (PPA) on Launchpad
246+
- in a container
247+
248+
For local testing, use a VM or container. The `autopkgtest` tool builds test images and runs the tests in an isolated environment. Use this method when you want to debug failures or verify changes before uploading to a PPA. If your testbed needs to reboot or be isolated, use a VM or container as defined in the package’s ``debian/tests/control`` file.
249+
250+
You can also use PPA-based method whenever possible. It produces results closest to what Launchpad runs for archive packages. After uploading your package to a PPA and building it, you can trigger tests using the ``PPA`` tool from ``ppa-dev-tools``. You will need special permissions to launch these tests. Ask for help in the ``#ubuntu-devel`` IRC channel if needed.
251+
252+
To learn how to set up and run these test methods, see `Running package tests <https://github.com/canonical/ubuntu-maintainers-handbook/blob/main/PackageTests.md>`_.
253+
254+
Submit the fix
255+
--------------
256+
257+
Once you've documented and saved your changes in a new changelog entry, run ``debuild``:
258+
259+
.. code-block:: bash
260+
261+
debuild -S -d
262+
263+
The command signs the changes in the file. After that, you can submit your fix by opening a merge proposal. For details on how to do this, see the section on `Merge proposal <https://github.com/canonical/ubuntu-maintainers-handbook/blob/main/MergeProposal.md>`_ in the Ubuntu Maintainer's Handbook.
264+
265+
In many cases, Debian would benefit from the fix as well. Submitting to Debian is considered best practice because it ensures that a wider audience receives the fix. You can submit the fix to Debian by running:
266+
267+
.. code-block:: bash
268+
269+
submittodebian
270+
271+
Running the preceding command walks you through a series of steps to ensure the bug report ends up in the correct place. Be sure to review the diff again to confirm it doesn’t include unrelated changes you made earlier.
272+
273+
Also, ensure you add a clear description of the fix to the inclusion request.
274+
275+
If everything goes well, you will get an email from Debian's bug tracking system with more information. This may take a few minutes.
276+
277+
Sometimes it’s best to get your fix included in Debian first. It will then flow down to Ubuntu automatically. In that case, skip the following steps.
278+
279+
For security updates or updates to stable releases, the fix might already be in Debian or intentionally ignored. In these cases, follow the process described here.
280+
281+
.. link to the article on Security and stable release updates.
282+
283+
If you're doing a security or stable release update, read the article on Security and stable release updates.
284+
285+
You can also follow this process when dealing with Ubuntu-only packages that don’t build correctly, or with issues that affect Ubuntu specifically.
286+
287+
If you're submitting your fix to Ubuntu, generate a ``debdiff``. A ``debdiff`` shows the difference between two Debian source packages. The command is also called ``debdiff``, and it comes from the ``devscripts`` package. For full details, see the `manpages for debdiff <https://manpages.debian.org/testing/devscripts/debdiff.1.en.html>`_.
288+
289+
To compare two source packages, use the ``.dsc`` files as arguments:
290+
291+
.. code-block:: bash
292+
293+
debdiff <package_name>_1.0-1.dsc <package_name>_1.0-1ubuntu1.dsc
294+
295+
Compare the original ``.dsc`` file with the one you generated after making your changes. This will generate a patch that your sponsor can then apply locally by using ``patch -p1 < /path/to/debdiff``. In this case, pipe the output of the ``debdiff`` command to a file and attach it to the bug report:
296+
297+
.. code-block:: bash
298+
299+
debdiff <package_name>_1.0-1.dsc <package_name>_1.0-1ubuntu1.dsc > 1-1.0-1ubuntu1.debdiff
300+
301+
The format of the filename shown in ``1-1.0-1ubuntu1.debdiff`` has some meaning:
302+
303+
1. ``1-`` tells the sponsor that this is the first revision of your patch.
304+
#. ``1.0-1ubuntu1`` shows the version you are working on.
305+
#. ``.debdiff`` makes it clear that it’s a ``debdiff`` file.
306+
307+
While this format is optional, it works well and you can use it.
308+
309+
Next, go to the bug report on Launchpad. Log in, then click **Add attachment or patch** near the comment box. Attach the ``debdiff`` and leave a comment. Explain how the patch can be applied and what testing you've done.
310+
311+
Here’s an example:
312+
313+
.. code-block:: text
314+
315+
This is a debdiff for Artful applicable to 1.0-1. I built this in pbuilder and it builds successfully, and I installed it, the patch works as intended.
316+
317+
Mark the attachment as a patch. This will notify the Ubuntu Sponsors team. Also, make sure you're subscribed to the bug report so you get updates.
318+
319+
You will usually get a review within a few hours to a few weeks. If it takes too long, join ``#ubuntu-motu`` on Libera Chat and ask for help. Stay in the channel until someone responds. They will guide you through your next steps.
320+
321+
After review, the sponsor might upload your fix, request changes, or reject it. If changes are needed, follow the same steps and submit a new ``debdiff`` to the bug. If the fix is rejected because it's not a fit for Ubuntu, you might need to send it to Debian instead.
322+
323+
If you have questions, email ``ubuntu-motu@lists.ubuntu.com`` or join ``#ubuntu-motu`` on Libera Chat. You will find people who share your passion for improving open source and making the world better.

0 commit comments

Comments
 (0)