Search This Blog

Friday, July 22, 2016

Raspberry Pi - The APT Command

The easiest to manage installation,upgradation and uninstallation APT is the command used in all the linux based operating systems. APT stands for Advance Packaging Tool. To install or remove packages one must have root user permissions. So user should be a sudoers or one must be logged in as a root user.


Obviously an internet connection is required for anyone to update the packages or install new ones. A point to note is that one cannot perform multiple installation at the same time.

APT keeps a url from where to get the software in the file located at:



/etc/apt/sources.list
 
One can see the contents of the file by using any installed editor:
 
sudo nano /etc/apt/sources.list 


Content of file sources.list


Before installing anything new lets update our list. The command for the same is apt-get update.

sudo apt-get update


Installing a package with apt-get



We will for example will install and uninstall a package called motion.
Typing the following command will prompt user for confirmation and will also provide disk usage information.


sudo apt-get install motion


Say yes and confirm the installation. Now we will move forward to removing the installed package of motion.

Removing a package with apt-get


We will now completely remove the package and its dependencies using command purge.

sudo apt-get purge motion

This will remove the package and all associated configuration files. The user is prompted for removal. Another similar command is the remove command which can be used to uninstall a package
 
sudo apt-get remove motion

The user is prompted to confirm the removal.

No comments:

Post a Comment