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.

Running Ubuntu 12.04 64 Bit edition [ and Loving it :D]

I mostly update through Terminal using sudo apt-get update && sudo apt-get upgrade

I couldn’t understand this ,

That, having Firefox or any other such integrated Application Actively running along with update process running concurrently in terminal, which is updating firefox to newer version . I am aware that that restarting firefox will be opened with newer version or rather any other application for that matter.

My Question is ,

For Example-Updating in MS Windows 7 , it asks for closing the Active Instance of same application (if active) for updating.

[ I am not Comparing the OS's]

How does Ubuntu replaces the active working application to newer version without interfering with its active Instance. [Noticed for many Packages]

What exactly does happen at the Back-end of Updating process in such matter.

P.S. - Couldn't resist the temptation , so atlast i asked it (could be a stupid question though) :D

share|improve this question

1 Answer 1

up vote 4 down vote accepted

For Example-Updating in MS Windows 7 , it asks for closing the Active Instance of same application (if active) for updating.

How does Ubuntu replaces the active working application to newer version without interfering with its active Instance. [Noticed for many Packages]

I'll try to explain this as simply as possible. Most Linux filesystems are slightly different from Windows' filesystems (NTFS). At their core, both essentially contain an index table of file names (entries) pointing to the actual data stored on the disk. In NTFS this is called the MFT (master file table) -- you may have seen that name scroll by if you run a chkdsk.

However, the "slight difference" I mentioned is that Linux's index tables, if you will, consists of two levels: the index, and inodes. The inodes contain the actual file metadata, including its physical location on disk; the "file name" in the index is simply a (hard) link to the inode.

When you update/upgrade a running application, the updated files are written to disk, inodes pointing to the new data created/updated, and the file names are also updated to link to these new inodes. But, for any files that already in use by a running application (i.e. file handles exist), their file names will continue to point to the old inodes (which contain the old data) until the file handles are closed. This usually happens when you exit the application, or for some system files, when you reboot. At this point, the old data is actually removed from your disk.

share|improve this answer

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.