Following are the basic commands you need to know to install packages on Ubuntu. All the commands are run by root user.
Using apt
Install packages

apt-get install packagename

Remove packages

apt-get remove packagename

To remove all dependencies

apt-get autoremove packagename

Search for packages

apt-cache search 

Update the apt package database after adding/removing repositories

apt-get update

Upgrade packages

apt-get upgrade

Upgrade the entire distribution

apt-get dist-upgrade

Installing .deb packages

.deb is the extension of the Debian software package format and the most often used name for such binary packages. Debian packages are also used in distributions based on Debian, such as Ubuntu and others. Debian packages are standard Unix ar archives that include two gzipped, bzipped or lzmaed tar archives: one that holds the control information and another that contains the data. The canonical program for handling these packages is dpkg, most commonly via apt/aptitude.

Install a downloaded Debian package

dpkg -i packagename.deb

Remove a Debian package

dpkg -r packagename

Reconfigure/Repair an installed Debian package

dpkg-reconfigure packagename

Installing a package from source

Installing development tools

apt-get install linux-headers-$(uname -r) build-essential 

Extract the source package

tar xvf sourcefile.tar.gz

Building and Installing the package

cd /path/to/extracted/sourcefile
make install

Create a .deb package from source files

Install package tools

apt-get install checkinstall

Rebuild package using “checkinstall”

cd /path/to/extracted/package

You will get the .deb file in current directory. After checkinstall the package will install automatically else run

dpkg -i packagename.deb
Package Installation and Updates in Ubuntu
Tagged on:                                                                                                                                                                                                                                                                                                                                                                                                                             

One thought on “Package Installation and Updates in Ubuntu

Leave a Reply

Your email address will not be published. Required fields are marked *