Unit 10: Packages, signatures and patching · Lesson 1 of 5 · 16 min

What is installed and where it came from

Every package has a name, a version and an origin. Read them before you trust a file.

mission

You are
You are building web01's software inventory.
Situation
Besides Ubuntu's packages, web01 runs two in-house packages from the company repository.
Goal
List them, see where each comes from and which files they own.
Hand in
Package, version, origin.
01

Count and filter

learner@root-lab
dpkg -l | grep -c '^ii'
198
dpkg -l | grep shop
ii  shop-forms                   3.1.0                             all          Upload and form handling for the shop
ii  shop-tools                   1.4.2                             all          Maintenance helpers for shop servers

you should see Two in-house packages among the rest.

02

Where can they come from?

Each version lists the repositories that offer it and their priority.

learner@root-lab
apt-cache policy shop-forms shop-tools
shop-forms:
  Installed: 3.1.0
  Candidate: 3.1.1
  Version table:
     3.1.1 500
        500 file:/srv/mirror stable/main amd64 Packages
 *** 3.1.0 500
        500 file:/srv/mirror stable/main amd64 Packages
        100 /var/lib/dpkg/status
shop-tools:
  Installed: 1.4.2
  Candidate: 1.4.2
  Version table:
 *** 1.4.2 500
        500 file:/srv/mirror stable/main amd64 Packages
        100 /var/lib/dpkg/status

you should see Both from file:/srv/mirror. shop-forms has a newer version waiting.

03

Which files does a package own?

learner@root-lab
dpkg -L shop-tools | grep usr/lib
/usr/lib
/usr/lib/shop-tools
/usr/lib/shop-tools/VERSION
/usr/lib/shop-tools/check.sh
dpkg -S /usr/lib/shop-forms/check.sh
shop-forms: /usr/lib/shop-forms/check.sh

you should see Files map to packages both ways.

What a defender takes away

  1. 1dpkg knows what is installed, apt knows what is available.
  2. 2Every file outside a package needs an explanation.
  3. 3Know which repositories each server trusts.

Questions

0 of 2 solved

Answer each one from what you find on your lab machine.