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.
Top ten linux terminal commands.
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.
1 |
apt-get install package-name |
For example-
If i need to install phpmyadmin i will write
1 |
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.
1 |
sudo apt-get install phpmyadmin |
once you type and enter, it ask password for root user.
To Remove/Delete an installed package
1 |
apt-get remove package-name |
If i type
1 |
sudo apt-get remove phpmyadmin |
It will remove phpmyadmin from my system (except configuration files).
To remove package as well as configuration files
1 |
apt-get --purge remove package-name |
1 |
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.
1 |
sudo apt-get update |
To update all the currently installed software packages
1 |
sudo apt-get upgrade |
To check more about apt-get , you can read it’s manual.
1 |
man apt-get |
1 |
apt-get help |
I hope these commands give them the idea about what is apt-get and how to manage package using apt-get package manager utility.