Ever wonder what apt-get does underneath?

Shower thoughts

This question came from when I was showering one day: What does apt-get or apt or yum, pacman does underneath to install all those programs that you have specified?

Well you're in luck because the past me have did a good research on how it works. Here is the jist of it:

note the actual installation process is done by dpkg underneath for Debian based distro. apt-get is really just a wrapped on top of dpkg for fetching those pre-compiled binaries for dpkg to install.

So under the hood package managers like apt-get is looking up list of packages to know where to find their pre-compiled binary. When you ask to install it, it will go and fetch the pre-compiled binary and install it into your system.

Pre-compiled vs compiling from source

Compiling from source is what it sounds like. You have the source code, for example, bunch of .c files, and you will compile it into a program and install it into your system yourself.

Pre-compiled binary is a binary executable that is compiled to work on most environments, although it might not be most optimized for your targeted system, but it will work.

When you compile from source, you get more options because you are able to change the flags to do different type of optimization, and the compiler will optimize instructions specifically for your system. Pre-compiled binary don't get to enjoy those type of optimization but the ease of use is a trade-off. You don't have to compile anything because you just need to download them and it will work for your system.

.gz .xz, .tar.gz files

To decompress .gz file use the tool gzip

To decompress .xz file use the tool unxz

To decompress .tar.gz file use tar




Revision #4
Created 14 January 2023 04:36:07 by Tamarine
Updated 14 January 2023 04:54:20 by Tamarine