I'm having some difficulties exactly understanding how the the whole update thing work in Ubuntu and good practice for installing software.
I understand I have a /etc/apt/sources.list
file where all my repositories are listed, and that these repositories are queried when I use apt-get update
– to later be used with e.g.
apt-get upgrade
. This makes perfect sense and I recently installed spotify
by adding
deb http://repository.spotify.com stable non-free
to this "sources" list.
But then I got confused…
When I went to download Google Chrome I merely had to download and grab a .deb
file, and Chrome installed with no problem… but I don't see any new entry in /etc/apt/sources.list
…
So how does apt-get update
know where to query concerning Chrome updates? Has it somehow been added to one of the already listed repositories in the sources file?
I would like all my installed software to be encompassed by the update function.
Best Answer
This is indeed kind of complicated. First,
apt
is a front-end todkpg
which actually handles installing/removing packages. So,/etc/apt/sources.list
(and any files in/etc/apt/sources.list.d/
) are read byapt
, notdpkg
.Now, when you download a
.deb
file manually, you are bypassingapt
and will usedpkg -i packagename.deb
to install it instead. This means that apt's database will not be updated and that theapt
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:
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 thatchrome
will be updated when you useapt-get
.