The Wayback Machine - https://web.archive.org/web/20150210001733/http://www.howtogeek.com:80/117579/htg-explains-how-software-installation-package-managers-work-on-linux/
SEARCH

How-To Geek

HTG Explains: How Software Installation & Package Managers Work On Linux

image

Installing software on Linux involves package managers and software repositories, not downloading and running .exe files from websites like on Windows. If you’re new to Linux, this can seem like a dramatic culture shift.

While you can compile and install everything yourself on Linux, package managers are designed to do all the work for you. Using a package manager makes installing and updating software easier than on Windows.

Linux vs. Windows

There are a wide variety of Linux distributions and a wide variety of package managers. Linux is built from open-source software, which means that each Linux distribution compiles its own software with its desired library versions and compilation options. Compiles Linux applications generally don’t run on every distribution – even if they could, installation would be hindered by competing package formats.If you locate a Linux application’s website, you’ll likely see a variety of download links for different package formats and Linux distributions – assuming the application’s website provides pre-compiled versions at all. The application may tell you to download the source code and compile it yourself.

image

Software Repositories

Linux users don’t normally download and install applications from the applications’ websites, like Windows users do. Instead, each Linux distribution hosts their own software repositories. These repositories contain software packages specially compiled for each Linux distribution and version. For example, if you’re using Ubuntu 12.04, the repositories you use contain packages specially compiled for Ubuntu 12.04. A Fedora user uses a repository full of packages specially compiled for their version of Fedora.

image

Package Managers

Think of a package manager like a mobile app store – except they were around long before app stores. Tell the package manager to install software and it will automatically download the appropriate package from its configured software repositories, install it, and set it up – all without you having to click through wizards or hunt down .exe files on websites. When an update is released, your package manager notices and downloads the appropriate update. Unlike on Windows, where each application must have its own updater to receive automatic updates, the package manager handles updates for all installed software — assuming they were installed from the software repositories.

image

What’s a Package?

Unlike on Windows, where applications come in .exe installer files that can do anything they like to the system, Linux uses special package formats. There are a variety of package types – most notably DEB on Debian and Ubuntu and RPM on Fedora, Red Hat, and others. These packages are essentially archives containing a list of files. The package manager opens the archive and installs the files to the location the package specifies. The package manager remains aware of which files belong to which packages – when you uninstall a package, the package manager knows exactly which files on the system belong to it. Windows has no idea what files belong to an installed application – it lets application installers manage installation and uninstallation themselves.

Packages can also contain scripts that run when the package is installed and removed, although these are generally used for system setup and not moving files to arbitrary locations.

image

Installing Software on Linux

To install software on Linux, open your package manager, search for the software, and tell the package manager to install it. Your package manager will do the rest. Linux distributions often offer a variety of frontends to the package manager. For example, on Ubuntu, the Ubuntu Software Center, Update Manager, Synaptic application, and apt-get command all use apt-get and dpkg to download and install DEB packages. You can use any utility you like – they just provide different interfaces. You’ll generally find a simple, graphical package manager in your Linux distribution’s menus.

image

Update Delays

One thing new Linux users often notice with package managers and repositories is a delay before new software versions reach their systems. For example, when a new version of Mozilla Firefox is released, Windows and Mac users will acquire it from Mozilla. On Linux, your Linux distribution must package the new version and push it out as an update. If you open Firefox’s preferences window on Linux, you’ll note that Firefox has no ability to automatically update itself (assuming you’re using the version of Firefox from your Linux distribution’s repositories).

image

You can also download and install the application yourself – for example, downloading Firefox directly from Mozilla — but this may require compiling and installing the software from source and removes the benefits of package managers, such as automatic, centralized security updates.

While new versions of Firefox are a priority because they contain security updates, other applications may not be delivered as quickly. For example, a major new version of the LibreOffice office suite may not ever be released as an update for the current version of your Linux distribution. To avoid potential instability and allow time for testing, this version may not be available until the next major release of your Linux distribution – for example, Ubuntu 12.10 – when it becomes the default version in the distribution’s software repositories.

