Ubuntu Desktop 4.1: Listing and upgrading packages
Counting what's installed, upgrading everything but one held package, reading apt's history, and holding a snap's updates.
Before you start
The lab changes nothing; reset takes away the holds you add. The VM needs
to reach the Ubuntu archive (and the snap store for task 4). Write
answers to the files in /root/lab-answers/.
Tasks
- Count the installed deb packages, and list the snaps. Write the count
to
/root/lab-answers/1. - Bring every deb package up to date, holding back one package that has an update (or any installed package, if none has).
- Find out when the last apt command that upgraded packages was run, and
by whom. Write its
Start-Date(date and time) on line 1 of/root/lab-answers/3, and on line 2 the user,root, orunattended-upgradefor the automatic daily run. - Stop a snap from updating for two days, then undo it. If
snap listshows no snaps (as on a server), install the smallhellosnap first. Not graded: check thatsnap list NAMEshowsheldin Notes, and that after--unholdit doesn't.
Hints
dpkg -l | grep -c '^ii';snap list.apt update,apt list --upgradable,apt-mark hold,apt upgrade.apt-mark showholdshows the hold, and itsdpkg -lline starts withhi. Updates thatapt upgradereports as deferred due to phasing may stay./var/log/apt/history.log: the last entry with anUpgrade:line, itsStart-Date,CommandlineandRequested-By(only there when the command ran through sudo).snap refresh --hold=48h NAME,snap refresh --unhold NAME.