Use an interactive tool that lets you easily get information about a package (its description, its dependencies, what depends on it, …). You can use aptitude in a text terminal. There are also GUI programs for that.
Beware that it's difficult to know whether a package is necessary. Sometimes a package may be used in a way that isn't obvious to the uninitiated. With Linux kernels between 2.6.30 and 3.19, file access times are not saved accurately by default. Even with systems that are set up to save file access times, the information may not be complete, e.g. for files that are access during the early boot before the root partition is mounted read-write (for example, based on access times alone, you'd end up reporting the kernel as unused).
Programs that are installed but not running only hurt if you're short on disk space. Disk space was mildly expensive 20 years ago, but today, installed programs take up a negligible amount in most scenarios, and this does not justify a hunt for unused programs. If you are short on disk space (e.g. on a cheap VPS), you can use the following command to list packages by size:
dpkg-query -W -f='${Installed-Size;8} ${Package}\n' | sort -n
Programs that are installed and running but not actually used can hurt because use memory or they're a security risk. However, there's no way to determine that automatically, you really have to understand what the program is doing.
Best Answer
modules.dep
lists the dependencies of every single module available on your system, not just those which are in use on your system. It also lists modules which have no dependencies, which adds to its length. Distribution kernel packages typically have thousands of modules nowadays, so it’s perfectly normal formodules.dep
to have thousands of lines (one per available module).Kernel modules provide a variety of services: they can contain hardware drivers, common code shared by a number of drivers, file systems...