0

i wanted to know what happens in the background when you install a package in linux?

1
  • Files are downloaded and extracted to where they need to be? Jan 24, 2016 at 16:34

1 Answer 1

0

"In Linux" is a bit too broad, so I will restrict my answer to Ubuntu.

There are two mainstream ways of installing packages in Ubuntu:

  • Using Debian packages: this is the default and recommended way of doing it. Debian packages are files with .deb extension. They come with all the needed files (binaries, scripts, documentation, manual pages) to install a program. They can be installed using the dpkg tool. There are several ways of installing from Debian packages, such as using APT (Advanced Packaging Tool) with apt-get, which downloads the requested .deb file from the repositories and uses dpkg to process it. There are some front-ends for APT and dpkg, for example, GDebi and the Ubuntu Software Center.

  • Compiling and installing from the source code: this is a more advanced and difficult task, but sometimes it is required due to lack of precompiled packages or because of some special necessity. This method consists of getting a program's source code and compiling it (usually using GNU building tools, in the Linux world). It may take monstrous amounts of time, depending on your hardware and the size of the source code.

But both ways of installing packages basically do one common thing: placing files in specific locations of your system. These files include everything needed to have a program up and running. The locations include paths like /usr/bin, /usr/share, among tons of others. It varies from package to package.

Not the answer you're looking for? Browse other questions tagged .