Create a Personal Package Archive (PPA)¶
Personal Package Archives (commonly called PPAs) are software repositories that allow users to distribute free software packages. PPAs are built and hosted on Launchpad and can be installed just like any package in the official Ubuntu archive.
Warning
Launchpad does not endorse any software in PPAs. Make sure you trust the PPA owner before installing their software.
Create a PPA¶
Launchpad users can create PPAs via the web user interface or using the API.
Log into Launchpad and go to your profile page at
https://launchpad.net/~. For team PPA’s, go to the team’s overview page.Select create a new PPA
On the Activate a Personal Package Archive page, read the PPA terms of use and fill in the details of your new PPA.
You must check the I have read and accepted the PPA Terms of Use box before activating your first PPA.
Select Activate.
You should see the new PPA under Personal Package Archives on your profile or team overview page.
Open lp-shell on the terminal:
lp-shell production devel
Fetch your user or team profile and store it in a variable. For a team, replace
lp.me.namewith the team’s Launchpad name:owner = lp.people[lp.me.name]
Using the
createPPAendpoint, define and create your new PPA:owner.createPPA(name="test-ppa", displayname="Test PPA", description="Create new PPA using API.", distribution=lp.load('ubuntu'))
Verify the PPA has been created by checking the list of PPAs associated with your profile:
[print(ppa.name) for ppa in owner.ppas]
All parameters used to create PPAs are optional. However, you can’t
create a PPA with the same name as an existing one. If distribution
is not declared, Ubuntu is used by default.
Edit an existing PPA¶
After creating a PPA, you can change its details either through the web user interface or using the API.
Log into Launchpad and go to the PPA’s overview page, for example
https://launchpad.net/~/+archive/ubuntu/test-ppa.Select Change details.
On the edit page you can change the following:
Display name – a short title for the PPA.
Description – a short description of the PPA. URLs are allowed and rendered as links.
Enabled – whether the PPA accepts and builds uploaded packages.
Publish – whether the apt repository is updated. If disabled, nothing is published; for a private PPA no builds are dispatched either.
Build debug symbols – create debug symbol packages for builds in the PPA.
Publish debug symbols – publish debug symbol packages in the apt repository.
Processors – the architectures on which the PPA can build. Some architectures are restricted and may only be enabled or disabled by administrators.
Save any changes you’ve made.
Open lp-shell on the terminal:
lp-shell production devel
Fetch the PPA you want to edit and store it in a variable. Replace
ownerwithlp.people[lp.me.name](or the team) and adjust the PPA name:ppa = lp.people[lp.me.name].getPPAByName(name="test-ppa")
Change one or more of the editable attributes:
ppa.displayname = "Renamed Test PPA" ppa.description = "Updated description for the PPA." ppa.build_debug_symbols = True ppa.publish_debug_symbols = True
Save your changes back to Launchpad:
ppa.lp_save()
To change the architectures the PPA can build on, use the
setProcessorsendpoint (theprocessorsattribute is read-only and cannot be set directly):amd64 = lp.processors.getByName(name="amd64") arm64 = lp.processors.getByName(name="arm64") ppa.setProcessors(processors=[amd64.self_link, arm64.self_link])
Note
The Enabled and Publish options are only available through the web interface; they are not currently exposed via the API.
Manage archive dependencies¶
A PPA can depend on other archives, so that packages published in those archives are available when building packages in your PPA. Dependencies can be managed either through the web user interface or using the API.
Log into Launchpad and go to the PPA’s overview page, for example
https://launchpad.net/~/+archive/ubuntu/test-ppa.Select Edit PPA dependencies.
On the Edit PPA dependencies page you can:
Choose which packages of the distribution’s primary archive are used as build dependencies (for example Basic, Security, Default, Proposed or Backports).
Add another PPA as a dependency by entering it in the Add PPA dependency field.
Remove existing dependencies by selecting them under Extra dependencies.
Save any changes you’ve made.
Note
Pin priorities cannot currently be set through the web interface. To assign a custom pin priority to a dependency, use the API as described in the next tab.
Open lp-shell on the terminal:
lp-shell production devel
Fetch the PPA you want to add a dependency to, and the archive it should depend on:
ppa = lp.people[lp.me.name].getPPAByName(name="test-ppa") dependency = lp.people["some-owner"].getPPAByName(name="other-ppa")
Add the dependency using the
addArchiveDependencyendpoint. Thepocketis given as a string, for example"Release":ppa.addArchiveDependency(dependency=dependency, pocket="Release")
Pin priorities
When adding a dependency you can optionally set a pin_priority, an
integer that controls the APT pin priority used for packages provided
by the dependency. Higher values make packages from the dependency
preferred over others. The value must be in the range -100 to
2000; if omitted, it defaults to 500. Pin priorities can only
be set through the API; the web interface does not yet expose them.
See also
For details on how APT interprets pin priority values, see the apt_preferences(5) manual page.
To add a dependency with a custom pin priority, include a value for pin_priority when declaring the dependency:
ppa.addArchiveDependency(dependency=dependency, pocket="Release", pin_priority=1000)
You can also change the pin priority of an existing dependency by editing the
IArchiveDependencyrecord directly and saving it:archive_dependency = ppa.getArchiveDependency(dependency=dependency) archive_dependency.pin_priority = 900 archive_dependency.lp_save()
Note
Custom pin priorities are only supported for PPA dependencies. If
the dependency points to a non-PPA archive (such as the primary
Ubuntu archive), the pin priority must be left at its default
value of 500. Attempting to set any other value for a non-PPA
dependency is rejected with an error, because a custom pin
priority would never take effect for such archives.