To fix this problem, some Linux distributions, such as Arch Linux, offer “rolling release cycles,” where new versions of software are pushed into the main software repositories. This may cause problems – while you may want new versions of desktop applications, you probably don’t care about new versions of low-level system utilities, which could potentially introduce instability.

Ubuntu offers the backports repository to bring newer versions of significant packages to older distributions, although not all new versions make it into the backports repository.

Other Repositories

While Linux distributions ship with their own repositories pre-configured, you can also add other repositories to your system. Once you have, you can install software repositories from that repository and receive updates from it using your package manager. The repository you add must be designed for your Linux distribution and package manager.

For example, Ubuntu offers a wide variety of personal package archives (PPAs), which contain software compiled by individuals and teams. Ubuntu doesn’t vouch for the stability or security of the packages in these repositories, but you can add PPAs from trusted individuals to download packages not yet in Ubuntu’s repository – or download newer versions of existing packages.

Some third-party applications also use their own software repositories. For example, when you install Google Chrome on Ubuntu, it adds its own apt repository to your system. This ensures you receive updates to Google Chrome through Ubuntu’s Update Manager and standard software installation tools.

image

Chris Hoffman is a technology writer and all-around computer geek. He's as at home using the Linux terminal as he is digging into the Windows registry. Connect with him on Google+.

  • Published 06/27/12

