apt autoclean

Like clean, but only removes package files that can no longer be downloaded

Options

NameDescription
-d, --download-onlyFor any operation that would download packages, download them, but do nothing else
--no-downloadDo not download packages, attempt to use already downloaded packages
-yAssume yes to all prompts
--assume-noAssume no to all prompts
-s, --simulateSimulate running this command and show it's output, without actually changing anything