In this article, i’ll explain what is apt-get utility, how to install,uninstall,remove,update package through apt-get in Ubuntu.
What is apt-get
apt-get is a powerful command-line tool used for package management in Debian Linux distribution. It used to work with Ubuntu’s APT (Advanced Packaging Tool) library to Install/manage individual packages , Remove installed package, Upgrade packages etc.
So let’s play with apt-get package manager, open the terminal(shortcut ctrl+Alt+D) and try the mention command below.
Install,Uninstall,Remove,Update Package through apt-get
To install package through apt-get package manager
For installing package, just write apt-get install and mention the name of package.
apt-get install package-name
If i need to install phpmyadmin i will write
apt-get install phpmyadmin
NOTE: if you get permission denied error, then use sudo with this command. To install any package or software in Ubuntu you need root access.
sudo apt-get install phpmyadmin
once you type and enter, it ask password for root user.
To Remove/Delete an installed package
apt-get remove package-name
If i type
sudo apt-get remove phpmyadmin
It will remove phpmyadmin from my system (except configuration files).
To remove package as well as configuration files
apt-get --purge remove package-name
sudo apt-get --purge remove phpmyadmin
This command uninstall phpmyadmin as well as their configuration files.
Update the local package index with the latest changes
Ubuntu APT(Advanced Packaging Tool) is essentially a database of available packages from the repositories defined in the /etc/apt/sources.list file and in the /etc/apt/sources.list.d directory. To update this file you need to use update command.
sudo apt-get update
To update all the currently installed software packages
sudo apt-get upgrade
To check more about apt-get , you can read it’s manual.
I hope these commands give them the idea about what is apt-get and how to manage package using apt-get package manager utility.