In this tutorial I will be showing you how to use the apt-get command in Ubuntu/Linux Mint/Debian. The apt-get command allows you to install and remove software automatically if its located in one of the repositories in your sources.list. This makes it extremely easy to install packages in Ubuntu/Linux Mint/Debian. You can also use this command to automatically update/upgrade all of your packages at once just by using one or two commands. Because this command allows you to make changes to the system you have to run it under root (sudo/gksudo). There are graphical alternatives such as the Ubuntu Software Center, Adept (KDE4), Synaptic Package Manager.
Installing Software With apt-get
You can install software automatically by using the following command. When you install software using apt-get it will automatically select all the required dependencies for you and then ask you to confirm before downloading.
sudo apt-get installRemoving Software With apt-get
To remove software with apt-get you can simply remove the package or purge it.
sudo atp-get removeAdding Software Repository To apt-get
sudo apt-get purge
The best way to apt-get add repository is to open the sources list in nano and add the repository as the last line. You can open nano by running the following command, I have also included an example repository (official skype repository)
sudo nano /etc/apt/sources.listWhenever you add a repository to your sources list you need to update your available package list by running sudo apt-get update in an open terminal.
deb http://download.skype.com/linux/repos/debian/ stable non-free
Updating/Upgrading Software With apt-get
With apt-get you can update all of your software with only running two commands. Apt-get will download a list of available packages and then ask you to confirm that you wish to upgrade the selected packages to the latest version.
sudo apt-get updateI hope this has helped you learn how to work with apt-get in Ubuntu/Linux Mint/Debian, more tutorials are on the way and please don’t forget to bookmark!
sudo apt-get upgrade