How to master the Linux terminal with apt-get

1. Install

apt-get install

Using apt-get install will check the dependencies of the packages you want and install any that are needed. Adding --dry-run to apt-get install enables you to see what would be done, without actually writing anything to your hard drive. If you are happy, run the command again without --dry-run.

2. Search

apt-cache search

Use apt-cache search to find what's available. The --names-only option often gives a more manageable set of results if you know the program's name. Otherwise let apt-cache search go through the descriptions too and view the results in less. You don't need to use sudo as search doesn't write to your drive.

3. Update

apt-get update

Run apt-get update to update all your package lists followed by apt-get upgrade to update all your installed software to the latest versions. In our case it's well overdue! Then apt will show you what needs to be updated, and how much needs to be downloaded, before asking it you want to proceed.