AurosBlog

Technical Blog

How to install anything in Ubuntu

Most Windows users who migrate to Ubuntu end up confused about software installation. They go to a website, download a .tar.gz file, double-click it, and don’t see a Next-Next-Next-Finish wizard. This tutorial is intended to introduce you to the preferred methods of software installation in Ubuntu.

Rather than leaving it up to the user to track down installer files and keep applications updated, Ubuntu (like many other Linux distributions) has a software package management system that provides a searchable database of easily installable applications (like an online shopping cart but the software is cost-free), which it will download and install for you with a few clicks.

There are several ways of installaing anything in Ubuntu:

  1. Installing with 101: Add/Remove
  2. Advanced interface: Synaptic Package Manager
  3. Manual download: .deb
  4. Manual Install: .rpm and .tar.gz

Installing with 101: Add/Remove

Start by going to Applications and selecting Add/Remove. Add/Remove will then check to see what applications are installed and/or available for installation. The default filter shows Supported applications only. You then have the option to search and/or browse for applications. Add/Remove will confirm with me that I want to Enable it.Then go to installed software and check (or tick) the box next to the program, click Apply, enter your password, and click OK. Add/Remove will then fetch the installer files, install the files, and then let you know when the software is installed. Afterwards, it gives you the option to start the application you just installed, add or remove more applications, or just close Add/Remove.

Advanced interface: Synaptic Package Manager

Another interface for the package manager is Synaptic. Synaptic works very similarly to Add/Remove, but it has more advanced options. It allows you more categories and custom filters, and shows you supporting libraries (not just user applications). Go to System > Administration > Synaptic Package Manager. Then enter your password and click OK. You can click the Search button or press Control-F to search for software. Once you’ve found the software you want to install, right-click it and mark it for installation. Once you’ve marked all the software packages you want to install (or remove, too), click Apply, confirm by clicking Apply when prompted, and then wait for the package files to download and install. Once they’ve installed, click Close.

Manual download: .deb

Most of the time, if you need software, you can use Add/Remove or Synaptic to install it from the online repositories. Sometimes, software is not available in the repositories, and you have to go to a website to download it. If you are able to download a file with a .deb extension, this is the software package format Ubuntu prefers. Go to the software site which you want to install. Download the .deb version for ubuntu and you muct check for the proper versioning. It should be either can be installed into your distro or it is for any distos. Once the .deb file is on your desktop, double-click it to install it. You’ll be prompted for your password, and then you can just wait for it to install.

Manual Install: .rpm and .tar.gz

The preferred way to install software in Ubuntu is to use the package manager, which you can access through Add/Remove or Synaptic. But what if you can’t find a .deb?

.rpm
If you can’t find a .deb, you can try a .rpm. These files are packaged for other Linux distributions (usually Fedora or Mandriva), but there is an application called alien (which you can install using Synaptic) that allows you (most of the time) to convert .rpm files to .deb. for that you can go and check ubuntu forum here

.tar.gz
you can download a .tar.gz file. The .tar.gz file extension indicates the file is a compressed set of files and folders (the compressed files you see in Windows usually have a .zip extension). If you see the .tar.gz, it could be compressed files that have a precompiled binary file, or it could be compressed files that have the source code allowing you to compile the application from source.

You can also see the community documentation here

Mistakes to Avoid while installing softwares in your Linux distros

Installing software in Linux is nothing like it used to be, but there are still some pitfalls to watch out for. If you follow this little guide, your Linux life will be made simpler and safer.

#1: Installing from source when your system is primarily an .rpm or .deb system

Many new Linux users don’t understand that both rpm and apt (or dkpg) keep track of everything installed on the system. However, those systems (rpm, apt, and dkpg) can keep track only of packages they install. So when you find that obscure package that comes only in source and you compile it yourself, your package management system will not know what to do with it. Instead, create either an .rpm or .deb file from the source and install the package with the package management system so that system will be aware of everything you have installed.

#2: Neglecting the many graphical front-end package management applications

Most people don’t even realize that there are graphical front ends that take a lot of the guesswork out of installing packages in Linux. For yum (the command-line package management system for rpm), you can use Yumex for yum (installed with yum install yumex); you can use Synaptic or Adept for apt (installed with apt-get install synaptic or apt-get install adept).

#3: Forgetting to update the list of available packages

When using apt-get or yum, make sure you’re updating the list of available packages. Otherwise, your system will not remain updated with the latest releases of installed packages. To update with apt-get, you issue the command apt-get update. To update with yum, issue yum check-update.

#4: Not adding repositories for yum or apt-get

