Mar 30, 2012 dpkg – dpkg is a tool to install, build, remove and to manage packages and –i specifies to install.deb file. Installing Application using Package in Ubuntu from Internet. If you have been using or learning Ubuntu for a while, you might have observed the command named apt or apt-get.
Image source: Scrabble Letters
Ubuntu is based on Debian and all software packages are .deb files. Most software packages are free available from Ubuntu Repositories. Adding and removing software and System Update are critical procedures, as for every system.
Debian packages (and Ubuntu of course) can be managed from command line using the package manager “apt”. There is also a menu-driven, text-based frontend to apt, which is called “aptitude”. Moreover, dpkg command (Debian package) is the low level package manager for Debian files (.deb). It is the backend of apt (and aptitude), which in turn is the backend for GUI utilities like Synaptic Package Manager and Ubuntu Software Center.
Ubuntu Desktop releases offer handy GUI utilities to handle Package Management and System Update:
Repository management: Software & Updates
Add - remove software:
Ubuntu Software Center (or simply “Software” in other Ubuntu flavors) or
Synaptic Package Manager (actually, an apt front-end).
Software and System Update:
Updates are also available from Ubuntu Software Center
Using a desktop computer (workstation), it is more possible that you will use these GUI utilities. However, you can use the command line if you prefer. It's a matter of choice.
You can find these applications using Ubuntu Unity Dash (see image) or from the applications menu in other Ubuntu flavors. For example, to find “Software Updater”, open Dash (press SUPER key) and type something relevant:
(click the thumb for full image)
Please note that Synaptic is not included in default installation. To install it, use Ubuntu Software Center or open a terminal and use:
It is recommended to select a Long Term Support (LTS) Ubuntu Release for your Desktop Workstation, so you will have Updates for 5 years. A new LTS version is released every 2 years. Current LTS release (2016 Oct) is Ubuntu 16.04 (Xenial Xerus).
Repository Management
One of the biggest differences between Linux and Microsoft Windows is that most Linux software is free available from Software Repositories. Every Linux distribution releases its software from Repositories and offers a “package manager”.
Ubuntu official Repositories are: Main, Restricted, Universe, and Multiverse. Main and Restricted are fully supported by Canonical (the company behind Ubuntu), while Universe and Multiverse are supported by the community.
In latest Ubuntu Desktop releases all four repositories enabled by default. If you want Ubuntu to setup software other than open source officially supported, then check 'Install third-party software for graphics and Wi-Fi hardware, Flash, MP3 and other media' during installation procedure. However, you can do it later, but it is recommended to be done during installation. Please, note that it IS NOT RECOMMENDED in Ubuntu server systems, where “security” is critical.
(click the thumb for full image)
Except these Repositories, there are many more, named PPA (Personal Package Archives) for third party programs. These Repositories hosted in Launchpad platform. Of course, these repositories are not supported from Canonical.
Add Repository - Official Repositories
Using command line
Official Repositories are defined in /etc/apt/sources.list
A repository line seems like:
To enable a repository
uncomment its definition line and then
refresh system software sources using
Using “Software & Updates”
Go to first TAB “Ubuntu Software”, check the repository you want to enable and follow the instructions.
(click the thumb for full image)
Add Repository - Other repositories (including PPA)
Using command line
Avoid to directly edit /etc/apt/sources.list. Use your own .list file in /etc/apt/sources.list.d. For example, to add Oracle Virtualbox Repository:
Add the line
Download the provided Repository key and add this with:
Finally, update Repositories in your system (software sources)
Using “Software & Updates”
Go to TAB “Other Software” press “ADD” and follow the instructions
(click the thumb for full image)
Using add-apt-repository
It is mainly used for PPA repositories
Theoretically, it can be used for other repositories
Remove Repository
Using command line
To disable a repository, comment its definition in /etc/apt/sources.list or delete the relevant .list file in /etc/apt/sources.list.d and then refresh system software sources using:
Using “Software & Updates”
Uncheck Repository and follow the instructions
on first TAB “Ubuntu Software”
(click the thumb for full image)
or second TAB “Other Software”
(click the thumb for full image)
Using add-apt-repository
It is mainly used for PPA repositories
Package Management (Add - remove software)
It is recommended to install software from Repositories, in order to keep your system secure and updated. In some cases this is not possible (some Java applications or software with custom installers). In this case, you have to take care for updates and newer versions of these applications.
Add software from Repositories
Using apt from command line
Just use the command
Using Synaptic
Search for this package
Check “Mark for Installation”
Press “Apply”
(click the thumb for full image)
Using Ubuntu Software
Search for this package
Check “Install”
(click the thumb for full image)
Add software - Direct Install .deb file
Using dpkg from command line
Just use the command
In case of dependency problems are reported, after using dpkg, install dependencies using
Using “Ubuntu Software Center”
Right click .deb file and select “Open with Software Install”
Remove software
Using apt from command line
Just use the command
If you want to also remove user data and configuration files
Using --auto-remove parameter will also remove package dependencies.
Using dpkg from command line
Just use the command
To remove a package and its configuration files
Files in your home folder are not part of the package so they will stay on your system until you remove them by yourself.
Using Synaptic
Search for this package
Check “Mark for Removal” (“Mark for Complete Removal” will also remove configuration files)
Press “Apply”
(click the thumb for full image)
Using Ubuntu Software Center
Find this package in TAB “Installed”
Press “Remove”
(click the thumb for full image)
Remove old kernels
After installing a new Linux kernel, old kernels are not automatically deleted. They remain in your disk (/boot partition). You have to delete them manually.
View details in this post.
How to find out if a program is installed in my system?
You may use Synaptic (just search for this package), or using command line:
System Update
System Update is a critical procedure with which you can
install OS (operating system) updates (mostly security updates)
update installed software with latest versions
Upgrade to a newer version of Ubuntu (without perform a fresh install) is another procedure outside ot the purpose of this post.
Using apt from command line
Just use this command
See this post for details.
Using GUI utilities
One of the most important things to do after installing Ununtu is to configure software update settings. Depending on your settings (“Software & Updates” → tab “Updates” ), Ubuntu will notify you when updates are available or will install them automatically (not recommended).
After installation, Ubuntu will prompt you, if reboot your machine is required.
(click the thumb for full image)
So, the available GUI utilities for software updates are:
“Software Updater”
“Software Updater” will check for available updates
(click the thumb for full image)
and then will install them
(click the thumb for full image)
“Ubuntu Software Center”
The third tab of “Ubuntu Software Center” informs you for available updates. This tool shows updates per installed software.
(click the thumb for full image)
Related Posts
You may also be interested in
Sign-up for our free email newsletter. Get updates when new tutorials and tips are published. You can unsubscribe anytime with a click.
Python is a widely used general purpose programming language. Python is very programmer friendly and easy to learn. Python is a modular programming language. So people all over the world write python code to solve different problems and share these codes with other people who have the same problems. The repository where all of these are kept is called PyPi or Python Package Index. PIP is just a tool used to automatically install these packages from PyPi repository. A PyPi package may depend on other PyPi packages. PIP also resolves package dependencies. PIP can also install packages downloaded manually from PyPi. So basically PIP is the package manager of Python, just like apt is for Ubuntu. PIP is a very useful tool for Python programmers.
In this article, I will show you how to install the latest version of Python PIP on Ubuntu 17.10 Artful Aardvark. Let’s get started.
There are 2 versions of Python programming languages that are still widely used today. They are Python 2 and Python 3. Work is in progress to convert all Python 2 codes to Python 3. Once the conversion is complete, Python 3 will dominate and the days for Python 2 will be over. Since both of these versions of Python programming languages are still in use today, I will show you how to install and upgrade PIP on Python 2 and Python 3.
Installing PIP for Python 3:
On Ubuntu 17.10 Artful Aardvark, PIP is not installed by default. Python 3.6.3 is installed. So let’s install PIP for Python 3 first.
You can check the version of Python 3 that is installed on your Ubuntu operating system with the following command:
Before you try to install anything new on Ubuntu operating system, run the following command to update the package repository cache of Ubuntu:
To install PIP for Python3 on Ubuntu 17.10, run the following command:
Now press ‘y’ and then press <Enter> to continue. It should take a while to download and install all these new packages depending on your internet connection.
Once the installation is complete, you can check the version of PIP for Python 3 using the following command:
You can see that, the version of PIP installed I PIP 9.0.1. According to the official website of PIP, this is the latest version as of this writing.
Updating PIP for Python 3:
By the time you read this article, the version of PIP for Python 3 might change. I am going to show you how to update PIP for Python 3 now.
Open a terminal and run the following command to update PIP for Python 3:
As you can see PIP for Python 3 has been updated.
Now to check the version of PIP for Python 3, run the following command:
You can see that it is 9.0.1 from the screenshot. Notice any difference? Before I updated PIP for Python 3, the command said PIP was installed in /usr/lib/python3/dist-packages directory. After I upgraded PIP for Python 3, the command now says that PIP is installed on the current user’s home directory. It means the upgrade was successful.
Install PIP for Python 2:
Python 2 is not installed by default on Ubuntu 17.10 Artful Aardvark. But if you do need Python 2 for any specific reason, you can install Python 2 on Ubuntu 17.10.
Run the following command to install Python 2 on Ubuntu 17.10:
Press ‘y’ and press <Enter> to continue the installation. It may take a while to download and install everything depending on your internet connection.
Once Python 2 is installed, you can check the version of Python 2 with the following command:
You can see that the installed Python 2 version is 2.7.14.
Now to install PIP for Python 2, run the following command:
Press ‘y’ and press <Enter> to continue the installation. It may take a while to download and install everything depending on your internet connection.
Once the installation is complete, you can check the version of PIP for Python 2 using the following command:
You can see that the version of PIP for Python 2 installed is 9.0.1 and its installed in /usr/lib/python2.7/dist-packages system directory. When we update PIP for Python 2, the installed location will change as it did for PIP for Python 3.
Update PIP for Python 2:
To update PIP for Python 2, run the following command:
Now check the version of PIP for Python 2 with the following command:
You can see that, the version of PIP for Python 2 is 9.0.1 and just like before the installed location is changed to the current user’s home directory. It verifies that the package update was successful.
So that’s how you install and update PIP for Python 2 and Python 3 on Ubuntu 17.10 Artful Aardvark. Thanks for reading this article.