How to Use the Advanced Package Tool (APT) to Update, Add and Remove Software in Ubuntu 13.04

Debian’s Advanced Package Tool or APT for short is a system that helps with installation of software. APT was the first system to properly install software while adhering to any dependencies that are required. For example, when installing software in Linux you may find that that particular software you’re trying to install needs another program in order to run properly. You would then have to install that dependency before installing the software you actually wanted. When using APT you do not have to worry about dependencies because it is taken care of for you.

APT also has the ability to resume installation if it is halted for any reason. This means that if your computer loses power, Internet connection, or simply freezes up then you can go back and start the installation from where you left off. This is been a great feature for me when I have had power failures during storms.

Updating Software

 

APT has a unique way of working because it stores a copy or cache of the available packages or applications that can be installed onto your Linux distribution in this case being Ubuntu 13.04. APT obtains its local cache of available software from all of the servers it is configured to use called repositories. When APT updates this list of packages it determines if the software on your computer is the same version as the version in the newly updated list. This is how apt knows whether or not your applications need to be updated. You can update this list of packages by running the following command.

sudo apt-get update

If APT determines that the software installed on your computer is an older version than what is in the list of packages available then your computer needs to be updated. You can update the software on your Ubuntu installation to the newest version by running the following command.

sudo apt-get upgrade

By running the command above APT will replace the older packages on your computer with the newer packages obtained from the repositories. With this being the case you will typically not see very much additional disk space used after the updates. You should also know that the above command will not add or remove software. By doing this, the system will not update to a completely new version of the software but rather keeps all of the patches up to date. This helps to ensure that the system will not crash for simple patch updates.

There are cases when you want to upgrade to the newest software such as when a new version of Ubuntu comes out. In this situation you will want to remove the old obsolete software and install the new software. You should keep in mind that by doing this it potentially changes almost everything on your system. This can be completed by running the following command

sudo apt-get dist-upgrade

Adding and Removing Software

 

There will come a time when you want to add software to your Ubuntu operating system. You will use the apt-get install command to do this. APT will automatically search all of the repositories and gather all of the dependencies for installing the software that you are wishing to install. An example installing a package using APT is shown below.

sudo apt-get install firefox

By running the above command, APT will install Firefox onto your operating system and handle all of the dependencies that Firefox needs to run properly.

If for example, you wanted to remove Firefox from your operating system then you would use the apt-get remove command to complete that action. Keep in mind that the simple apt-get remove command leaves behind all of the configuration files and program files on your computer. If you want to make sure to remove all of the configuration files and everything else associated with that package or application then you would use the purge option. An example of both of these commands as shown below.

To remove Firefox leaving behind the configuration files.

sudo apt-get remove firefox

To completely uninstall Firefox and all of its configuration files.

sudo apt-get remove -purge Firefox

If you have any questions or comments on this tutorial about APT don’t hesitate to leave a comment below. Also if you found this tutorial helpful please like and share so that other people can find the tutorial or easily.

Share the Love
Get Free Updates