Both yum and apt-get use a listing of repositories that tell them where to locate available packages. But the default repositories (often called “repos”) do not include every Linux package known to Linuxkind. So if you run the command to install an application, and yum (or apt-get) can’t find the package, most likely you’ll have to add a repo to your sources listing. For yum, the sources are in /etc/yum.conf. For apt-get, they are placed in /etc/apt/sources.list. Once you have added a new repo, make sure you run the update so either apt or rpm is made aware of the new source.

5#: Not taking advantage of installing from a browser

Just as with Windows, when your system sees you are attempting to download an installable application, you’ll be asked whether you would like the package management system to attempt to install the file or just save it to disk. In both instances, you will be asked for the root password (so you must have access to said password for this to even work). One thing I’ve always like about this method (be it in a yum-based or dpkg-based system) is that it has almost always been good about locating and adding dependencies.

Naturally, this method works only when you are downloading a file that’s applicable to your system. If you attempt to download an rpm file on a Debian-based system, you won’t have the option of installing the file.

You can take this one step further and select the Always Do This… check box in the Firefox popup so that every time you download a file associated with your package management system, it will automatically prompt you for your root password and continue to install the package. This streamlines the process quite a bit.

#6: Forgetting the command line

Let’s say you’ve installed a headless server using Ubuntu or Debian (a common setup for Linux servers) and haven’t installed any of the graphical interfaces or desktops. To do any maintenance, you have to log in via ssh (because no admin would log in via telnet) and are limited to the command line only. Even so, your ability to keep your system updated or install new applications is not limited. You can still use yum or apt-get to manage your packages.

With a Debian-based system, you have another option: Aptitude. From the command line, issue the command aptitude and you will be greeted with a nice curses-based interface for apt. This system is easy to use and gives you an outstanding option for maintaining a gui-less server without losing functionality. Aptitude lists Security Updates, Upgradeable Packages, New Packages, Not Installed Packages, Obsolete Packages, Virtual Packages, and Tasks. As you scroll through the list, you will not only get the installed vs. the new package release numbers but also a description of the package. After using Aptitude, you will quickly see how simple updating Linux packages can be, even from the command line.

#7: Blindly unpacking tar files

I can’t tell you how many times I have downloaded a source package and without thinking, untarred the package not knowing its contents. Most times this works out fine. But there are a few times when the package creator/maintainer has failed to mention that the entire contents of the package are not housed in a parent directory. So instead of having a newly created directory housing the contents of the tar file (which can contain hundreds of files/directories), those files are blown up into the directory you unpacked them into.

To avoid this, I always create a temporary directory and move the tar file into it. Then, when I unpack the tar file, it doesn’t matter if the contents are contained within their own directory or not. Using this method will save you a LOT of cleanup in those cases where the creator didn’t pack everything in its own neat directory.

#8: Deleting those make files

When you’re installing from source, you’ll probably run make clean to get rid of all of those unneeded source files. But if you get rid of the Makefile, uninstalling will be a hassle. If you keep it, you can usually uninstall the program simply by issuing make uninstall from the directory housing the Makefile. A word of warning: Don’t dump all your Makefiles into one directory. First rename them so you know which application they belong to. When you want to uninstall the application, move the Makefile to another directory, rename it to its original name, and then run the uninstall command. Once you’ve uninstalled the application, you can delete the Makefile.

#9: Installing for the wrong architecture

You might notice that many rpm files will have an i386, i586, i686, PPC, 64, etc. There is a reason for this. Unless the rpm file has noarch included in the filename, that rpm file was created for a specific architecture. And when those files were created for that architecture, they were optimized for it, so they’ll will run better. Does that mean you can’t install an i586 on a standard 386 machine? Of course not. But it will not run as efficiently as it will on the indicated architecture. Now, you can’t install a PPC rpm on an x86 architecture. The PPC architecture is for the Motorola chipset. Nor can you install the 64 bit on a 32 bit. You can, however, install the 32 bit on a 64 bit (as in the case when you want to get Firefox running with Flash on a 64-bit machine).

#10: Failing to address problems with kernel updates

It used to be that updating kernels was a task left to the silverback geeks. No more. With the new package management systems, anyone can update a kernel. But there are some gotchas you should know about. One issue is that of space. With every update of a kernel, your old kernel is retained. If you continually update kernels, your system storage can quickly fill up. It’s always a good idea to check to see what older kernels you can get rid of. If you’re using rpm, issue the command rpm -qa | grep kernel to see what you have installed. You can remove all but the last two installed. It’s always best to keep two in case the one you are running gets fubar’d.

So guys who are using Ubuntu or any other distros please keep this things in mind while installing anything in your distros and you will never be in any problem.