How to enable fancy progress bar for apt

apt is a new tool that has been introduced to take over the functionality of apt-get and apt-cache. It has fancy and colorful progress bars that can be enabled using this:

$ sudo -s
$ echo 'Dpkg::Progress-Fancy "1";' > /etc/apt/apt.conf.d/99progressbar
$ exit

Tried with: Ubuntu 14.04

How to uninstall a package in Ubuntu

Uninstalling a package in Ubuntu can be performed in many ways. For example, assume that the package named vim needs to be uninstalled.

Using the shell

The package vim can be uninstalled using apt-get:

$ sudo apt-get remove vim

Using Synaptic

If Synaptic is not present, install it from Ubuntu repositories using the package name synaptic.

Open it from the Dash with the name Synaptic Package Manager. Search for the package name vim, right-click on its entry in the results, choose Mark for Removal and click Apply.

Using Software Center

Open Ubuntu Software Center from the Dash. Search for the package name vim. When it shows up in the search results, choose it and click Remove.

Tried with: Ubuntu 12.04.2 LTS

How to get source packages in Ubuntu

Ubuntu package management makes it really easy to download and install the packages you want. These packages contain binaries, libraries, headers and other files needed to execute an application. Sometimes you may wish to have a look at the source codeΒ used to create an application or library. If you are lucky, the source code might be available on GitHub or BitBucket for easy browsing and cloning. If not, you can always get the source package. A source package contains the source code that was used to create one or more binary packages that you typically install to get binaries or libraries.

First, find out the name of the source package you will need. Go to Ubuntu Packages Search, in the search section choose the Source package names and search. You should be able to find the name of the source package that you want.

Next, use the name of the source package with apt-get:

$ apt-get source vim

This downloads the source package to your current directory and unzips it. So, you do not need sudo permission for this.

Browse the source code of your favorite packages and learn πŸ™‚

Tried with: apt 0.8.16 and Ubuntu 12.04 LTS

How to install a package from Ubuntu repositories

Installing a package from the Ubuntu repositories is easy. There are three ways to do it.

You can use the Ubuntu Software Center. Open it, search for the package name and install it.

You can use the Synaptic program. You may have to install it, if it is not already there. Open it, search the package name, mark it for installation and choose Apply.

If you like the terminal, use the apt-get program. For example, to install a package named Foo:

$ sudo apt-get install Foo

Tried with: Ubuntu 12.04.1 LTS

How to apt-get install without prompts

apt-get install tends to throw lots of Yes or No prompts, asking if dependent packages need to be installed or not. If you are installing a package that is large or with lots of dependencies or installing a number of packages, answering these prompts keeps you from switching to do some work.

One solution is to request apt-get install to automatically answer Yes to all the Yes or Not prompts that might come up during installation.

To do that during an installation of a package Foo:

$ sudo apt-get install --yes Foo

Tried with: Ubuntu 12.04 LTS