Linux Labs

Packages, services, and logs / Stage 3 of 13

Installing, upgrading and removing packages

Not running Starting usually ~20 s
Leave the lesson

Step 7 of 8 · lab · 25 mineasy

Upgrade a package without losing its setting

Release 2.0-1 of a training reporter is approved and its archives are on the machine. Upgrade the program and its dependency without losing the local setting or the note.

Situation

An isolated machine runs a training reporter, lab-pkg-report version 1.0-1, together with the data package lab-pkg-data. Running lab-pkg-report prints the versions and the operating mode. The mode is a local setting here: /etc/lab-pkg-report.conf says mode=training. Release 2.0-1 is approved, and the archives of both packages have already been delivered to /srv/package-lab. The user keeps a note in ~/pkg-notes/report.txt.

Task

  1. lab-pkg-report is installed and configured at version 2.0-1 — as dpkg sees it.
  2. lab-pkg-data is installed at version 2.0-1, and lab-pkg-report's dependency is met.
  3. Both packages' files come from release 2.0-1, and lab-pkg-report run as student prints report=2.0-1 data=2.0-1 mode=training.
  4. /etc/lab-pkg-report.conf still says mode=training and remains the package's conffile.
  5. The note ~/pkg-notes/report.txt is intact: same contents, owner and modes.
  6. Other packages, APT sources and indexes, and the archives in /srv/package-lab are unchanged.

Constraints

  • There's no internet; no need to refresh indexes or upgrade system packages.
  • Don't bypass dependencies with --force-… options or edit the dpkg database by hand.
  • Don't remove packages together with their configuration (purge): the local setting is needed.

The tools you need are already installed. There's no internet on this machine.

Lab · on your own

No commands are given in this lab: type them in the terminal yourself. Goals are checked on the machine after every command.

Goals

0 of 6
  • lab-pkg-report is installed and configured at version 2.0-1 — not done yet
  • lab-pkg-data is installed at version 2.0-1 and report's dependency is met — not done yet
  • Package files come from release 2.0-1, and the program run as student prints the new report — not done yet
  • /etc/lab-pkg-report.conf kept mode=training and is still the package's conffile — not done yet
  • The note in ~/pkg-notes is intact with the same owner and modes — not done yet
  • Other packages, APT and the supplied archives are unchanged — not done yet
Ctrl+Enter
Starts the machine node1 · Ubuntu 24.04

The machine is starting

Hints

0 of 3

Lab goals

0 of 6
  • lab-pkg-report is installed and configured at version 2.0-1 — not done yet
  • lab-pkg-data is installed at version 2.0-1 and report's dependency is met — not done yet
  • Package files come from release 2.0-1, and the program run as student prints the new report — not done yet
  • /etc/lab-pkg-report.conf kept mode=training and is still the package's conffile — not done yet
  • The note in ~/pkg-notes is intact with the same owner and modes — not done yet
  • Other packages, APT and the supplied archives are unchanged — not done yet
node1 Ubuntu 24.04

Lab goals

0 of 6
  • lab-pkg-report is installed and configured at version 2.0-1 — not done yet
  • lab-pkg-data is installed at version 2.0-1 and report's dependency is met — not done yet
  • Package files come from release 2.0-1, and the program run as student prints the new report — not done yet
  • /etc/lab-pkg-report.conf kept mode=training and is still the package's conffile — not done yet
  • The note in ~/pkg-notes is intact with the same owner and modes — not done yet
  • Other packages, APT and the supplied archives are unchanged — not done yet
Loading…