How to see if a .deb package inserts a repository

debpackage-management

On Xubuntu 16.04, I want to install the latest Virtualbox package. I know that I could install it through APT and receive updates through the Ubuntu repositories, or I could add a PPA (if there was one) and receive it from there.

At this link I can either download the package or add it to sources.list and install it: https://www.virtualbox.org/wiki/Linux_Downloads

But I would rather install the latest package by downloading it from their website. I if ran "dpkg -i install packagename", it would install the package, but would it add a new repository from which I would receive updates whenever I ran "sudo apt-get update && sudo apt-get upgrade"? Can I somehow check if the package contains such a repository?

Best Answer

It's not fool-proof, but this will give a good indication:

dpkg-deb -c virtualbox-5.1_5.1.12-112440\~Debian\~stretch_amd64.deb|grep etc/apt

In this case nothing is found, so it looks like the package doesn't add a repository.

We're specifically looking for files in /etc/apt/sources.list.d. It's not fool-proof because packages could add a repository in their postinst. You can examine the latter using

dpkg-deb --ctrl-tarfile virtualbox-5.1_5.1.12-112440\~Debian\~stretch_amd64.deb|tar xf - ./postinst

then reading the extracted postinst (which confirms that the package doesn't add a repository).

Related Question