Jump to content
  • The 5 Best Linux Package Managers

    aum

    • 386 views
    • 8 minutes
     Share


    • 386 views
    • 8 minutes

    As a new Linux user, you may be completely overwhelmed with the sheer number of choices you have regarding distributions you can install on your computer. What is the difference between Ubuntu, Fedora, openSUSE, and Arch? Ultimately, the short answer is package management.

     

    Each Linux distro offers users a unique method of installing and maintaining their system, with varying degrees of user-friendliness and usability.

     

    This guide will serve as a short primer on performing basic tasks in each package management system, so you can decide which is right for you.

     

    1. APT


    APT is a dependency resolver for Debian-based systems, including Ubuntu. In conjunction with dpkg, the package manager, APT provides an easy way to update, upgrade, install, and remove software. Without APT, maintaining a Debian system would feel like using Linux in the early 1990s, when "dependency hell" was an actual thing.

     

    1. Update Software Repositories


    APT allows you to update the existing repositories within your OS to ensure proper system functioning. A simple update command does the trick in this regard:

     

    sudo apt-get update


    2. Upgrade Software Repositories


    Like the update command, you need to upgrade your existing software repositories to keep your system's functionality top-notch.

     

    sudo apt-get upgrade


    For a more thorough upgrade, which attempts to upgrade conflicting package dependencies to the newest version and removes older or unused dependencies, use the upgrade command differently:

     

    sudo apt-get dist-upgrade


    These commands can be combined to perform an update and upgrade in succession like so:

     

    sudo apt-get update && sudo apt-get upgrade


    3. Install Applications With APT


    To install software with APT, you can use the following command:

     

    sudo apt-get install packageName


    For example, to install the VLC Media Player on Ubuntu, run:

     

    sudo apt-get install vlc


    4. Remove Applications With APT


    To remove a package with APT, you can use the remove command within the Ubuntu/Debian terminal window:

     

    sudo apt-get remove packageName


    For example, to remove VLC, use the remove command:

     

    sudo apt-get remove vlc


    You can remove software on Ubuntu using various methods; the apt-get remove command is just one of these methods. However, some straggler dependencies may remain on your system during software removal or an upgrade.

     

    To avoid system bloating, you should remove these packages from your system. You can use the autoremove command effectively to perform this task.

     

    sudo apt-get autoremove


    5. Search for Installable Packages


    To search for installable packages using APT, use the search command:

     

    sudo apt-cache search packageName


    APT does not currently offer the ability to install a package from a URL, meaning the user must find and download the package to be installed on their own. Ubuntu and some of its derivatives have managed to combat this with single-click apturl links found on some websites.

     

    You can remove the get keyword and still use the apt commands successfully.

     

    2. YUM

     

    Like APT, YUM is a dependency resolver for the underlying package manager, RPM. YUM is the default package management system in several Red Hat-based derivatives. The syntax for YUM is simple, and APT users should have no problem making the switch.

     

    You can use YUM commands on CentOS 7 and below only.

     

    1. Update Software Repositories With YUM

     

    Updating and upgrading through YUM is very simple, where the following command handles both tasks:

     

    sudo yum update


    2. Install Applications With YUM


    To install a package, use:

     

    sudo yum install packageName


    To install the Rhythmbox application, use the install command:

     

    sudo yum install rhythmbox


    3. Remove Applications With YUM


    Likewise, to remove a package, you can use the remove command as follows:

     

    sudo yum remove packageName


    4. Search for Installable Applications With YUM


    To search for an installable package using YUM, use:

     

    sudo yum search packageName


    YUM does not include an autoremove command for finding and removing unused dependencies. However, it does include a great feature for installing a package from a URL, which APT does not include:

     

    sudo yum install url


    3. Zypper

     

    Zypper is another dependency resolver for the RPM package management system and is the default package manager for openSUSE and SUSE Linux Enterprise.

     

    Zypper utilizes RPM binaries, just like YUM, but is a bit faster as it's written in C++, whereas YUM is written in Python. Zypper is extremely easy to use, including command shortcuts that can replace the full command.

     

    1. Update Packages With Zypper

     

    Like YUM, Zypper both updates and upgrades all packages using the following command:

     

    sudo zypper update


    Or:

     

    sudo zypper up


    2. Install Applications with Zypper


    To install applications on openSUSE, use the install command as follows:

     

    sudo zypper install packageName


    Or:

     

    sudo zypper in packageName


    For example, if you want to install VLC on openSUSE, you can use the install command followed by the application name, as shown below:

     

    sudo zypper install vlc


    Follow the on-screen prompts to install the application successfully.

     

    3. Remove Packages With Zypper


    To remove a package, use the remove command:

     

    sudo zypper remove packageName


    Or:

     

    sudo zypper rm packageName


    For example, to remove VLC, use the remove command as follows:

     

    sudo zypper remove vlc


    4. Search for Installable Packages


    When you are not sure which applications are available for installation, you can list them with the search command:

     

    sudo zypper search packageName


    Like YUM, there is no autoremove command included in Zypper. Like Ubuntu, openSUSE has one-click install links for web-based package installation.

     

    4. DNF, or Dandified YUM


    DNF is a rewrite of YUM that utilizes features from Zypper, most notably the dependency-resolving capabilities. DNF is the default package manager for Fedora 22 and higher versions and is the default system in CentOS 8 and above. You can easily manage packages with DNF on RPM-based Linux distros.

     

    1. Update and Upgrade Packages With DNF


    To update and upgrade all available software:

     

    sudo dnf update


    2. Install Applications With DNF


    To install a package on Fedora or CentOS, use the install command as follows:

     

    sudo dnf install packageName


    For example, if you want to install gVim, use the install command:

     

    sudo dnf install gvim


    3. Remove Applications With DNF


    To remove an installed package, use the remove command, followed by the application name:

     

    sudo dnf remove packageName


    To remove an application like gVim, use:

     

    sudo dnf remove gvim


    4. Search for an Installable Package


    To search for a specific application, use the search command:

     

    sudo dnf search packageName


    5. Remove Application Dependencies


    Unlike YUM and Zypper, DNF provides the autoremove command to search your system and remove unused dependencies:

     

    sudo dnf autoremove


    6. Install Applications via URL


    DNF also allows for package installation from a URL:

     

    sudo dnf install url


    There are different Linux package managers like APT, DNF, and YUM. Each package manager brings its own features, making their respective OSes a delight to work with.

     

    5. Pacman


    Pacman is the default package management system for Arch Linux and other Arch-based Linux distros. Pacman is a complete package manager, as it doesn't rely on any underlying systems or frontends to resolve dependencies.

     

    Pacman utilizes a simple compressed ".pkg.tar.xz" file system, which contains all information needed to build source code into a working program.

     

    Think of Pacman as a system to automate manual software building using the source code. Pacman utilizes a "helper" program, Yay, to install unofficial software found in the Arch User Repository, and when doing so, the command "pacman" is replaced by "yay."

     

    While there are a series of Pacman commands to familiarize yourself with, you must remember some of the most basic ones to make your work seamless.

     

    1. Update Your Arch Packages


    When working with packages, you will mostly utilize the "sync" flag (-S), which compares your system with the remote software repository. To refresh your software repos, use the -y command:

     

    sudo pacman -Sy


    2. Upgrade Your Arch Packages


    To upgrade your system, you need to modify your previous sync command with the sysupgrade flag (-u):

     

    sudo pacman -Syu


    3. Install New Applications With Pacman


    To install a package with Pacman, you must sync the package:

     

    sudo pacman -S packageName


    4. Remove Installed Applications With Pacman


    To remove a package, Pacman has a native remove flag. To remove a package (-R), its configuration files (-n), and all unused dependencies, recursively, not installed explicitly by the user (-s).

     

    The -s flag is different from the -s flag used in the sync command.

     

    sudo pacman -Rns


    5. Search for Installable Packages


    To search for an installable package, sync and search (-s) with:

     

    sudo pacman -Ss packageName


    Pacman does not include an autoremove command. However, using the query command, you can search and remove any unused dependencies.

     

    This command will query the database (-Q), check for orphaned dependencies (-t), restrict the search to dependencies (-d), and will not print the process out verbosely (-q, meaning "quiet").

     

    sudo pacman -Rns $(pacman -Qtdq)


    The Evolution of Linux Package Managers


    Linux has come a long way in allowing new users to manage their systems easily. Package managers automatically find required dependencies and provide easy-to-remember commands for installing and maintaining software. Users are no longer stuck in dependency hell, as when Linux was in its infancy.

     

    By testing out the different package managers available, you can find your home in whichever distro you feel most comfortable in.

     

    Source


    User Feedback

    Recommended Comments

    There are no comments to display.



    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.
    Note: Your post will require moderator approval before it will be visible.

    Guest
    Add a comment...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...