Checking for Orphan Files or Packages

You can use the “orphan-check” tool to resynchronize the filesystem and the database if the filesystem and the database get out of sync.

The system can get out of sync when files in the filesystem are not referenced from the database, or when packages in the database do not have a corresponding file in the filesystem.

The orphan-check tool prints on stdout a list of files on the filesystem that are not referenced from the database:

anaconda-server-orphan-check --dryrun

You can use the –json option if you want a JSON representation of the output:

anaconda-server-orphan-check --json

NOTE: Running anaconda-server-orphan-check without arguments is the same as running anaconda-server-orphan-check --dryrun.

After you’ve viewed the list of files without references, “orphan-check –clean” can delete them:

anaconda-server-orphan-check --clean

You can also check for packages that have missing files:

anaconda-server-orphan-check --reverse

Then you can delete those file objects from the database:

anaconda-server-orphan-check --reverse --clean