This post explains how to install stuff on your Linux PC using the terminal (via the ‘apt’ package manager).
A package manager is a program whose job is to help in installing, uninstalling and upgrading software packages. The package manager which comes with Ubuntu is called apt.
A package manager is somewhat like an app store, but it is much more than that, and they existed much before app stores.
A software package is some programs and files bundled together, which help in achieving a particular functionality. For eg, VLC Media player, along with all its configuration files, audio codecs, etc. forms a package. When you install this package, you’ll be able to play audio and video on your PC.
There is a server which stores a lot of packages, called a software repository. When you use a package manager to install a package, it downloads that package from the repository and then installs it.
The package manager maintains a list of all packages which are available for download from the software repository. This list is called a package index. The package index is stored somewhere on your PC. Whenever you try to install something, it checks the package index to see if that software is available on the server or not.
Every package has a unique name. For eg, ‘Code::Blocks IDE’ is in a package named ‘codeblocks’. A package name never has whitespace in it.
To install a package using apt, write this command in the terminal:
sudo apt-get install name-of-the-package
To install multiple packages at once, write this command in the terminal:
sudo apt-get install package1 package2 package3
To completely remove a package using apt, write this command in the terminal:
sudo apt-get purge name-of-the-package
To search for packages, you can use Ubuntu Software Center (USC) on Ubuntu. USC is GUI, you can probably navigate easily through it and search whatever you want to search. USC will also show you the name of a package, which you can use to install that package using the terminal. You can also use USC to install packages, but it is advised that you use the terminal instead. There are certain things which USC can’t do and apt-get can.