Ubuntu – Can a deb package contain a PPA dependency and install packages from the PPA

package-managementppa

When creating a .deb package I create a file named control that contains some fields:

Package: my-qt-app-name
Version: 0.01
Architecture: all
Maintainer: my name <my email address>
Installed-Size: 2
Depends: some-package-from-ppa
Section: extras
Priority: optional
Homepage: my homepage
Description: some description

some-package-from-ppa is not installed on the computer. It can be installed only adding a PPA, running apt-get update and then apt-get install some-package-from-ppa.

Can a control file from a deb package contain a PPA address and install that package when the deb file is installed?

Best Answer

Can a control file from a deb package contain a PPA address and install that package when the deb file is installed?

No. You can only control the name of the package and the version via control file. Why you could do is creating a package that adds a file under /etc/apt/sources.list.d/ with the repository, but it implies a two steps process:

  1. Install the package with the repository, update package list.
  2. Install your package.

Informing your users before hand that they should add first the PPA you need removes the need of having to install the first package and updating the list to just installing your packages. Through adding a third party repository that you don't control (and the user possibly doesn't trust) could cause a security concern, since the third party repository isn't obligated to only serve only the packages you need but whatever packages the owner decides, i.e. adding a rouge version of openssl that replaces Ubuntu's. That's why is recommendable to try hard and only set as dependency packages that either are in Ubuntu's repositories or provide those packages yourself.