User-Level Intro to Linux

Module #04 - Software Packages Management

This module is going to introduce you to the art of software package management. This brief overview is from the end-user perspective. Other offerings in the Linux track will revisit this topic from a system administrator perspective.

Topics Studied in this Module

T1 - Software Packages Managers
Generalities about SPMs & specifics on the dpkg then APT tools.
T2 - The dpkg Tool
Introduction to the Debian package manager - dpkg
T3 - The APT Tools
Introduction to Debian Advanced Packaging Tools - APT

Learning Activities

This module features the following learning activities; DF, PA, GQ

Linux+ Exams Objectives

This module deals with material related to the following objectives from the CompTIA Linux+ and LPI certifications exams.

  • Exam LX0-101 - Objective 102.4 - Use Debian package management

T1 - Software Package Management

We will start our exploration of SPMs with an overview of the various tools involved, along with the idea of dependencies between packages.

  • Software Packages Managers - Overview
  • Video Link: YouTube
  • An overview of Software Packages Managers in terms of the different software package formats, repositories and tools. As is usual for longer videos, here are links to the main parts;
  • 20.04LTS Ubuntu Server Guide - Package Management
  • URL Link: Ubuntu Server Guide
  • This section of the Ubuntu server guide is a must read for this module. It details the various package management tools we will be discussing, and more. Pay particular attention to the fact that Ubuntu now comes standard with the latest evolution of the apt-get command, simply named apt. While the former will be enough for us to illustrate package management concepts, and is still available to use, this reading assignment will brief you up on the latest and greatest evolution of this technology. Additionally, you may want to take a peek at this apt vs. apt-get, tutorial at ItsFoss by Abhishek Prakash
  • Wikipedia - Package Managers
  • URL Link: wikipedia entry
  • A good read to understand what a package manager is.

T2 - The dpkg Tool

The following resources will provide you with information about the dpkg tool.

  • Wikipedia - dpkg
  • URL Link: wikipedia entry
  • A good overview of the dpkg tool and its relation to other package managers
  • Wikipedia - .deb files format
  • URL Link: wikipedia entry
  • Since dpkg handles .deb files, it might be a good idea to browse this wikipedia entry to get a better understanding of the underlying structure of a .deb files
  • Using dpkg to install software
  • Video Link: YouTube
  • Introduction to the dpkg debian package manager as it is used to install .deb software packages files
  • Packages Search page on the Ubuntu site
  • URL Link: Packages Ubuntu Site
  • This site is used in the above video to locate information about .deb software packages files and download them.
  • Using dpkg to get information on installed software
  • Video Link: YouTube
  • Features of dpkg used to search for specific installed software packages
  • Using dpkg to remove installed software
  • Video Link: YouTube
  • Features of dpkg used to remove or purge software packages

T3 - The APT Tools

The following resources will follow the same topics but for the APT suite of tools

  • Advanced Packaging Tools - Overview
  • Video Link: YouTube
  • Overview of the dependencies management problem and introduction to APT
  • Ubuntu HowTo - APT
  • URL Link: How To - APT
  • Overview of the APT suite of tools from the Ubuntu community site.
  • Wikipedia - APT
  • URL Link: wikipedia entry
  • Good introductory reading on the APT suite of tools and how it relates to other package managers.
  • Using APT tools to install software
  • Video Link: YouTube
  • How to use the apt-get tool usage to install software
  • Using APT tools to search through software packages
  • Video Link: YouTube
  • How to use apt-cache & apt-file tools to search through software packages
  • Using APT tools to remove software packages
  • Video Link: YouTube
  • How to use apt-get to remove software packages and manage the size of the package local cache in /var/cache/apt/archives/

Please note that, unlike DF assignments in other modules, this one should be worked on after you have already completed the PA.

Topic - Comparing Software Package Management Tools

The Discussion Forum for this module will be used to discuss the differences between the following SPMs;

  • Ubuntu Software
  • Synaptic GUI tool
  • APT CLI tools

While the APT suite of tools is already pre-installed, and so is the Ubuntu Software center, you will have to install yourselves the Synaptic package manager.

Requirements for your Posts

