Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Apologies in advance if this is off-topic.

When I want to install an app in, say, Ubuntu, I go to terminal and type something that indicates I want that app to be installed.

What I don't do is type the exact location I want it to be installed from.

This is quite different than, say, GUI based Windows or OS X, where one would use a browser to navigate to some page on the WWW, download a large package, and then double click it to install it.

My Questions:

  1. Where do the linux apps come from?
  2. Who ensures that those repositories have not been corrupted with malware?
  3. I'm presuming that there are multiple repositories. And if so, how does my linux PC decide which repository to download a package from?
  4. Do different distros all have the same repository, or different?
  5. If I'm using some full-featured latest release of Ubuntu, versus if I'm a light-weight version such as Puppy Linux, and I type the same exact command into terminal to install some app, will I be installing the same app in both cases, or different? How is all of this handled so that the wrong version doesn't get installed in the wrong place?
share|improve this question
add comment

2 Answers

Lots of questions. A lot of these questions are deep. And I could only summarize.

You begining question: What I don't do is type the exact location I want it to be installed from. The package manager knows where and how to install the programs. This is required for the manager to know what is installed, and to keep the system clean. Linux uses the philosophy of one program should perform one task, and perform it well. When you install a program in Linux, the manager looks for what is required and installs the packages for you.

  1. Where do the linux apps come from? Most of the binaries come from the repositories. Some you build yourself from the source code.

  2. Who ensures that those repositories have not been corrupted with malware? The packages are signed by GPG private keys. This prevents anyone who is not the developer from publishing code under the same name. So the defender of the repositories are cryptography through mathematics. But in reality you need to trust the repositories. Don't add random repositories. Using Ubuntu repositories are safe because you know who manages them.

  3. I'm presuming that there are multiple repositories. And if so, how does my linux PC decide which repository to download a package from? The maintainer of the Linux distro decides what respitory to use. With Ubuntu, each version gets a repository.

  4. Do different distros all have the same repository, or different? Different. There are many different Distros, Ubuntu uses the Ubuntu/Debian repositories, Red Hat uses their own. Just depends on the Distro

  5. If I'm using some full-featured latest release of Ubuntu, versus if I'm a light-weight version such as Puppy Linux, and I type the same exact command into terminal to install some app, will I be installing the same app in both cases, or different? Each Distro uses a different way to access the repositories. For Ubuntu this is apt-get but on Red Hat this is yum. Some Distros have a slightly different file structure and way of doing things. For example, Debian mother of Ubuntu, uses a comply different email agent than Ubuntu. One package manager will not work on all Linux Distros. Nor do we want this. A monopoly is bad for security and the freedoms that Linux brings.

  6. How is all of this handled so that the wrong version doesn't get installed in the wrong place? The package manager records all install software. But sometimes this doesn't workout (you might install from source), therefore, it really is the user that handles any issues.

share|improve this answer
add comment
  1. Depends what exactly you are asking. You get them from the repositories. The repositories get binary (we're not counting Gentoo here) packages compiled by someone who is the maintainer of the package, or a bot which does it automatically. This only applies to open source software (software with code publicly available and legally distributable). And the source code comes from developers, which either upload a tarball to their website or a source hosting site such as SourceForge or Github. Seeing that you are a beginner, DO NOT download and compile packages yourself.

  2. As Linus said "given enough eyeballs, all bugs are shallow" (Linus's Law). This also applies to malicious software. ANYONE (yes, even you) can review code of packages, check md5sums, GPG keys etc. to ensure software does not contains code that may harm you. The package maintainers (the guys who put source code from the internet and package it into the repos) are responsible for the package. Malware however is MUCH less detectable in closed source software cough Skype cough. If you are the paranoid type, avoid closed source software.

  3. If you use a Linux distribution, it most likely has it's own repository already configured (like Ubuntu). Multiple repositories can be stored on a single host, such as multiverse, universe, restricted etc. The different repositories on the same host have different packages so there are no clashes. This is why third-party repositories may be a problem.

  4. Some distros which are based off OTHER distros (common in the Linux world) may use their own repositories for core packages only they use, but get the packages the user wants from the distro they are based off. A great example is Linux Mint. Linux Mint has a very small load on their servers and only has core packages by the Mint team. However if you want to install a random package (like SuperTuxKart), Mint fetches it from the Ubuntu repos. The package cache is synced every now and then so your computer knows what packages are where.

  5. You may or may not be using the same command. The command varies depending what package manager a distro uses. Debian, Ubuntu etc. use APT and Red Hat, Fedora etc. use YUM. If the package is named the same, you will most likely (only in rare situations not) get the same package. However, you will most likely get a different version. This again depends which repository your distro uses. Outdated and/or stable repos get old software, bleeding edge/new repos get the latest version.

The package manager handles all the packages and insures everything is in the right place.

I suggest you read up on some Man pages ;)

Welcome to the Linux world!

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.