How does update work with programs installed from .deb file
This is indeed kind of complicated. First, apt
is a front-end to dkpg
which actually handles installing/removing packages. So, /etc/apt/sources.list
(and any files in /etc/apt/sources.list.d/
) are read by apt
, not dpkg
.
Now, when you download a .deb
file manually, you are bypassing apt
and will use dpkg -i packagename.deb
to install it instead. This means that apt's database will not be updated and that the apt
system will have no knowledge of the package you installed. In other words, apt-get upgrade
will never update any manually installed packages.
Having said that, chrome
is actually an exception to the rule. When you go to its download page, you will see this message:
At the bottom is this note:
Note: Installing Google Chrome will add the Google repository so your system will automatically keep Google Chrome up to date. If you don’t want Google's repository, do “sudo touch /etc/default/google-chrome” before installing the package.
This means that the .deb
package includes a script that will add Google's repository to your system (specifically, it will create a file at /etc/apt/sources.list.d/
) thereby ensuring that chrome
will be updated when you use apt-get
.
apt searches in the sources listed in /etc/apt/sources.list
and also all files in /etc/apt/source.list.d
. You will have a file such as google-chrome.list
in /etc/apt/sources.list.d
which will have the following line:
deb http://dl.google.com/linux/chrome/deb/ stable main
This is used as the source for updating google-chrome.
When you downloaded the deb file for google-chrome manually and installed it, a script in the deb file created this file, so that you don't have to manually search for updates.