Unlike the previous DF assignments which were solely based on researching information on various topics, your post in this DF will be also based on your personal hands-on experience with the above. The objective is for you to experience GUI front ends to package management and establish their capabilities with respect to the APT suite of tools we studied. To this end, your post should address the following comparison elements;

  • Are all tools providing access to the same repositories? Ubuntu repositories are structured into categories or components; main, restricted, universe, and multiverse. Use evidence to determine whether all 3 package managers have access to all parts of the Ubuntu repository. Evidence may consist of a screenshot showing some configurations on your virtual machine, or detailed references to primary sources (e.g., ubuntu official documentation, man pages...)
  • What are the differences in the options available to search for packages in all 3 packages managers? Some of the 3 above-mentioned tools might allow you to search by version number, or other criteria, while others might not. Identify features that are not shared among all 3 tools and thus make one of them particularly well suited for a given type of package search, when compared to the others.
  • Is it easier, in any of the 3 above-mentioned tools, to update only specific selected packages, update all packages in one shot, or even prevent a selected package to be further updated when we update all packages in the future?
  • How does this whole package management business on Linux compare to what is done in Microsoft Windows or Apple Mac OSX

Refer to the Sample Module for details regarding expectations & guidelines. As usual, your opinions must be based by primary references (e.g., man pages, ubuntu official documentation) rather than secondary ones (tutorials, blogs). In this DF, evidence in the form of screenshots of actual commands or configuration information from your virtual machine might also help support your claims.

The primary objective of this activity is to have you get some experience with the various package management approaches. It will also serve to push you further along the way of learning to look up information about specific tools, experimenting hands-on with them, and taking notes about how they work.

This PA is also a good link between the study material and the DF activity so make sure to work on it before to start your DF assignment.

Also, make sure you understand that some of the tasks you are going to be asked to perform with different tools might not be feasible in all of them. At the very least, some tools will be much easier to use to perform some tasks, than other. It is the goal of this PA to have you experiment and try to figure out how to get things done with each of the tools. If your conclusion is that one of the tool does not allow you to perform a given task, this should provide you with information to fuel your DF assignment post.

Task 1 - apt basic usage

The first 2 tasks will involve apt, a utility commonly used in Ubuntu for managing software. Use the following packages for this PA:

  • GIMP - The GNU Image Manipulation Program
  • OpenJDK - An open source implementation of the Oracle JDK
Use apt to complete the following tasks:
  • Install the software packages
  • Uninstall the software packages
  • List the already installed software packages

You must submit a screenshot demonstrating the proper use of apt to accomplish these goals as well as the output from when the commands run. Do not forget to have your full name show in the command line terminal shown in your screenshots.

Task 2 - More apt usage

Complete the following tasks again using apt:

  • Update one software package to its latest version, it can be any package which needs to be updated.
  • Update all installed software packages

Submit a screenshot demonstrating how you would use apt to accomplish these goals, make sure the command you used is clearly visible.

Task 3 - Advanced package management with dpkg

apt is a useful tool which abstracts many of the details which go into package management in Linux. It is a front-end for dpkg, the package management program used in Debian systems, such as Ubuntu. Dpkg provides a lower level interface for managing software on Ubuntu.

Complete the following tasks:

  • Skim the man pages for both dpkg and apt, also do some research on them online. Explain in your own words how these commands differ, and why apt is more convenient than dpkg for managing software.
  • Try to install a package of your choice using dpkg, list the command you would use to install the package. The command does not actually have to complete successfully, you just need to tell me what options you would use with dpkg to install a package.

Task 4 - Exploring other package management solutions

As I mentioned before, dpkg is used on Debian based distributions, such as Ubuntu. However, not all Linux distributions use dpkg to manage software. In particular, Red Hat and its derivatives (Fedora, CentOS, etc.) use a package manager called rpm. Do some research on rpm and explain, in your own words, how it differs from dpkg.

You may wish to start by reading this article; https://www.tecmint.com/linux-package-management/. It provides a nice overview of how dpkg, apt, and rpm relate to each other.

Task 5 - Using the GUI to install software

So far we have looked at ways to manage software from the command line. There are also graphical tools to accomplish the same goals, though typically they are less powerful. We are going to experiment with "Ubuntu Software" which you will find either in the “Applications” menu, or by searching for its name using the Unity "search your computer" tool (the big button top right). Use it to browse through the available software packages and try to perform the following tasks on the same software packages you used in the first 2 tasks:

  • Install the software packages
  • Uninstall the software packages
  • List already installed packages
  • Update a package
  • Update all packages

Submit screenshots demonstrating how you would use Ubuntu Software to accomplish these goals.

