[SOLVED] How do programs installers work in Linux?
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I have a question about how programs work in Linux.
In Windows, there's quite a few applications made 'portable' meaning the files are copied to the HDD, but no installer is run and no changes are made to the OS registry or elsewhere. I tend to use this for programs that i infrequently use. I find that the more software i install (rather than using the portable variety) the slower my PC loads and runs.
1. Does Linux have 'portable apps'?
2. Does Linux need 'portable apps'?
3. What differentiates the way Linux installs and runs programs compared to Windows?
Thanks very much, sorry if it's a silly question. I am very new.
I did a search but couldn't see anything relevant.
In GNU/Linux the way programs are installed depends on the distribution you use... Some, like Debian/Ubuntu/Fedora/Suse/..., feature a catalog where you might just have to do a few clicks to install an application (or typing a few things in a terminal, if you prefer ). At the other end of the possibilities, some distributions will require you to download source code, check for dependencies by yourself and to compile...
This being said, there is no registry in Linux. Almost all applications store their configurations in text files. Installing applications will not slow down your PC, unless you install daemons (services in Windows) because they are going to run permanently and obviously will take some memory and resources. Basically when you install a program, you will install an executable. Besides that, depending on the complexity of the application, you might also get shared library(ies) (DLL in Windows) and configuration file(s).
There is no definitive answer to your questions, but I would say that most applications in Linux can be considered as 'portable'.
There is no difference in the way programs are run (except that Linux uses the ELF and aout formats while Windows uses the exe format).
There is a huge difference in the way they are installed. In Windows, you would go to the program's website, download a .exe installer and then run it, hoping it doesn't contain any viruses.
In Linux you have an app store (it's called a package database or package repository, but it's just an app store). You tell your package manager to install a program and it looks it up in its internal database. It finds the package name and its dependecies. A dependency is when a package needs another package to work, a game, for example might use OpenGL and SDL for its video rendering and thus needs them to be installed.
It downloads the package and its dependencies and then it checks for file conflicts; if package foo has a file called /etc/foo.conf and package bar also wants to create a file /etc/foo.conf, the package manager will give an error message and quit installation. Then it checks if your hard disk (or SSD or USB) has enough free space, and installs the package. It then updates its database of file onwnership (package foo owns the file /etc/foo.conf).
Some Linux software will be distributed windows-style with an installer program, but its much safer to use the packagers from you package manager, since those have already been tested.
Packages do not have to be programs, some packages will contain fonts, game levels, software manuals or desktop backgrounds.
I have no idea what the Windows registry is, so I can't help you there.
Last edited by mennohellinga; 09-15-2012 at 03:57 PM.
In Arch for example you have tar archives which contain files of a program. When you install a program from this tar archive (which is normally downloaded from repositories) the package manager unpacks archive and places its files to specified dirs. That's it, the program is installed. Most of the times no changes are made to the system (unless it's some kind of wrong program like Gnome 3). Then you can type the name of the program in CLI to start it. What happens is when you type this name it's being searched in few directories specified in $PATH variable. When the binary starts it knows where to find other files that belong to this program due to definite logic of filesystem.
There are also "portable" programs for GNU which don't require installation. I don't know much about them, they are just like in Windows - packages of all files of a program. And that package gets extracted and then run. I personally never used those.
Good answers so far. I'd add this on what it means to be portable:
Most apps - windows and linux - will set up menu items (GUI apps that is) which is a change to your config files.
Most apps - windows and linux - will store preferences (settings etc) in a predefined folder. In Linux this is usually a dot (hidden) file or directory in your home directory - like /home/you/.theapp. In Windows it's usually C:\Users\you\Local Settings\Application Data\theapp\ or something like that.
In addition, most large or complex apps have dependencies that you have to install beforehand (on windows) or which are pulled in automatically by the package manager (on linux), if they aren't already installed. (If they are, then they are shared by any other app that needs them.)
Portable apps can't do any of these things. You would need to call them by clicking an executable in the portable location (or the command line equivalent). They have to store preferences, if any, in the directory they run from (so they are available when run on other computers). If they have any dependencies they have to be included in the build or shipped on the same memory stick (say) which could increase the size, even if already installed on the user's hard drive. And these differences are not really harder or easier on Linux vs Windows.
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
at the most fundamental level, both windows and Linux installers are essentially the same, just processes that unpack the software from an archive and copy it to a pre-defined location on the hard drive. That location is somewhere in the PATH (the list of places the OS will search for executables when issued a command to run a program). That however is where the similarities end.
In windows, the installer is a self contained executable that unpacks and copies binary files into the PATH and make any necessary changes to the registry to create a place to store it's settings.
Linux on the other hand has a variety of ways of doing this. The most common with big distributions is to create a repository of packages, which are essentially glorified zip files (or tarballs if you prefer) with a 'packing slip' that tells the package manager what version it is, what dependencies are needed, what architecture it is etc...
Another method of distribution with linux, which used to be more common, but is now more of a niche way of doing things with the big distribution, or how some of the more technical distributions do things, is to distribute a tarball of the binary with a list of dependencies which need to be manually resolved.
Even more extreme, but the most flexible way of distributing software is to provide the source code, which needs compiling before it can be installed and run, and won't compile properly if dependencies aren't met.
and then there are the handful of proprietary software packages (such as the proprietary drivers for NVIDIA and ATI video cards) DO provide a self extracting .run file that sometimes (as in the case of the video card drivers) contains a chunk of source code that is built on the fly by the installer, or just contains binaries. these .run files DO work the same as windows .exe files, but are currently relatively few and far between.
as for another large difference between linux and windows installation? Windows .exe installers usually come with any dependencies already built into the package (which can and sometimes DOES cause problems when a software overwrites a newer version of a library with it's bundled older version, breaking any software that relies on the new version), whereas as already mentioned, with linux, dependency resolution isn't handled by 'bundling' the dependencies, it is handled at the package management level (or manually) to prevent such problems.
as for portable apps for linux, a 'portible' app as mentioned is simply a version of an app bundled with whatever software is necessary to support it (libraries etc..), and is modified to store the configuration in the same folder as the portible app, thus creating a self-contained distribution of the app, and YES, there are portable apps for linux.