How are software packages handled in Linux?

In summary, Linux is a system where programs are compiled into executable form and stored in a directory. The installation process places these executables in a corresponding installation directory. Once the software is installed, it writes data to the registry. There are many package managers available for Linux, which allow you to install software from the internet. Makefiles are used to compile source code and are present on most Linux systems.
  • #1
kandelabr
113
0
Hello,
i'm a beginner in linux and there's a thing i don't understand and can't find the answer in books nor on the net: software.
how is it handled in linux? there are some packages or something. are there separate packages for different distributions? if that's true, that's an unpleasant feature of linux.

i've read something about databases (debian etc.) and there are also sites like packages.ubuntu.com, packages.debian.org, etc. what's that?

in windows, a program is compiled and put into an installation program and when it installs it puts its files in its directory and writes some data to the registry; what's the situation in linux? why do i spot compilation instructions on almost every program's pages?
what's a makefile? i did a lot of programming in C on windows, but never used anything like a makefile. i have a feeling that's quite an important thing in linux. (?)

what a confusion.
thanks.
 
Computer science news on Phys.org
  • #2
kandelabr said:
how is it handled in linux? there are some packages or something. are there separate packages for different distributions? if that's true, that's an unpleasant feature of linux.
There are different packaging mechanisms for different distributions (.deb, .rpm etc) but most distributions can handle all types

in windows, a program is compiled and put into an installation program and when it installs it puts its files in its directory and writes some data to the registry; what's the situation in linux?
Exactly the same - except the package manager also checks that various system libs are the correct versions and will download any other software you need to make this software work.

packages.ubuntu.com, packages.debian.org, etc. what's that?
Think of them as the appstore for linux - almost all software on Linux is free so you can simply go to these sites and find free software already compiled and packaged for your version of linux to download and use for free.

why do i spot compilation instructions on almost every program's pages?
Because for opensource software you get the source code - that's the whole point of opensource.
You are allowed to make your own versions of the software and share that with others.

what's a makefile? i did a lot of programming in C on windows,
It's the set of compiler and linker steps to build software, it is used by a program called 'make' that also handles only compiling stuff that has changed since the last compile. It's the same as the .sln + .vcproj file for visual studio
Note windows also uses makefiles and a version of make called nmake.exe

To compile stuff on Linux you generally run a 'configure' file that comes with the software - this detects what kind of unix/linux you have installed and builds the makefile - you then simply run 'make' to compile.
With this you can build the source on anything from a macbook to an IBM supercomputer without having to know anything about the differences in the operating system.
 
  • #3
You also use "apt-get install ___" to have software pulled automatically from repositories (free app store) and installed.
 
  • #4
mgb_phys said:
To compile stuff on Linux you generally run a 'configure' file that comes with the software - this detects what kind of unix/linux you have installed and builds the makefile - you then simply run 'make' to compile.
If you're installing from the source code, there's also usually a README or INSTALL text file with full installation instructions.

You also use "apt-get install ___" to have software pulled automatically from repositories (free app store) and installed.
Unless you're using redhat/fedora, where you use "yum install".
 
  • #5
In most linux distribution, package installation is done though 'repositories'...or actually it's a list of software maintained by developers and maintainers of the distribution.

To install any software for e.g. koffice, open up the package manager of the OS (e.g. synaptic in Ubuntu; System>administration>synaptic), search for that package "koffice" or whatever your requirement e.g. "webcam" or "office suit" or "archive manager" etc...

The list of available software matching the criteria will be listed. You can then click and install. Certain 'packages' (called 'deb packages') will be downloaded and installed.

Unlike in the windows world packages are dynamically linked in most linux distributions (instead of statically linked), i.e you have 'dependencies' for installation of a software or installation of a software like koffice will require installation of other softwares which are called the dependencies of koffice. e.g. it will install qt4 (if it's not installed) or/and libkde etc... Thus there is a dependency tree formed. This dependency resolution is done automatically by the package manager.

One disadvantage of dynamic linking is that in some applications, it's startup time might reduce...to fix this problem, we have 'prelinking'...which you might like to do later on.

Also notice if you remove a package, it's dependencies will not be removed automatically (atleast in Gentoo and Ubuntu), you have to run -

apt-get autoclean

To remove them.

You can even add more repositories to expand the long default sofware list of Ubuntu.
 
  • #6
well, thanks for the answers, i think i get it.

just one more thing, say i wanted to download a hypothetically huge package and i downloaded it via torrent or something. how would i install that?
 
  • #7
It depends
If it's a package (deb/rpm etc) then the package manager for your distribution will install it - just double click on the file and it will run the installer
If it's source code (eg comes as a .tgz) then unzip it into a directory and read the instructions - probably run 'configure' then 'make' then 'make install'

If it's a commercial package (downloaded with torrent) it is probably just an executable that runs it's own installation script. Unzip the .tgz and read the instructions
 
  • #8
For more information, source codes are also .tar.bz and .tar.bz2.

In ubuntu in can double click and install though 'gdebi'...which is also a mini package manager (which I find of no use).

The executable (that you might get after decompressing (if it's compressed i.e) can have the following extensions -
.bin
.run
.sh
 
  • #9
oh.
well, many thanks for now, i'll return when i run into problems again :)
and
thanks again.
 

What is Linux?

Linux is an open-source operating system that was first introduced in 1991 by Linus Torvalds. It is designed to be free, customizable, and highly reliable.

What are software packages in Linux?

Software packages in Linux are collections of pre-compiled software that can be easily installed, managed, and updated on a Linux system. They often include necessary libraries and dependencies for the software to run properly.

How do I install software packages in Linux?

To install software packages in Linux, you can use a package manager such as APT, YUM, or Zypper depending on your distribution. These package managers allow you to search for, install, and update software packages from trusted repositories.

Are all software packages compatible with all versions of Linux?

No, not all software packages are compatible with all versions of Linux. Some packages may be specifically designed for a certain distribution or version. It is important to check the compatibility before installing a software package.

Can I create my own software packages for Linux?

Yes, you can create your own software packages for Linux. There are tools available such as RPM or DEB that help with the creation and management of packages. However, it is important to follow the guidelines and standards set by the Linux distribution you are using.

Similar threads

  • Computing and Technology
Replies
18
Views
1K
  • Computing and Technology
Replies
2
Views
1K
Replies
10
Views
2K
  • Computing and Technology
Replies
4
Views
4K
Replies
6
Views
1K
  • Computing and Technology
Replies
12
Views
5K
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • Computing and Technology
Replies
5
Views
2K
  • Programming and Computer Science
Replies
2
Views
2K
Back
Top