Learning more about APT tools

  • Ubuntu software repositories are organized into categories. The following link will help you understand the difference between the main, restricted, universe, and multiverse components of an Ubuntu software repository.

Snaps: Managing Apps as Containers

Canonical, the company backing Ubuntu has introduced a new way to package applications that is meant to allow the deployment of a single package on a wide variety of Linux distributions. This represent an interesting development from the current situation that requires a software developer to have their software packaged in different formats, each aimed at a specific family of Linux distributions. For instance .deb packages are for Debian distributions, .rpm are for RedHat ones, and so on so forth...

You should use the following resources if you are curious about this new approach to software packaging;

  • The Wikipedia page on snappy, the package manager handling snap packages, is a good starting point to learn about this new format.
  • First, you may start learning about snap packages from a pragmatic perspective with this 2016 video from Joe Collins Ezee Linux YouTube Channel. It focuses on how to perform backing software package management operations using the new format.
  • This 2016 video from Container Camp introduces the concept of Snap package with an emphasis of its relation with containers.

Just for Fun...

Now that we have played for two modules with the Linux Command Line Interface and looked into repositories, you might enjoy exploring how all of this applies in the Android OS world.

  • Linux distributions each feature repositories. Android is based on Linux and has the Google Play app market, which is, in essence, a repository. However, there is more. Download the F-Droid app and access the F-Droid repository of open source Android apps.
  • It might be interesting for some of you to investigate how an Android installation differs from a traditional Linux distribution. This is something you may explore by installing the Termux Android app. The app is available from the Google Play app store, but it is also available from the above-mentioned F-Droid repository. This tool will allow you to interact with your Android system via a command line interface, much like you would do with a regular Linux installation. I particularly recommend playing with Termux::API which will allow you to access, also via the CLI, some of the Android specific features; e.g. GPS, TTS, Camera... This will become particularly fun after we learn to do some scripting with the Bash shell :)
  • It took a while, but even Microsoft Windows has progressively adopted the idea of proper package management :)
    • Chocolatey was one of the earliest attempts, contributed by a third party, to provide Windows-based tools comparable to those available in Linux.
    • The advent of app marketplaces on Android and IOS precipitated the development of the Microsoft App market. In all fairness, this represented a first step toward a better software package management but never replaced adhoc installation methods.
    • As of 2020, we are well on the way to a Microsoft Package Manager; winget. For a more journalistic early coverage, you may check out this ZDNet article by Liam Tung.
  • snap packages are not the only new packaging format, you might want to look at this 2017 video from Egee in order to look at how the Snap format compares to FlatPak. Since then, the App Image format brought to the table another strong contender.

This module features a new kind of assignment. As of summer 2020, we are only testing these out for the first time so they are not going to be mandatory. See announcements from your instructor about details on how we will make use of them.

Why learning via a Case Study?

No matter which technology you study, there are always going to be a plethora of variants, improvements, and alternatives available. From a pedagogical point of view, it may be advantageous to pick one such alternative and focus on it rather than simply provide an overview of too many technologies to be able to play with any one in enough depth.

However, there is also something to be said for the overview-first approach. Unfortunately, it is generally one or the other, never both, that are used in a course... Or is it? ;p

The case study objective is to supplement the lectures.

  • During the former, we focus on a single representative technology and study it in a decent amount of details.
  • During the case study, you are expected to use the structure of the lectures in order to search for similar information about one of the alternative technologies.
This is meant to allow you to leverage, by analogy, what you just learned. It will also allow you to get a peek at another technology, via your own case study, and be able to browse other technologies by looking at your classmates' work.

What is expected for this case study?

You will find below a list of possible topics for a case study related to the material we covered so far in the course. For this case study, the theme is definitively tightly centered around the idea of software package managers. The first step in your work is to pick one such topic.

Once you have selected a technology that you are interested in learning, review the lectures on dpkg and apt. Your goal is to go through the list of tasks listed below and demonstrate how the new technology handles them. Your review is aimed at your fellow IT students, think that you are sharing with other IT professionals an advice on whether the new technology is worth using instead of APT.

The result of your experimentations with the technology will have to be submitted as a link to YouTube video. The video will have to not exceed 15 minutes in duration. In it, you will address each of the tasks listed in the next subsection. For each task, you are expected to demonstrate how to perform it with the technology that you chose for your case study. You are also expected to demonstrate using the command line interface as opposed to using a GUI tool.

