0%

0/1 Lessons

Introduction to Linux Server Operating Systems

• 30min

0 / 3 lessons complete

Linux Server Installation and Lab Setup

• 23min

0 / 6 lessons complete

Working with the Linux Command Line Interface

• 1hr 30min

0 / 12 lessons complete

User and Group Management

• 44min

0 / 7 lessons complete

Linux Storage

• 30min

0 / 6 lessons complete

Linux Administration Basics

• 53min

0 / 8 lessons complete

Linux Networking

• 47min

0 / 8 lessons complete

Course Conclusion

• 5min

0 / 1 lessons complete

Installing and Managing Packages

Instructions

Q&A (0)

Resources (0)

Saving Progress...

Resources

There are no resources for this lesson.

In this lesson, you'll learn about package management in Linux, focusing on the apt package manager. By the end of this lesson, you'll understand how to search for, install, update, and remove packages using apt. Additionally, we'll briefly compare apt with other popular package managers, highlighting their similarities and differences.

Understanding Package Managers in Linux

Package managers are tools that automate the process of managing software on your Linux system. They handle the installation, updating, configuration, and removal of software packages. Each Linux distribution tends to favor a specific package manager, though they generally perform similar functions. The most common package managers include:

  1. APT (Advanced Package Tool): Used in Debian and Debian-based distributions like Ubuntu.
  2. YUM (Yellowdog Updater, Modified): Utilized in Red Hat and Red Hat-based distributions like CentOS.
  3. Zypper: The package manager for openSUSE.
  4. Pacman: Designed for Arch Linux.

These package managers differ mainly in their commands and package repositories but share the common goal of simplifying software management.

Working with apt in Ubuntu and Debian

Searching for Packages

To search for a package in the apt repository, use the command:

apt search package_name

Replace package_name with the name or description of the software you're looking for. Search for the package named cowsay.

Installing Packages

To install a package, the command is:

sudo apt install package_name

In this example, we will install the package cowsay:

sudo apt install cowsay

Also install the package named fortune, then you can pipe fortune to cowsay and get output like the following:

paulh@ubuntu-server:~$ fortune | cowsay
 _______________________________________
/ As flies to wanton boys are we to the \
| gods; they kill us for their sport.   |
|                                       |
\ -- Shakespeare, "King Lear"           /
 ---------------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

List installed packages

You can list all install packages by using the command below:

apt list --installed

Updating Package Lists

Before installing new software or updating existing packages, it's a good practice to update the list of available packages:

sudo apt update

Upgrading a specific package

There may be times when you only want to upgrade one specific package instead of all of your packages. You can accomplish this with the command below:

sudo apt install --only-upgrade package_name

Upgrading Installed Packages

To upgrade all your installed packages to their latest available versions, use:

sudo apt upgrade

Removing Packages

To remove an installed package:

sudo apt remove package_name

To remove a package along with its configuration files:

sudo apt purge package_name

Comparison of Package Managers

Feature / Package ManagerAPTYUMZypperPacman
Base DistributionDebian-basedRed Hat-basedopenSUSEArch Linux
Search Commandapt searchyum searchzypper searchpacman -Ss
Install Commandapt installyum installzypper installpacman -S
Update Package Listapt updateyum check-updatezypper refreshpacman -Sy
Upgrade Packagesapt upgradeyum updatezypper updatepacman -Su
Remove Packageapt removeyum removezypper removepacman -R

Verifying Your Actions

After performing any package management operation, you can verify it by checking the status of the package. For instance, to verify installation:

apt list --installed | grep package_name

That is all we need to cover in this lesson.. See you in the next one!

Server Academy Members Only

Sorry, this lesson is only available to Server Academy Full Access members. Become a Full-Access Member now and you’ll get instant access to all of our courses.

0 0 votes
Lesson Rating
Subscribe
Notify of
profile avatar
0 Comments
Inline Feedbacks
View all comments