PACKAGE MANAGEMENT WITH APT-GET
Ubuntu features a comprehensive
package management system for installing, upgrading, configuring, and removing
software. In addition to providing access to an organized base of over 60,000
software packages for your Ubuntu computer, the package management facilities
also feature dependency resolution capabilities and software update checking.
Several
tools are available for interacting with Ubuntu’s package management system,
from simple command-line utilities which may be easily automated by the system
administrators, to a graphical interface which is easy to use by those new to
Ubuntu.
Introduction
Ubuntu’s package management system
is derived from the same system used by the Debian GNU/Linux distribution. The
package files contain all of the necessary files, meta-data, and instructions
to implement a particular functionality or software application on your Ubuntu
computer.
Debian
package files typically have the extension .deb, and usually exist
in repositories which are collections of packages found online
or on physical media, such as CD-ROM discs. Packages are normally in a
pre-compiled binary format; thus installation is quick and requires no
compiling of software.
Many
packages use dependencies. Dependencies are additional packages
required by the principal package in order to function properly. For example,
the speech synthesis package festival depends upon the
package alsa-utils, which is a package supplying the ALSA sound
library tools needed for audio playback. In order for the festival to function,
it and all of its dependencies must be installed. The software management tools
in Ubuntu will do this automatically.
sudo
su
In Linux
(and Unix in general), there is a SuperUser named root. The Windows
equivalent of the root is the Administrators group. The SuperUser can do
anything and everything, and thus doing daily work as the SuperUser can be
dangerous.
By default,
the root account password is locked in Ubuntu. This means that you cannot log
in as root directly or use the su command to become the root user.
The sudo command stands for "superuser do" .
sudo
su
It will ask for a Linux password.
Apt-Get
The apt-get the command is a powerful command-line tool, which works with Ubuntu's Advanced
Packaging Tool (APT) performing such functions as installation of new software
packages, upgrade of existing software packages, updating the package list
index, and even upgrading the entire Ubuntu system.
Update
the Package Index The APT package index 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 the local package index with
the latest changes made in the repositories, type the following
sudo
apt-get update
Upgrade Packages
Over time, updated versions of packages currently installed
on your computer may become available from the package repositories (for
example security updates). To upgrade your system, first, update your package
index as outlined above, and then type:
sudo apt-get upgrade
Aptitude
Launching Aptitude with no
command-line options will give you a menu-driven, text-based front-end to
the Advanced Packaging Tool (APT) system. Many of the common
package-management functions, such as installation, removal, and upgrade, can
be performed in Aptitude with single-key commands, which are typically
lowercase letters.
Aptitude is
best suited for use in a non-graphical terminal environment to ensure the
proper functioning of the command keys. You may start the menu-driven interface
of Aptitude as a normal user by typing the following command at a terminal
prompt:
sudo aptitude
When Aptitude
starts, you will see a menu bar at the top of the screen and two panes below
the menu bar. The top pane contains package categories, such as New Packages and Not Installed Packages. The bottom
pane contains information related to the packages and package categories.
Find Out Package Name and
Description of Software
To find out
the package name and its description before installing, use the ‘search‘ flag.
Using “search” with apt-cache will display a list of matched packages with a
short description. Let’s say you would like to find out the description of
package ‘bluefish‘ , then the command would be.
apt-cache search bluefish
Install a Specific Package
Installation
of packages using the apt-get tool is quite simple. For example, to install the
Bluefish HTML Editor, type the following:
sudo
apt-get install bluefish
Install multiple packages
You can add more than one package name along with the command
in order to install multiple packages at the same time. For example, the
following command will install packages ‘bluefish‘ and ‘leafpad‘.
sudo
apt-get install bluefish leafpad
Remove a
Package
Removal of a
package (or packages) is also straightforward. To remove the package installed
in the previous example, type the following:
sudo
apt-get remove bluefish
Completely Remove Packages
To remove software packages including their configuration
files, use the ‘purge‘ subcommand as shown below.
sudo
apt-get purge bluefish
Clean Up Disk Space
The ‘clean‘ command is used to free up the disk space by
cleaning retrieved (downloaded) .deb files (packages) from the local repository
(/var/cache/apt/archives).
sudo
apt-get clean
Download a Package without
Installing
Using the ‘download’ option, you can download any given
package without installing it. For example, the following command will only
download the ‘bluefish‘ package to the current working directory.
sudo
apt-get bluefish
Check
Broken Dependencies?
The ‘check’ a command is a diagnostic tool. It used to update the package cache and checks
for broken dependencies.
sudo
apt-get check
MANUAL
INSTALLATION OF APPLICATIONS
Debian/Ubuntu
package file has the .deb suffix.
Download the
package file wish to install and save it in a home folder.
sudo
dpkg -i packagename.deb
E.g. sudo dpkg -i teamviewer*.deb If
any dependency problem shows, apply force install command:
sudo apt-get install -f
REFERENCES
Apt-Get https://help.ubuntu.com/12.04/serverguide/apt-get.html
https://www.tecmint.com/useful-basic-commands-of-apt-get-and-apt-cache-for-package-management/
Comments
Post a Comment