Package Installation and Updates in Ubuntu


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 <keywords>

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
./configure
make
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
./configure
make
checkinstall

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

dpkg -i packagename.deb

Subscribe / Share

Article by Vidyadhar

My name is Vidyadhar Sarmalkar & I work as a consultant and have done RHCE & CCNA.
Vidyadhar tagged this post with: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Read 214 articles by

One Comments

Leave a Reply

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">

Notify me of followup comments via e-mail. You can also subscribe without commenting.

rss twitter facbook

Categories

Archives