Most of us with Debian-based systems use apt-get routinely to install packages and upgrades, but how often do we pull out the cleaning tools? Let's check out some of the tool's options for cleaning up after itself.
[Félix Prado Modified by IDG Comm.][1] [(CC0)][2]
Running **apt-get** commands on a Debian-based system is routine. Packages are updated fairly frequently and commands like **apt-get update** and **apt-get upgrade** make the process quite easy. On the other hand, how often do you use**apt-get clean**, **apt-get autoclean** or**apt-get autoremove**?
These commands clean up after apt-get's installation operations and remove files that are still on your system but are no longer needed– often because the application that required them is no longer installed.
[[Get regularly scheduled insights by signing up for Network World newsletters.]][3]
### apt-get clean
The apt-get clean command clears the local repository of retrieved package files that are left in **/var/cache**. The directories it cleans out are **/var/cache/apt/archives/** and **/var/cache/apt/archives/partial/**. The only files it leaves in **/var/cache/apt/archives** are the **lock** file and the **partial** subdirectory.
[][4]
BrandPost Sponsored by HPE
[Take the Intelligent Route with Consumption-Based Storage][4]
Combine the agility and economics of HPE storage with HPE GreenLake and run your IT department with efficiency.
You might have a number of files in the directory prior to running the clean operation:
The **apt-get clean** command is generally used to clear disk space as needed, generally as part of regularly scheduled maintenance.
### apt-get autoclean
The **apt-get****autoclean** option, like **apt-get clean**, clears the local repository of retrieved package files, but it only removes files that can no longer be downloaded and are virtually useless. It helps to keep your cache from growing too large.
### apt-get autoremove
The **autoremove** option removes packages that were automatically installed because some other package required them but, with those other packages removed, they are no longer needed. Sometimes, an upgrade will suggest that you run this command.
```
The following packages were automatically installed and are no longer required:
The packages to be removed are often called "unused dependencies". In fact, a good practice to follow is to use **autoremove** after uninstalling a package to be sure that no unneeded files are left behind.
Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind.
[4]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE20773&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage)