The server's disk was cleaned overnight, and in the morning the reporting program does not start. A colleague is sure someone removed the package. Before installing it again, check what the system knows about the package.
What the system knows about the package
Run the reporting program and ask dpkg about its package, lab-pkg-report.
First, predict
The program does not start. What will dpkg -s lab-pkg-report show in the Status line?
Now start the exercise, run the command and compare your prediction with the output.
Why does dpkg consider the package installed although the program is not on disk?
-
The shell looked for the program in every program directory and did not find it. dpkg does not search the disk: it reads its record.
-
Services get switched on and off. A package has a different state, installed or not, and
dpkg -ssaysinstalled. -
apt updaterefreshes the repository indexes. The record of an installed package lives in the dpkg database on this machine, andapt updatedoes not change it.
The record in the package database stayed the same: the file was deleted behind dpkg's back.