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?


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).

  • This doesn't find google-chrome.list, for example, because it's added by the postinst. I think that's a common case. Actually, Chrome is especially nasty because it rewrites the APT sources from a daily cron job (which the postinst invokes immediately). – Gilles 'SO- stop being evil' Jan 12 '17 at 13:41
  • 1
    Thanks for pointing that out (I got it wrong in my comment on Serg's post); the second part about looking at postinst is all the more relevant. In Chrome's case, the download page does explain how to disable that behaviour (touch /etc/default/google-chrome before installation). – Stephen Kitt Jan 12 '17 at 13:49
dpkg-deb -c <package.deb> | grep /etc/apt/sources.list.d

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.