Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am interested in knowing how software update works (technically). What all are the components that checks, downloads and installs new update and how do they work.

share|improve this question

closed as too broad by Anwar Shah, Eric Carvalho, Braiam, chronitis, psusi Oct 14 '13 at 13:42

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.If this question can be reworded to fit the rules in the help center, please edit the question.

Take a look at SoftwareUpdates – Mitch Oct 12 '13 at 8:22
I fear, your question is too broad for question answer site like this. it is discussion type question – Anwar Shah Oct 12 '13 at 10:00
up vote 0 down vote accepted

That's something for a complete 600 pages book! 8-) More or less, someone gets a software project, compiles it and creates a package and stores it in a repository.

Packages receive a version so the system can recognize older and newer versions.

The package system on your computer can access the repository and see whether new versions of packages that are installed on your computer have available. If so, it offers you the possibility to upgrade.

There is a lot more to it than just that. For example, when upgrading a server you want to stop the server, do the upgrade, then restart the server. These steps are accomplished by pre and post scripts as described on this page:

Another important point, different packages may not be compatible between each others. For example, if you install Postfix you cannot also install sendmail because both offer the same functionality (although there are ways to offer both software via the alternative links.) Similarly, installing Apache and httplight would generally be in conflict because both use port 80 by default. Again, you can fix the conflict by tweaking the settings of each server, but by default the operating system is likely going to tell you that you cannot do that.

You may want to read about the Debian Policy Manual

as it gives you quite a bit of information in that regard.

share|improve this answer

Ubuntu uses apt under the hood for doing package management which provides and interface to dpkg for the actually installation, updates and removal of packages.

From Debian (as ubuntu as a Debian derivative) the flow is:

  • Update
    1. Fetch archive metadata from remote archive
    2. Reconstruct and update local metadata for use by APT
  • Upgrade
    1. Chose candidate version which is usually the latest available version for all installed packages
    2. Make package dependency resolution
    3. Fetch selected binary packages from remote archive if candidate version is different from installed version
    4. Unpack fetched binary packages
    5. Run preinst script
    6. Install binary files
    7. Run postinst script

Further reading

For info on dpkg and apt:

For info on pre and post scripts:

share|improve this answer

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