Pages

Tuesday, 20 September 2011

Understanding "Package Management" in Linux


    This post attempts to explain a few things about Linux "Package Management" or "Software Installation/UN-Installation"[from the point of view of a typical windows user] .First thing a windows user should understand is that unlike windows where software is distributed in the form of installers,Linux based software is distributed in the form of packages and typically need other software packages to install properly .

    Linux software /package management is typically comparable to that of a software repository system used by software developers to store source code,maintain different versions of the code and "build" a complete piece of software from the repository using some sort of a build tool.

A few terms one must know regarding package management:-

==>Package:-These are literally packages of various libraries.Usually  contain pieces of source code or binaries and will usually contain meta data which will help in installation of the software.These are comparable to "jar" files in Java.Sample package names are "<SomeName>.deb","<SomeName>.rpm" etc

==>Binaries:- Readily executable pieces of code which are pre-compiled to suit a specific OS like ".exe" like in windows.

==>Software Repositories:-These are more like "chest of drawers",each folder holds a bunch of software packages  where your software is stored and can be typically accessed through FTP clients or your web browsers or by your Linux package managers

==>Source Packages:-Since most of the Linux software is open source i.e. anyone can actually view how the software you use is written and also extend its functionality to suit your own use / tastes.Linux junkies typically  "build" their software using the source packages.For new users there are always ready-made software packages that can be easily installed :-).

==>Package Managers:-These are the tools , software that are used rather invoked to actually install" your software packages.Modern package managers are capable of installing, un-installing, verifying, querying, and updating various software packages.The package managers can be broadly classified into
  • Command line tools(zypper in case of openSUSE ,dpkg in case of debian based systems).
  • GUI based tools(YaST in case of openSUSE,Synaptic in ubuntu)
==>Pre-requisites:-These are usually libraries, binaries that are usually needed by the software package you are trying to install to work properly . Dependencies are of many types like :-
  • Software libraries are collections of utilities used by the software.
  • Command line tools with no GUI.Sometimes these dependencies are command line tools / software which are "complete" in all aspects except for the fact that they don't have good user interface or poor user interface or don't have an user interface at all.An example to prove this case is "winff" which is a popular media conversion tool is a GUI wrapper built around another full fledged media conversion command line based tool called "ffmpeg"
  • Plug-ins which extend the functionality of the software you are installing.
==>Versioning:- Versioning plays a important part in software/package  management in Linux that it not only defines which is the latest as well as newer piece of software but also tightly couples a software to its dependencies , so that installation of the required software is typically not allowed by the package manager until all dependencies are installed.

==>Types Of Software Repositories:-
 Based on ownership of the packages in the repository the Linux repositories may be broadly classified as:-
  • Official :- These repositories have stable and packages are well tested , and the packages are versioned appropriately to provide a optimised environment even for "new" users. They are almost always hosted by enterprise which distributes the Linux distro.
  • Unofficial or Community repos:- These repositories are not maintained by the enterprise distributor. The software in these repositories are packaged(rpm and deb) and maintained by the community that "Love" the distro and sometimes by companies which offers some specialised products. Sometimes these repositories get official branding when they become popular. Typically when they receive such branding the packages in these repositories get moved or copied to a different FTP folder. The downside of installing software from these repositories is that they are not always well maintained and tested and in general donot follow the versioning pattern for packages followed by the parent distro . New users must thread carefully when playing with these repos.
 Due to partial adherence of GNU concepts by the distros we tend to find two kinds of repositories namely:-
  • Oss repos:- These are repositories that contain free software.
  • Non -Oss repos:- These repos contain proprietary software and are not free.
 Based on the updation frequency of the packages  we can classify the  repositories into:-
  • Base repos:- These repos are rarely updated .The packages here are typically built when a new version of OS/distro is released .
  • Update repos:- All subsequent updates to packages are moved to the end user community through the "update" repos an not through the base repos. Hence we latest package of Libreoffice in update repos and not in base repos
Based on the stability of the software packages present in them the repos are classified as:-
  • Stable repos:- Here well tested packages and fit for daily use are present.
  • Unstable repos:- Here partially tested packages are  generally present. These repos are typically called Test repos and in case of openSUSE the repos tend have a colon ":" in their URL .Factory repos are a type of opensSUSE repos which contain packages which are typically going to be present in future releases.

No comments:

Post a Comment