0% found this document useful (0 votes)
19 views16 pages

Linux

The document outlines a lab session focused on managing software packages in Ubuntu using the APT package manager. It covers essential commands for checking package manager versions, installing, updating, and removing software, as well as troubleshooting techniques for dependency issues. The lab provides practical experience in maintaining a reliable and up-to-date Ubuntu environment.

Uploaded by

kameliazaiter4
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views16 pages

Linux

The document outlines a lab session focused on managing software packages in Ubuntu using the APT package manager. It covers essential commands for checking package manager versions, installing, updating, and removing software, as well as troubleshooting techniques for dependency issues. The lab provides practical experience in maintaining a reliable and up-to-date Ubuntu environment.

Uploaded by

kameliazaiter4
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 16

University of Science and Technology Houari Boumediene " U.S.T.H.

B"
Faculty of Electrical Engineering (FGE)
Department of Telecommunications

Module: Administration of Linux Systems

Dr. Mohamed LICHOURI

Lab 2: Managing Software Packages in Ubuntu

Zaiter kamelia zahra


222231517412
Ouchene ikram
222231353006
Sous groupe 1

Part 1: Understanding APT

In this first part, we learned about Ubuntu's built-in


package manager called APT (Advanced Packaging Tool).
APT allows users to handle software installations, updates,
and removals easily and efficiently.

Step 1: Check the system package manager version

Command used:

apt –version
 Explanation:
This command displays the version number of APT
installed on your Ubuntu system.
 Why it is useful:
It confirms that APT is correctly installed and operational
on your system and helps you ensure compatibility with
various software installations.
Step 2: List installed packages

Command used:
dpkg --list | less

 Explanation:
- dpkg is the Debian package manager, used
specifically for managing .deb packages on Debian-
based systems like Ubuntu.
- The option --list displays a comprehensive list of all
packages installed on your system.
- less is a pipeline that redirects the output to a
paging utility (less) allowing users to easily scroll
through the output.

 Why it is useful:

It allows you to see exactly what software is installed, the


exact package name, version numbers, and package status
(e.g., installed, removed, or partially configured).

Part 2: Installing and Removing Packages

In this section, we learned how to manage software


packages in Ubuntu using the APT package manager. APT
allows us to install, update, and remove software
efficiently.
Step 3: Update Package Repository Information

Command used:

sudo apt update

 Explanation:

This command refreshes the list of available software


packages and their latest versions from the repositories
configured on your Ubuntu system.

 Why it is useful:

It ensures that the package manager installs the most up-


to-date versions available, and resolves any potential
dependency issues.

Step 4: Install a Software Package (Example: VLC Media


Player)

 Command used:

sudo apt install vlc

 Explanation:

Installs the VLC Media Player application and all necessary


dependencies required to run the program.

 Why it is useful:

It allows users to easily install software along with its


necessary dependencies, simplifying the setup process.

If installation doesn't succeed, proceed as follows:

Step 5: Enable Additional Repositories and Install Again

Commands used:

sudo add-apt-repository universe


sudo apt update
sudo apt install vlc

 Explanation:

The first command enables the "Universe" repository,


which contains additional free and open-source software
packages not officially maintained by Ubuntu's main
repository. The next commands refresh package lists and
attempt the installation again.

 Why it is useful:

This enables access to more software that might not be


included by default in standard repositories.

Step 6: Remove an Installed Package (Example: VLC)

Command used:

sudo apt remove vlc

 Explanation:

This command removes an installed application but


retains its configuration files.

 Why it is useful:

Beneficial if the user wants to remove software while


potentially preserving its configuration data for future use
or reinstallation.

Step 7: Completely Remove a Package (VLC) Including


Configuration Files

Command used:

sudo apt purge vlc

 Explanation:

This command removes a software package along with all


related configuration files, completely cleaning its traces.
 Why it is useful:

It helps free more disk space and avoids conflicts when


reinstalling software.

Step 7: Remove Unnecessary Dependencies (Cleanup)

Command used:

sudo apt autoremove

 Explanation:

This command automatically removes packages that were


installed as dependencies but are no longer required.

 Why it is useful:

It keeps your system clean and maintains optimal


