Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Linux: software packages

  1. Feb 7, 2010 #1
    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.
     
  2. jcsd
  3. Feb 7, 2010 #2

    mgb_phys

    User Avatar
    Science Advisor
    Homework Helper

    There are different packaging mechanisms for different distributions (.deb, .rpm etc) but most distributions can handle all types

    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.

    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.

    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.

    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.
     
  4. Feb 7, 2010 #3
    You also use "apt-get install ___" to have software pulled automatically from repositories (free app store) and installed.
     
  5. Feb 7, 2010 #4
    If you're installing from the source code, there's also usually a README or INSTALL text file with full installation instructions.

    Unless you're using redhat/fedora, where you use "yum install".
     
  6. Feb 7, 2010 #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.
     
  7. Feb 8, 2010 #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?
     
  8. Feb 8, 2010 #7

    mgb_phys

    User Avatar
    Science Advisor
    Homework Helper

    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
     
  9. Feb 8, 2010 #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
     
  10. Feb 8, 2010 #9
    oh.
    well, many thanks for now, i'll return when i run into problems again :)
    and
    thanks again.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Linux: software packages
  1. Highlighting in linux (Replies: 4)

  2. Linux or Windows? (Replies: 54)

  3. Linux in Physics (Replies: 4)

Loading...