Tuesday 29 April 2014

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.
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
For example- If i need to install phpmyadmin
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
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.
 man apt-get
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.

No comments:

Post a Comment