How to check for and install new packages on Linux (Ubuntu)

When working on Linux, you probably need to install programs and software packages from time to time.

On Ubuntu, to search for a package and see if it’s available:

# apt-cache search "package-name"

To install a new package:

# apt-get install package-name

To list installed packages:

# dpkg -l

For more try this cheatsheet.