performance by removing packages that are no longer
needed.
Part 3: Searching & Managing Repositories

In this part, we learned how to search for packages using


the Ubuntu APT package manager. This functionality helps
users identify available software along with its relevant
details.
Step 9: Search for a package

Command used:

apt search gimp

 Explanation:

This command searches Ubuntu repositories for all


packages matching the keyword "gimp". It provides a list
of available packages along with brief descriptions,
making it easier to identify relevant software.

 Why is this useful?

It helps quickly find the correct package name and


discover related software that you may wish to install.

Step 10: Show detailed information about a package

Command used:

apt show gimp

 Explanation:

The command provides detailed information about the


selected package (GIMP), including the exact version,
dependencies, package size, recommended packages,
homepage, and a detailed description explaining its
purpose and main features.

 Why is this useful?

This helps verify compatibility, understand what additional


dependencies might be installed, and ensures the selected
package meets your requirements before proceeding with
installation.
Part 4: Fixing and Troubleshooting

In this section, we explored various troubleshooting


techniques for software management on Ubuntu, including
resolving broken dependencies, manually installing
packages, and using virtual environments for Python
projects.

Step 11: Check for broken dependencies

Command used:

sudo apt --fix-broken install

 Explanation:

This command detects and repairs issues related to


package dependencies. It identifies incomplete
installations or partially installed software and attempts to
resolve these problems automatically.

 Why it's useful:

Ensures the stability and proper functioning of your


Ubuntu system by addressing package management
issues, avoiding software errors and inconsistencies.
Step 12: Manually download and install a .deb package
(Google Chrome example)

Commands used:

wget https://dl.google.com/linux/direct/google-chrome-
stable_current_amd64.deb
sudo dpkg -i google-chrome-stable_current_amd64.deb
sudo apt --fix-broken install

 Explanation:

- wget: Downloads the specified .deb package file


from the provided URL.
- dpkg -i: Installs the downloaded .deb package
manually.
- apt --fix-broken install: Fixes any dependency
issues that may arise during the manual
installation process.

 Why it's useful:

Manually installing .deb files allows the installation of


software that might not be directly available in standard
Ubuntu repositories. Fixing broken dependencies ensures
the software functions properly after manual installation.

Step 13: Install LaTeX

Command used:

sudo apt install texlive-full

 Explanation:

Installs the complete texlive-full package, providing all


necessary LaTeX tools, packages, styles, fonts, and
utilities to compile and generate documents from .tex
source files.

 Why it's useful:


Using texlive-full is recommended because it includes a
comprehensive distribution of LaTeX, minimizing the
possibility of encountering errors due to missing packages
or dependencies. It provides an all-in-one solution,
suitable for comprehensive LaTeX usage.

Step 14: Manually download a Flask application from


GitHub, install dependencies, and run it.

Commands used:

git clone https://github.com/username/repository.git


cd repository
pip install -r requirements.txt
python app.py

(Replace the example GitHub URL above with your actual


repository.)

 Explanation:

- git clone: Clones the Flask application's source


code from GitHub.
- cd: Changes directory into the downloaded
repository folder.
- pip install -r requirements.txt: Installs all Python
package dependencies specified in
requirements.txt.
- python app.py: Runs the Flask application locally.

Question: Why do we create and activate a virtual


environment before installing dependencies?

Answer:
We create and activate a virtual environment to isolate
dependencies specific to a project. This prevents conflicts
and ensures that changes or installations in one project
won't negatively affect the dependencies or behavior of
other Python projects on the same machine.

Conclusion

In this lab, we explored essential Linux software package


management using the APT package manager. We began
by understanding the basics of Ubuntu’s Advanced
Packaging Tool (APT), including verifying the installed
version, viewing installed packages, and updating package
repositories. We also practiced software installation,
removal, and complete purging of applications along with
their configurations.

Additionally, we explored troubleshooting methods,


including repairing broken dependencies and manually
handling .deb packages. We further learned how to
manage software efficiently through virtual environments,
particularly when dealing with Python projects.

Overall, this practical session provided us with essential


hands-on experience in software management, equipping
us with the skills necessary for maintaining a reliable,
secure, and up-to-date Ubuntu Linux environment.

You might also like