Ubuntu package manager — APT

browsing on the internet and finding a package that you want to install is a lot of work and takes time, and this is something you will do on a daily basis, downloading a package and then installing it. updating the packages you have or removing them, all manually, this takes a lot of time. But if you are a tech savvy like me, then there is a much better alternative to manage you applications. It is called the package manager.
Package managers are available in all operating systems (to my knowledge) with different names. for example, winget is the package manager used by the windows, APT (which is our topic for today) is the package manager used by many linux distributions. If you have ever used ubuntu, then you must have come across APT. so let’s dive a little deeper into APT.
HOW IT WORKS?
APT is a command line tool and it works just like other command line tools. you type in a command and give it the necessary parameters ( like the package name). The package manager will download and install the packages from repositories. repositories is the place where all the packages are hosted. your ubuntu comes with the repositories pre-configured and all those repositories contain packages which are specifically compiled for your linux distribution and version. let’s say you have ubuntu 20.04 LTS. Then your package manager will install the packages compiled for ubuntu 20.04 LTS.
In ubuntu, when you install a package using APT, APT knows which file belongs to which installed application. so it takes care of updation and deletion of a package.
installing a package
sudo apt install vlc
just enter this command and the APT will download and install vlc player on your machine.
APT has a package index which you can think of as list of all the repositories and the packages inside them. with time, new packages and newer versions of the packages already installed on your machine are uploaded to these repositories. but how to update apt about these packages updates? well, thanks to this command.
sudo apt update
this will update the package index. It’s a good practice to run this command before installing any package, so that you install the latest version of the software available.
now what if you need to remove a package you have installed using apt? as i have already told you that apt takes care of it. suppose you want to remove the vlc package we have earlier installed. Then type this command
sudo apt remove vlc
if you want to remove all the package files and configuration, then type
sudo apt purge vlc
conclusion
APT is a package manager used by ubuntu. It takes care of all your package installation, updation and deletion. It is used just like any other command line tool. working with packages becomes much easier and faster once you know this tool well.