Some applications offer a debian package to download. Others offer to add a repository where to install the debian package from. My question is: If you install a debian package, is it any way of making this package to also install the repository which updates it? Is this a standard or is it a discouraged think?
This is something fairly common on packages that are not from the official repository. For example google-chrome and skype use this approach.
First, you get the wanted .deb package file onto your machine by downloading it from a website. Ideally you make sure you are downloading it from a trusted source and not some random internet location.
It is important to note that installing packages from untrusted locations is not secure and not recommended.
Then when installing the package the first time, usually by running dpkg -i
or an equivalent command, the package will install a file with the repository information the /etc/apt/sources.list.d/
folder.
Once that step is done, and upon the next apt-get update
, or similar, the system will load package information from the additional repository. Thus allowing for subsequent upgrades to the package to be installed via the package manager (apt-get upgrade
or equivalent).
It is also interesting to note that this approach does not only facilitate upgrades for the initially installed package, but it can also make new packages available from any repository installed onto the system this way.
Note: The .d folder used in /etc/apt/sources.list.d/
is a common approach used by distros to have a plugable connection configuration. You will find this approach in other services and other parts of the system. Additional information on the manpage for sources.list.