Comments (17)

  1. tech27

    What does ‘repositories’ means ? What does it do ? i recently tried Linux, specifically Zorin OS 6 it’s pretty smooth and clean interface, fast and easy. But I’m new to Linux and I have no idea with those terms and there functions.

  2. Kiran

    @tech27

    Repository is something like app store. Most of the times all Linux distributions maintain there own repositories so that you can install the softwares from those repositories which are compiled to work on those Linux distributions.

  3. Ashwin Rao

    repositories commonly refers to a location for storage of Open Source software’s. There will be a specific repositories for any Linux distros (Operating System) such as Launchpad for Ubuntu where the application developers maintain their packages which will be available for you to download.

  4. Mario

    Windows also has installation packages. Altough not every application uses them, many do. They are those MSI (Microsoft Installer) files you find in many places to download. Even when you download a EXE file, usually it is just a self-exctracting compressed archive containing an MSI and config files.
    Microsoft Installer packages control the files placed on the system, where are they installed, with which permissions, what dependencies they have, and how to uninstall and roll back any changes it has made to the system (registry, DLLs, etc).

  5. michel

    “Using a package manager makes installing and updating software easier than on Windows.”

    no, double clicking a file to install is still easier. And many applications self-update. Plus, my experience with recent versions of Ubuntu is that installation will fail as often as not. That is, if you can find the application you want.

    Ubuntu is terrific in some ways, but the continuing reality is Linux will always be poor choice for most people until 3rd party (commercial) software becomes as available as on any other platform.

  6. Kiran

    @michel

    I dont agree with your statement. Example.

    In Windows
    1. You open a browser
    2. You find the required software in the web.
    3. Download it.
    4. And install it by double clicking the exe.

    In Linux (most of the popular distrubutions)
    1. You open software centre
    2. Search for the required software
    3. Click the install button

    In windows at any time many updated applications run all day in background(like real player and other few) to check if any update available, this may drain your resources, some applications may not update unless you open that software(like firefox). This is not the case in Linux, all applications updates as one application (just like how Windows OS update).

    Yes, if you dont find an application in repository, you may find difficultly to install it from sources. I believe this is because the many users lack of experience in the Linux platform compared to how much understanding they have using Windows or get help from friends.

  7. cam2644

    @michel

    I support Kiran’s reply to you because I’ve found it to be true in practice.
    However Tar.bz files etc can be a bit of a pain although some purists love them.

  8. keltari

    The linux model definitely has advantages and drawbacks. As stated in the article, there can be a long downstream wait for an updated package like firefox to make it into your distribution’s repository. For example, I use Linux Mint. If firefox releases a new version of its browser, you wait till Debian integrates it into its repo, then Ubuntu, then Mint. Some times a package in a repo can be many versions old. I have some linux software that whines every time I start it, because it sees there is a newer version of itself out there. I would have to manually install the newer version, which would conflict with the repo version. In addition to that, some repos simply dont have the software in their repository that you find in other linux distributions.

    Many applications DONT recommend you install their software through repositories. For example, Calibre, the e-book management software, recommends you install and update in manually with a small script.

    @Ashwin Rao – repositories are not limited to free or open source software. Many contain closed source and paid software too. Some linux distros leave those out of their repositories, while others give the user a choice.

  9. dnlsrl

    I love to compile directly from the source code… Though — yeah, it’s true — that’s a pain in the ass if the program needs other package, and that package needs another package, and so on.

    That’s why there are Package Managers :D

  10. michel

    @ Kiran

    Part of my point is, not that many applications must be installed from source (and come one, that’s always a nightmare compared to launching an installer), but that many applications are not available on linux.

    I know linux fans love linux, but please, stop arguing that it’s as good and useful for normal users as windows or OSX. It’s simply not possible to use many of the leading applications. And while you can use some, sort of, if you want to tinker endlessly with Wine, that’s a far cry from easier.

  11. gyffes

    Anybody who’s done a fresh Windows install and suffered through the 9,000 “Software Update > Reboot > Check for new updates > Install Updates > Reboot” lather rinse repeat iterations nightmare should welcome with open arms the loveliness that is Linux package management.

    New install? 100-300 updates to install. Dang, that’s a lot! Install. Reboot. Check. No more updates? Woo!

  12. dragonbite

    Another advantage is that since the libraries are present in the same repository, if Program X needs libABC, and Program Y needs it also, you only need to have 1 copy of it installed.

    Obviously it is also a model that works because why else would Apple and soon Microsoft move to an App Store method, which is basically a repository method, without the benefits of the applications working together!

  13. Kiran

    @michel

    Thats also my point, for a normal use dont use may complex programs, most of the users need a browser, media player and a office product which is not a problem in Linux world. I use Linux so I feel it is easy, and my friends use windows they feel it is easy, and many of my friends call me for windows to resolve simple tasks because the dont know much about computer. Its all about how long you are using a OS. I am sure Windows is a popular OS, at the same time Linux and Macs are not that complicated for a every day user. I have installed several Ubuntu machines for my friends (younger+ and old), non of them call me back asking for a fix for a very long time, (around more than a year). They are okey because they never used Windows before.

  14. howard10

    like Ray replied I am amazed that a mother able to profit $4635 in 1 month on the computer. did you read this page N U T T Y R | C H . C O M

  15. silvertrove

    I would love to install Linux but I just don’t have time to learn all the ins and outs of the OS. I don’t like Windows at all and I know many people who have Linux, some have Windows too, but they all love Linux. After reading this article, I get the idea that it will be even more difficult to learn than I thought. If only I had a geek friend to come over and call for help. :-(

  16. serbanstreza

    I allways had a secret love affair with Linux and installed it as a dual boot on every computer I had. For more than a year now, it is the only os I have (and of course, Andoid on my phone). Also for more than 1/2 year I moved my son’s laptop and the two laptops used as media centres to Linux. I got fed-up with viruses, malaware, etc. I just want something that works! I had to keep a virtual machine with windows on my laptop only because my work has a website that accepts IE7 and nothing else – I know…there are user agents and Wine but it just doesn’t work properly. This is probably where a Windows suporter would say “I told you so!”. Well… not really. It is a problem with the website and the fact the IE has it’s own rules, not because IE is that great. Don’t get me wrong – Windows is a great platform but it needs continous maintenance, it is hungry for resources but it has a fantastic pool of software.
    Enough said. I am more than happy with Linux, I love the open source philosophy and while I might not be able to run some special software … well, their loss! They should make it Linux compatible and I would buy it if it is performant. :)

  17. Beleebe

    With all these reviews, it still confirms that Linux is not yet for the consumer or desktop users. It looks like it is for geeks or technical guys.

Go check your email!
close