Bookmark this page

Lab: Obtaining and Installing Software Packages

Obtain software, install packages, and manipulate compressed files.

Outcomes

  • Investigate repository packages that are available for installation.

  • Use graphical and command-line tools to install packages.

  • Archive a directory tree and extract archive content to another location.

As the student user on the workstation machine, use the lab command to prepare your environment for this exercise, and to ensure that all required resources are available.

[student@workstation ~]$ lab start software-review

Instructions

  1. Using the GNOME Software application, install the Fedora Media Writer application from the Fedora Flatpak repository.

    If the Fedora Flatpak repository is not available in the system, then use the oci+ https://registry.fedoraproject.org URL to add the repository. Use the command line to add the Fedora Flatpak repository.

    1. Verify that the Flatpak application is installed.

      [student@workstation ~]$ flatpak --version
      Flatpak 1.12.7
    2. Verify whether the Fedora Flatpak repository exists in the system.

      [student@workstation ~]$ flatpak remotes
      
      [student@workstation ~]$

      No repositories are available.

    3. Add the Fedora Flatpak repository. If you are prompted for a password, then use student.

      [student@workstation ~]$ flatpak remote-add \
      --if-not-exists fedora oci+https://registry.fedoraproject.org
    4. Open the GNOME Software application. From the main menu, select Software Repositories. Verify that the Fedora Flatpak repository is available.

      Available repositories

      The repositories listed in your classroom might be different.

    5. Click the Magnifying Glass icon and enter fedora media writer into the search field. Select the Fedora Media Writer application.

      Searching for an application in the GNOME Software tool
    6. Click Install. After the application finishes installing, click Open to verify the installation.

      Opening the installed application
  2. On the command line, install the podman package. Use sudo privilege for the student user to perform the installation. Use student as the password.

    Save the source name of the podman package to the ~/package_source.txt file. The package_source.txt file must not contain empty lines, or leading or trailing white spaces.

    Save the output of the podman --version command to the ~/podman_version.txt file.

    1. Obtain information about the podman package.

      [student@workstation ~]$ dnf info podman
      Last metadata expiration check: 0:00:14 ago on Mon Nov 27 21:02:58 2023.
      Available Packages
      Name         : podman
      Epoch        : 2
      Version      : 4.2.0
      Release      : 3.el9
      Architecture : x86_64
      Size         : 12 M
      Source       : podman-4.2.0-3.el9.src.rpm
      ...output omitted...

      The source name of the podman package is podman-4.2.0-3.el9.src.rpm. The package source information might be different in your classroom.

    2. Save the podman package source information to the ~/package_source.txt file.

      [student@workstation ~]$ echo "podman-4.2.0-3.el9.src.rpm" > package_source.txt
    3. Edit the ~/package_source.txt file so that it does not contain empty lines or white spaces. The file contents must look similar to the following example.

      [student@workstation ~]$ cat package_source.txt
      podman-4.2.0-3.el9.src.rpm
    4. Install the podman package. Use sudo privilege for the student user to perform the installation.

      [student@workstation ~]$ sudo dnf install podman
      [sudo] password for student: student
      ...output omitted...
      Is this ok [y/N]: y
      ...output omitted...
      Complete!
    5. Save the output of the podman --version command to the podman_version.txt file in the student home directory.

      [student@workstation ~]$ podman --version > ~/podman_version.txt
      [student@workstation ~]$ cat ~/podman_version.txt
      podman version 4.2.0
  3. Move all files in the ~/Documents directory that end with the .txt and .doc extensions to the ~/Projects directory. Create the project-documents.tar.gz compressed file to back up the Projects directory.

    1. Move all files in the Documents directory that end with the .txt and .doc extensions to the Projects directory.

      [student@workstation ~]$ mv Documents/*txt Projects/
      [student@workstation ~]$ mv Documents/*doc Projects/
    2. Review the contents of the Projects directory.

      [student@workstation ~]$ ls Projects/
      checklist.doc  meeting.txt  notes.txt  report.doc
    3. Create the project-documents.tar.gz compressed file to back up the Projects directory.

      [student@workstation ~]$ tar --create --gzip \
      --file project-documents.tar.gz Projects/
    4. Verify that the project-documents.tar.gz compressed file exists.

      [student@workstation ~]$ ls
      ...output omitted...
      project-documents.tar.gz
      ...output omitted...
  4. The ~/finance.zip file contains scripts that are provided by your team. Extract the compressed file and move the contents to the /usr/local/bin directory. Use sudo privilege for the student user to move the files.

    1. Extract the contents of the finance.zip file.

      [student@workstation ~]$ unzip finance.zip
      Archive:  finance.zip
       extracting: configure-keys.sh
       extracting: create-documents.sh
    2. Verify the extracted files.

      [student@workstation ~]$ ls -l
      ...output omitted...
      -rw-r--r--. 1 student student    0 Nov 27 22:20 configure-keys.sh
      -rw-r--r--. 1 student student    0 Nov 27 22:20 create-documents.sh
      ...output omitted...
    3. Move the script files to the /usr/local/bin directory.

      [student@workstation ~]$ sudo mv *.sh /usr/local/bin/
      [sudo] password for student: student
    4. Verify the contents of the /usr/local/bin directory.

      [student@workstation ~]$ ls -l /usr/local/bin/
      total 12
      -rw-r--r--. 1 student student    0 Nov 27 22:20 configure-keys.sh
      -rw-r--r--. 1 student student    0 Nov 27 22:20 create-documents.sh
      ...output omitted...

Evaluation

As the student user on the workstation machine, use the lab command to grade your work. Correct any reported failures and rerun the command until successful.

[student@workstation ~]$ lab grade software-review

Finish

As the student user on the workstation machine, use the lab command to complete this exercise. This step is important to ensure that resources from previous exercises do not impact upcoming exercises.

[student@workstation ~]$ lab finish software-review

Revision: rh104-9.1-3d1f2bc