Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
2  
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
add comment

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.

2 Answers

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:

http://windowspackager.org/documentation/implementation-details/scripts-and-processes

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

http://www.debian.org/doc/debian-policy/

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

share|improve this answer
add comment

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) http://www.debian.org/doc/manuals/debian-reference/ch02.en.html#_the_event_flow_of_the_package_management 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
add comment

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