How to autoremove all installed packages and not existed in repositories? Example: after several dist-upgrades there is many libs (libapt-inst1.3 libapt-inst1.4 libapt-inst1.5, great count of libdnsXX etc).
The easiest way to remove packages that no longer have packages dependent upon it is:
sudo apt-get autoremove
This removes packages that are installed as dependencies, but aren't needed any more.
More information and more answers can be found on this post:
Hope this helps!