Why not all Linux packages/software come in .deb format? [closed]

This is because the Linux ecosystem contains many many different sub branches (click on the image for a larger version)1:

enter image description here

Now, one of the basic differences between these distributions is the package manager they use. Debian and its derivatives (one of which is Ubuntu) use dpkg which deals with .deb packages. The other large player is the RedHat Package Manager (rpm) which works with .rpm packages. Other distributions have their own system or use a wrapper to install directly from source or even have no package manager at all.

In any case, the .tar.gz format is

  1. Not actually a format. That is what is known as a compressed tarball. tar creates archives (.tar) which are then passed through gzip to compress them (.gz). See here for more details.

  2. Not an installer. It is just a collection of files/directories, in the case of source tarballs, the source code of a program.

  3. Not in any way specific to source codes or programs. You can think of .tar.gz as an equivalent to Windows (and not only) .zip files. They can contain an installer or they can contain word documents or whatever else.

The reason why all Linux programs are not packaged as .deb files is because while .deb is indeed popular, it does not work for all distributions. Therefore, a developer can either attempt to package their app for as many distributions as they can or simply make the source code available and let users compile it themselves. Up until a few years ago, the vast majority of Linux programs were only distributed in this way. The variety of pre-packaged programs was quite small.

This has changed in recent years with the huge increase of popularity of the .deb format, which was largely due to the corresponding popularity of Ubuntu and Linux Mint.

The reason why not everyone uses .deb is that each approach (dpkg/apt-get, rpm/yum, pacman etc) has its diehard fans. And if I only release my program as a .deb not everyone will be able to use it. The only way to make sure that any GNU/Linux user will be able to use my software is to release it as source and let them compile it manually.

As a final note, you really shouldn't be scared of such programs. While it is true that sorting out the dependencies can be a pain, most devs will clearly state the dependencies on their webpage and as long as you have them installed, installing software from a source tarball is really quite easy:

  1. Extract the file

     tar xvzf software.tar.gz
    
  2. Move into the newly created directory where the files were extracted

     cd software/
    
  3. Configure

     ./configure
    
  4. Compile

     make
    
  5. Install

     sudo make install
    

This can all be condensed to:

tar xvzf software.tgz; cd software; ./configure && make && make install

1 Image taken from this Wikipedia page.


Actually there are alternatives to .deb packages

.deb packages stands for debian packages. It was started by the Debian Linux Distribution

Another major player is rpm which stands for RedHat package manager

Linux relies on open source. So most of zipped file like .tar.gz are source codes

You have to compile and run on any linux distribution like so:

tar -xvf yourdownloadedpackagefilename.tar.gz
cd yourdownloadedpackagefilename
./configure
make
make install

Note: you should carefully read the README file because not all source packages behave the same way!

This is not the case when dealing with package managers. They depend on the distro.

Hope that helps

I found this quote very helpful defining the difference between package managers:

Both these groups are "package managers" which greatly simplify the process of installing, updating, otherwise maintaining, and removing software. The "deb" files are for use by the "dpkg" utility that originated with the Debian distro (of which Ubuntu is a variant) and the "rpm" files are for the RedHat Package Manager, a similar but very different utility that originated with the Red Hat distribution.

Before package managers came into use, installing a new piece of software was a complicated process that turned off many non-geeks. You had to locate its source code, then compile and link that source into an executable binary file. The first attempt to do so usually resulted in a long string of error messages about missing library files -- for which you had to search, install, and repeat the process.

The package manager utilities made it possible to list all these "dependencies" within a single file that also included a description, and the ready-to-run binary program file. The package manager takes care of fetching all the needed dependencies, and also handles initial configuration of the new software.

While the two different types of manager do essentially the same job, their files are not directly interchangeable. A utility does exist for converting RPM files into the DEB format, but there's no guarantee that a converted RPM file will automatically configure things properly for the Debian standards of file location (which differ significantly, in some respects, from those of Red Hat and its descendants).

I hope this helps a bit; not all distributions use package managers, so if you want to learn more about the "old ways" you can try things like Slackware or GenToo! That may tell you more than you'll be comfortable learning


Really, because the question is wrong.

Is like to ask "why I can buy cakes and flour, eggs, sugar too? It's so easier to just eat the cake, why someone sells all that other things too?"

.deb are packages with (normally) compiled programs that someone compiled, installed, configured and adapted to a specific operating system. Someone took care of dependencies, side effects, etc. Note that .deb format is used by Ubuntu and several other distributions, like debian, Mint, etc... and even if you can install a debian .deb in Ubuntu and often it will work, is not guaranteed so. Other distributions have different packaging systems (rpm, pacman, even .tar.gz for slackware).

.tar.gz is a compressed, archived set of files. Think .zip. It could be whatever. A software, a photo collection, source code, compiled code, even a package for a distro, you name it.


As explained in the Debian FAQ:

Packages generally contain all of the files necessary to implement a set of related commands or features. There are two types of Debian packages:

Binary packages, which contain executables, configuration files, man/info pages, copyright information, and other documentation. These packages are distributed in a Debian-specific archive format they are usually distinguished by having a '.deb' file extension. Binary packages can be unpacked using the Debian utility dpkg and possibly via a frontend like aptitude.

Source packages, which consist of a .dsc file describing the source package (including the names of the following files), a .orig.tar.gz file that contains the original unmodified source in gzip-compressed tar format and usually a .diff.gz file that contains the Debian-specific changes to the original source. The utility dpkg-source packs and unpacks Debian source archives. The program apt-get can get used a frontend for dpkg-source.