Grimoire-
Command
.es

GNU+Linux command memo

List local or obsolete packages in Debian-base distributions

Lister les paquets locaux ou obsolète d’une distribution GNU+Linux basées sur Debian

$ sudo apt install apt-show-versions
$ apt-show-versions | grep -v buster (1)
$ apt-show-versions | grep -v buster | awk '{print $1}' | xargs apt remove  (2) (3)
1 List all packages and remove those with buster in the line, so belonging to the current stable version of Debian
2 Selecting, in addition, the 1st column and apply apt remove on each result
This will also remove the local packages, that where never part of the official distribution.