|In this post we will undercut each and every one of the different possible ways to install a program in Linux. Considering that Ubuntu is the most popular Linux distribution, especially among those just beginning to "dive" into the "Linux world", this mini-tutorial, aimed precisely at "beginners", will focus exclusively on Ubuntu . Anyway, this tutorial also works for all Debian and Ubuntu based distros (since they all use .DEB packages), and some general programs and concepts will work for other distros as well.|
In Ubuntu there are several ways to add, remove or update system applications.
Please note that not all applications available for Ubuntu are available by default to be installed. It will be necessary to enable the possibility of installing certain applications manually.
The main ways to install applications are:
- The Ubuntu Software Center. A simple application with which you can add or remove packages from your system in a very simple way.
- The program Synaptic. With Synaptic you will be able to have more control over the programs that you install in the system. As well as a greater number of them. NOTE: Synaptic currently uses apt-get.
- The program Adept. Adept is the version of Synaptic for KDE, included in Kubuntu.
- The programs apt-get or aptitude. These are more advanced programs that run in terminal mode. They are very powerful and also allow you to add and remove applications from the system among other things. (Aptitude is more complete than apt-get, it remembers downloaded libraries and uninstalls them if they are deprecated). To view help for any program running in terminal mode: (
man nombre_del_programa). Example:
- Deb packages. Files with a .deb extension are application packages already prepared to be installed easily on your Ubuntu system.
- Binary files. Files with the .bin extension are executable programs on Linux.
- Run files. Files with the .run extension are usually the wizards for installation in Linux.
We are now going to see each one of them with its peculiarities.
Table of Contents
The Ubuntu Software Center
The program Ubuntu Software Center it is the easiest way in Ubuntu to install or remove programs. It is also the most limited.
You can find the program at Applications menu> Ubuntu Software Center
(1) To install applications, select one of the categories shown on the main screen of the program. This will update the window showing the programs available in that category. Now you just have to find the program you want to install and double click on it. The window will show a description of it and will give you the option to install it by pressing the Install button.
(2) If you do not know in which section the program you are looking for is located. Enter the name of the application you want to install in the search box at the top right. As you write the name of the program, the list of possible candidates will be reduced, until you find the one you were looking for.
(3) By clicking on "Installed Software" on the left you will access a list of all the programs that you have installed on your system. If you want to uninstall any of them. Just click twice on it and the window will update showing you the description of the program and giving you the option to uninstall it.
Here you can see it explained in video format.
Synaptic package manager
Synaptic It is an advanced system to install or remove applications from your system. The environment is graphical, as in the Ubuntu Software Center, but much more powerful. With Synaptic you have complete control of the packages (applications) installed on your system.
To run Synaptic choose System -> Administration -> Synaptic Package Manager. This package manager will allow us to install, reinstall and remove packages in a very simple graphical way.
The Synaptic screen is divided into 4 sections.
The two most important are the list of categories (1) on the left side and that of the packages (3) On the right side.
Selecting a package from the list will display a description of it (4).
To install a package you can select a category, right-click on the desired package and select "dial to install"Or do double click in the package name.
Mark in this way all the packages that you want to install on the system and click Apply to proceed with their installation. Synaptic will now download the necessary packages from the repositories on the internet or from the installation CD.
You can also use the Search button to find the packages you want to install.
By clicking on the search button, we can search for programs by name or description. Once the program we want to install is located, we double-click on it to install it. If we want to delete a program, all we have to do is right-click on it and select delete or delete completely.
For the changes to be applied, it is necessary to click on the Apply button.
The software installation system in Ubuntu is very powerful and versatile. Within the repositories the applications are organized in "packages". Each package has others on which it depends for its proper functioning. Synaptic takes care of resolving these dependencies and installing the necessary packages for you. But not only that. In the application packages, other packages are also indicated that although they are not necessary for the application that we want to install to work, they are useful. These are the "recommended packages«.
We can configure Synaptic to consider these packages «recomendados»As if they were dependencies and thus it will also install them automatically.
Launch Synaptic and go to Settings> Preferences, in the Tab General Check the "Treat recommended packages as dependencies" box.
Here you can see it explained in video format.
Adept expert administrator
Kubuntu users have the equivalent of Synaptic, called Adept expert administrator. It can be found in the menu KDE> System> Expert Administrator. The operation is very similar to Synaptic.
Using the search box you can search for packages both by name and by their description. By double clicking on an element of the result of the list, it is marked to install.
You can see the dependencies of a package by looking at its properties ("details").
The repositories in adept can be managed by clicking on the adept menu and then on managing repositories
Kubuntu software : here they are (main, universe, restricted, multiverse) and one more where the source codes are, as well as a drop-down menu to choose from where or from which server we will download.
Third-Party Software: Here we can include additional third party repositories or a cdrom.
Updates: Kubuntu updates, we can select the updates that adept will review, we also configure automatic updates, we can choose to install them without notifying us, download them silently or just notify that there are updates.
Authentication: Here are the keys to the signatures for the files we download from the repositories, also if we find a third-party repository that interests us and handles signatures we can include it by downloading the signature file from the website or ftp to any directory and import it or we include by clicking the button "Import Key File ..."
aptitude and apt-get
Although we can install programs graphically, as we have seen in the previous points, we can always use the terminal to install any program.
To many new users this option may seem a bit more complicated and somewhat cryptic. Nothing is further from reality; when you get used to it, it is much more comfortable, easy and fast.
There are two ways to install programs in text mode: with aptitude and with apt-get.
Both programs are very similar, except in one detail: aptitude remembers the dependencies that have been applied in the installation of a package. This means that if you install or update an application with aptitude and then want to uninstall, aptitude will delete the program along with all its dependencies (except if they are used by other packages). If installed with apt-get or Synaptic graphical environment, uninstall will remove only the specified package, but not the dependencies.
We open a terminal via Applications -> Accessories -> Terminal.
- Install packages:
$ sudo apt-get install
- Uninstall packages:
$ sudo apt-get remove
- Uninstall packages (including configuration files):
$ sudo apt-get purge
- Update the list of available packages:
$ sudo apt-get update
- Update the system with available package updates:
$ sudo apt-get upgrade
- Get a list of command options:
$ sudo apt-get help
Install packages without internet
On a computer that does have internet and that the program / package that we want is not installed, we can download the packages together with their dependencies (not already installed) using these two commands:
sudo aptitude clean sudo aptitude install -d package_name
When we install a package through aptitude / apt, it remains in a specific folder. With the first command what we do is delete these packages from the computer (it does not affect the installations already made).
The second command will download the package we wanted and the dependencies it needs, but it will not install it. Now we go to "/ var / cache / apt / archives" and see these packages. We copy them, take them to the computer that does not have a connection and install them by double clicking on each of them or in the console:
sudo dpkg -i package_name
Keep in mind that if there are dependencies, you have to install these first. It may also be the case that some of these dependencies were already installed on the computer with internet, so that they would not be downloaded.
If the computer with internet already had it installed, then it could be uninstalled using "aptitude remove" (without purge) and we remove the "-d" from the later "aptitude install". In this way we uninstall it first and then download and install it. In this way the computer with the internet will continue to have the program exactly the same as before uninstalling it.
To solve and prevent possible dependency problems we can go to the Synaptic of the computer with internet, we look for the package we want, we right click on the package in question, we enter Properties and select the tab outbuildings. There we see the packages that we need to properly install the package on the computer without internet.
Optionally, we can also download the debian disks that contain many programs and .deb packages, which makes them compatible with ubuntu, we only enter the origins of the software and click on add cd-rom.
Another way to install applications on the system is through the packages already prepared to be installed and with the extension .deb.
To install these packages you just have to do double click on the file in the Nautilus browser and the application will automatically launch gdeby, which will take care of installing the package and looking for the dependencies of other packages that it may need for its correct installation.
If we prefer, they can also be installed using the command line, using the command dpkg:
sudo dpkg -i .deb
In this case you will also have to manually install the possible dependencies of the package.
The same command can also be used to uninstall the package:
sudo dpkg -r
Convert RPM packages to Deb
Some GNU / Linux distributions, such as Red Hat, SUSE, and Mandriva, use .rpm packages, organized differently from Debian and Ubuntu .deb packages.
To install these packages you must first convert them to the .deb format. For this the application is used alien, which can be installed using one of the methods explained in this article. The application alien is used as follows:
We open a terminal (Applications> Accessories> Terminal) and execute the following instruction:
sudo alien .rpm
In this way, the program creates a file with the name of the package, but with a .deb extension, which can be installed following the Deb packages explanation.
Autopackage packages (extension .package)
The project Autopackage was born with the idea of facilitating the installation of applications in Linux regardless of the distribution and desktop they use. That is why many projects use it, such as Inkscape.
Installing a .package file for the first time is very easy. Just follow the instructions below (the project page also indicates how).
Once the file is downloaded, we must give it execution permissions, double click on the file and on the notice in which it asks Do you want to run __ or view its content? we must click on Run. Once this is done, the program's installer will start Autopackage and the contents of the package.
When the program is installed Autopackage, the next file of this type that you want to install, just double-click on it without having to do anything of the above.
Files with the .bin extension are binary files. They do not contain a set of programs or libraries like packages, but are the program itself. Normally, commercial programs are distributed under this system, which may or may not be free, but are usually not free.
When we download a file of this type and save it to the system, it will not have permission to run.
The first thing we must do, therefore, is give that file permission to run. We display the contextual menu of the file and choose the option Properties. We select the tab Permissions and we will see that the file has read and write permissions for the owner but not for execution. We activate the box to give execution permissions and close the window.
sudo chmod + x .bin
We install the binary file:
$ sudo ./.bin
The files .run they are wizards, usually graphical, that help with the installation. To execute them, just enter in the terminal:
Normally, in case you need superuser permissions (also called administrator or root) will ask for the password; if not, just add the order sudo before the command, which would look like this:
sudo sh ./.run
Build applications from source code
Sometimes you will find applications that do not provide installation packages, and you have to compile from source code. To do this, the first thing we must do in Ubuntu is install a meta-package called build-essential, using one of the methods explained in this article.
In general, the steps to follow to compile an application are the following:
- Download the source code.
- Unzip the code, it is usually packaged with tar compressed under gzip (* .tar.gz) or bzip2 (* .tar.bz2).
- Enter the folder created by unzipping the code.
- Run the script configure (used to check the system characteristics that affect the compilation, configuring the compilation according to these values, and create the file makefile).
- Run command make, in charge of compilation.
- Run command sudo make install, which installs the application on the system, or better yet, install the package checkinstall, and run sudo checkinstall. This application creates a .deb package so that it does not have to be compiled the next time, although it does not include the list of dependencies.
Use of El checkinstall It also has the advantage that the system will keep track of the programs installed in this way, also facilitating their uninstallation.
Here is a complete example of running this procedure:
tar xvzf sensors-applet-0.5.1.tar.gz cd sensors-applet-0.5.1 ./configure --prefix = / usr make sudo checkinstall