[mythtv-users] noob question about apt/rpm

Aran Cox spin at avalon.net
Sat Oct 25 14:56:18 EDT 2003


On Sat, 2003-10-25 at 06:50, Jason White wrote:
> If a file is currently in use and you use apt or rpm to update a
> package that needs to touch that file, how is it handled?  I know that
> on Windows machines the file can’t be overwritten so it gets queued up
> to be overwritten on reboot.  On Linux I’m just not sure.
> 

The upgrade is completed, but your kernel will still have the old ivtv
module loaded.  Also, if you upgrade libraries all currently running
programs will have the old versions open.  When you restart the
applications they will begin using the newly installed versions.  In
general it's easiest to reboot after an upgrade involving
libraries/kernel modules, etc.  but you can just shut down all the
applications and rmmod the modules that were updated.  

If you want to why it works like that:  Essentially linux (and unix in
general) maintains a count of the number of references to a file.  The
file exists on that filesystem until there are no more references. 
Being in a directory counts as a reference.  If the file is opened by
one or more programs then it has one or more additional references to
that file.  So when you run rpm it removes the file from the directory
before installing the new one, but if other programs have the file open
it still exists on disk you just can't see it any more even if another
file with the same name has taken it's place.  As soon as the last
program closes the file it ceases to exist leaving only the new one to
be opened by programs.  

Aran




More information about the mythtv-users mailing list