Cleaning up your Linux server

Housekeeping

Package Cleanup

Package managers are great because it frees admins from having to spend hours resolving dependencies for software packages. However, these same package systems tend to clutter the filesystem with old packages, dependencies, and cached files no longer needed but that waste a lot of space.

To solve this problem on Debian-based systems, run the commands:

$ sudo apt-get autoclean
$ sudo apt-get clean
$ sudo apt-get autoremove

For Red Hat-based systems, the following command works:

$ sudo yum autoremove

You can also install the yum-utils package and then issue

$ package-cleanup --leaves --all

to remove RPM files.

Conclusion

System cleanup is an ongoing task that you should perform on a regular basis, which could depend on the number of system users, amount of system use, and disk space limitations. Some systems require weekly maintenance, whereas others can wait for quarterly maintenance windows. You might also want to investigate setting up filesystem quotas, especially on /home, to ensure that users take some responsibility for their own housekeeping.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy ADMIN Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

comments powered by Disqus
Subscribe to our ADMIN Newsletters
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs



Support Our Work

ADMIN content is made possible with support from readers like you. Please consider contributing when you've found an article to be beneficial.

Learn More”>
	</a>

<hr>		    
			</div>
		    		</div>

		<div class=