I installed some self-built deb packages (PAM) withsudo dpkg --force-all -i /opt/bzr/build-area/*.debtree is:/opt/bzr/build-area . libpam0g_1.1.8-3ubuntu1_amd64.deb libpam0g-dev_1.1.8-3ubuntu1_amd64.deb libpam-cracklib_1.1.8-3ubuntu1_amd64.deb libpam-doc_1.1.8-3ubuntu1_all.deb libpam-modules_1.1.8-3ubuntu1_amd64.deb libpam-modules-bin_1.1.8-3ubuntu1_amd64.deb libpam-runtime_1.1.8-3ubuntu1_all.deb pam_1.1.8-3ubuntu1_amd64.build pam_1.1.8-3ubuntu1_amd64.changes pam_1.1.8-3ubuntu1.diff.gz pam_1.1.8-3ubuntu1.dsc pam_1.1.8.orig.tar.gzImportant: What happens when a new official Ubuntu PAM version is released and I run apt dist-upgrade -y? Will it overwrite my own packages?Optional: Do I need --force-all in dpkg -i?Optional: https://code.launchpad.net/~ubuntu-core-dev/pam/ubuntu looks like a dev branch to me? Does a stable branch exist? How to get it with bzr?Related to: https://unix.stackexchange.com/a/382363/239596
What happens to self-built packages when I `apt dist-upgrade`?
ubuntu;apt;dpkg
Yes, they will, if they use a higher version number than your packages, unless you adjust your pin priorities appropriately (or hold the packages, as pointed out by cas). Note that the repositories packages are liable to overwrite yours if you use the same version number, so you should really increment your version when you rebuild locally (typically 1.1.8-3ubuntu1.1).No, and you should avoid it unless absolutely necessary. If you think its necessary, theres probably something wrong with your packages and you should fix that instead.That code repository hasnt been updated since 2014, so I doubt its an active development repository. You can see the various pam branches on Launchpad, and clone them using for example bzr branch lp:ubuntu/vivid/pam.The way I go about dealing with this type of situation is as follows:check out the source code (debcheckout or apt-get source)if its in a repository, create a new branch with the patch Im interested inif its not, apply the patch manuallyin both cases, increment the version with an appropriate changelog entry using dch -n (without committing it, to avoid merge issues)build the package and install it (in my case, via a local package repository)When a new version of the package is released, I repeat the above; in the case of a source repository, I rebase the patch instead of starting from scratch.