GNU/Linux ◆ xterm ◆ bash 475 views

The command:

apt autoremove package

Without a package name, the autoremove option removes all unneeded dependencies.