In most cases the autoremove
command of apt-get
would do the trick, it will remove all packages installed and marked as automatically installed, but not required by any other installed package.
This is the preferred and secure method when the master package is not a metapackage.
This is not the case for metapackages like kubuntu-desktop
, and this is because packages installed as a consequence of the installation of a metapackage are not marked as automatically installed, so that cannot be remove by autoremove
.
Removing all packages marked as dependences of, or recommended by a given metapackage, like kubuntu-desktop
, could be dangerous, because some of those packages could be on your system before the installation of the metapackage.
The most secure method to proceed, in my opinion, is an analysis of /var/log/dpkg.log
and its ancestors, to see which packages were installed in timestamps around the timestamp of the installation of the given offending package. I suggest a command to get a more terse and cleaned-up view of the concatenation of the involved log files:
less $(ls -rt /var/log/dpkg.log*) |
awk '$3 ~ /^(install|upgrade|remove|purge)$/' |
less
Try sudo apt-get install -f
. It will probably give some suggestions about removing and installing packages, do what seems reasonable. If that doesn't help, try booting into recovery mode and choosing the "fix broken packages". If that doesn't work... I don't know, I'd reinstall Ubuntu if I were you. (This is a good reason to always have /home on a separate partition!)
Best Answer
You can use
apt-cache rdepends --installed jetty
to see what depends on jetty. This will show both depends & recommends, so you may want to check through the list of packages to see what the relationship is with jetty.