As you might be installing any linux distribution on your computer you might tend to think. If linux has all projects and applications are open source, do i have to compile and install them manually? the answer is no ofcourse.
That is because depending on the distribution you are going to use there should be something that is called a package. A software package is a pre-compiled version of an open source software that you can install on your computer without having to re-compile the source code of that application.
As far as i am concerned, Debian-based systems and majority of other systems provide a couple of methods for downloading and installating packages. One of those is called apt-get. Apt-get is a console application that enables you to search, download and install packages from your distribution repository available on the internet. Let’s imagine a Repository like a software warehouse where you can go pick whatever package you want and run it on your computer. Once your distribution is installed some of those repositories are up to date and some are not.
If you want to to update your repositories using apt-get you can open up the console to write:
sudo apt-get update
Note: sudo is a command that precedes other commands to let the console know you are going to execute the command as a Super User (root access).
which will download the updated version of the repository database. Now to install an application you can type:
sudo apt-get install PackageName
But, why do i have to use console to install my application? would’nt double clicking the file and pressing “Next” be enough for installing application? do i have to remember this command? What if i do not have any idea about the package name?
This is why Adept or Synaptic package managers are there for. Kubuntu ships with Adept installed by default while Ubuntu ships with Synaptic installed by default.
Those package managers provide user-interface for apt-get application to enable you to search for packages. Search will be done on different fields of package like name, description..etc.
Here is how adept looks like:
As you might notice all options are available from searching to browsing packages.
If you click on the Adept -> Manager repositories menu this window will be displayed:
Notice that on your computer, all the checked options might not be checked. So make sure you check them and then close the window. You will be promoted to update the packages, do update them. Because when you check these options you are adding new databases to your local repositories and it should be up to date in order to install up to date software.
Once you get the packages updated, you can start searching for packages and install them on your computer. You can do this by inserting description or title of application you want to install. Adept will automatically filter results to fit the criteria you are using. Once packages appear you then can click on package title and press “Request install” to then press “Apply changes” in the application’s toolbar to download and install the application.
And we’re done! ![]()
But we have a problem!
Assuming that i format my computer for some reason. Do i have to Download and install the packages all again?
Of course not!!!
That is because we also have two options for this matter. You have to take the step of ALWAYS copying the packages in folder /var/cache/apt/archives/ folder because that’s where apt, adept, synaptic will download them to.
Now the 2 options are available to you are i mentioned before after you keep copies of packages. After re-installing Linux on your computer you can do this:
1) open up console
2) cd to the directory in which you copied your archives
ex: cd /media/sda2/my_archives/
note: /media/sda2 is a drive in hard disk.
3) run this command:
sudo dpkg -i *.deb
which will install all packages in that directory along with their prequisites.
So if you really think about it, re-installing all your applications will only take 10 minutes rather than 10 hours because you won’t have to install applications manually any more
Happy Linux’ing
Rakan
Filed under: Linux