As you work through each of the tasks, two situations may occur;

  • If the technology is significantly different, you may have to explain why some of these tasks are not relevant to it, and demonstrate instead what would be done to achieve a similar goal.
  • If the technology allows you to perform exactly the same task, then make sure you also explain what would be the pros and cons of using this technology for this particular job, instead of relying on APT.

We recommend that, if you do not want to release the video publicly, you set it for "unlisted" release. That way, only the people with the link you will provide to your video will be able to access it. That link will be what you submit as the result of your assignment.

What are the tasks that you need to replicate?

This list is a summary of the main tasks that we illustrated in our lecture videos on dpkg and apt. Refer to the videos for the complete list.

  • Install a software package and all its dependencies by name
  • Search for the name of a software package on a repository, based on partial name, keywords, text from the description of the packagage, or patterns thereof
  • List all the files that were installed by a software package, or determine to which software package a given file belongs.
  • Uninstall a software package while preserving its configuration files
  • Purge a software package so as to also remove all its configuration files

Suggestions for topics

The list below, as the above title suggests, is only a starting point. If you think of another technology you would like to investigate further with your case study, please contact your instructor ahead of time so that he may validate your topic, if applicable.

The topics are broken down into theme, each theme is a subsection below. In each subsection, you will find a bullet items list of different technologies; you only need to pick one of these for your case study.

Theme #1 - It is not quite the same, you see?

The technology we studied in the lecture is really at the core of one family of Linux distributions: Debian. Each distribution, or family thereof, may bring new ideas to the discussion about what makes a good software package manager. The group of topics will allow you to explore and compare the Debian approach to that of other mainstream, or more esoteric, Linux distributions.

  • Topic #1.1 - Redhat Package Manager (RPM format) & Yellowdog Updated, Modified (YUM)
  • Topic #1.2 - Dandified YUM (DNF)
  • Topic #1.3 - PACMAN on arch Linux
  • Topic #1.4 - Zypper on Open Suse
  • Topic #1.5 - Portage on Gentoo

Theme #2 - A new Generation of package managers

In contrast to the first group of topics, these topics illustrate a completely different approach to software packages management.

The following topic is reserved for those of you who are even more interested in researching something out of the beaten path.

  • Topic #2.5 - NixOS purely functional approach to package management

Theme #3 - All the cool kids are doing it

If you are interested in leveraging what you just learned about Linux in the context of another operating system, the following topics might be of interest to you;

How will your work be graded?

Your YouTube video will be graded according to the following rubric according to three distinct aspects. Please note that the "raw" grade will be on 32 points and will be converted to a grade over 5 points for inclusion in the gradebook.

Aspect #1 – Technical Skills & Understanding [20 points]

  • Effective demonstration of the relevant options allowing to implement each of the tasks at hand with the technology selected for the case study
  • Completeness of the demonstration and coverage of the new technology’s features relating to the tasks at hand
  • Evidence, during the comparative discussion, of a solid understanding of how the technologies discussed in the course allow to handle each of the tasks at hand
  • Evidence, during the comparative discussion, of a solid understanding of how the technology selected for the case study allows to handle each of the tasks at hand
Each of the above criteria will be evaluated for each of the previously listed tasks.

Aspect #2 – Critical Thinking [8 points]

  • Logic of the arguments used when discussing comparatively the technology used for the case study vs. the technologies studied in the course; e.g., avoid falling for logical or rhetorical fallacies.
  • Soundness of the conclusions drawn regarding the comparative pros and cons
  • Appropriate use of relevant, valid, and reputable references to back arguments
  • Inclusion of a brief discussion of why these references are relevant, valid and reputable in the context of this work.

Aspect #3 – Communication Skills [4 points]

In addition, the following rubric will be applied to evaluate the quality of your presentation;

  • Clearly conveying the structure of the presentation; e.g., it should be clear at any point in time which task is being discussed and what technology we are reviewing or demonstrating.
  • Effective communication of technical steps involved in solving the task, clear definition of the goals for the task.
  • Student overall eloquence
  • Audio and video quality; e.g., readability of the terminals during screencast.

Please note that the above rubric was adapted from a capstone project presentations grading rubric. As such, it might be interesting for some of you to see how such presentations might be evaluated, and even get some practice with this extra credit assignment.