Upgrade-system is a great Bourne shell script that helps to upgrade and keep your sytem clean of obsolete libraries and packages with a single command. It has one small side-effect.
The Upgrade-system program uses deborphan to find the orphaned packages on your system. The package maintainer Martin-Ãric Racine (q-funk at iki.fi) mentions the problem with deborphan in /usr/share/doc/upgrade-system/NEWS.gz file thus.
UPGRADE-SYSTEM is configured to remove all Perl/Python/Ruby extensions and development libraries that are NOT listed as another package’s dependency, which is a sensible default behavior for laymen’s workstations.
But what if the layman user is using a script that needs say one such language extension that is not listed as another package’s dependency? One solution is to this issue is to use deborphan’s keep file management feature. Deborphan maintains a list of packages in /var/lib/deborphan/keep that are never purged.
Lets add this package to deborphan keep-back file.
$ deborphan -A libzip-ruby1.8
Check out the deborphan keep file contents with -L (list) to see if our package is added.
$ deborphan -L
libzip-ruby1.8 ( <——here it is ;o)
Next time you launch ‘upgrade-system’ command all the files listed in deborphan’s keep file will not be purged from your computer.
These are complete list of deborphan’s keep file management options from its manual page.
- -A,—add-keep (Add packages to the list of packages which are never to be reported, regardless of their state. You may specify ’-’ to use standard input. Note that package names are case-sensitive.)
- -R,—del-keep PKG1…PKGn (Remove packages from the list of packages which are never to be reported. You may specify ’-’ to use standard input. If there are no dependencies for this package next time deborphan is invoked, it will be reported again.)
- -L,—list-keep (Show the list of packages that are being kept back.)
- -Z,—zero-keep (Purge the entire list of packages that are being kept back. The only option possible in combination with this option is -A.)
- -k,—keep-file=FILE (Use FILE to store the list of kept-back packages.)