[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: apt-get to upgrade from hamm to slink.



On Wed, 19 Jan 2000, Ben Messinger wrote:

> This happened to me, and apt did resume and finish - but the package
> that it was getting when the ppp link was severed got corrupted (or
> incomplete download). All other packages were ok, but this was the cause
> of much sorrow when the corrupt package disabled the package system
> until it was removed by hand and reference to it removed from the
> package database. If you use a static ip this probably won't happen to
> you, but if you use dynamic ip, beware.

Were you using ftp or http at the time? APT does carefully check the md5
of every file before accepting it, it is not possible for it to invoke
dpkg on a file that has the wrong size -- and in theory it should not
happen that dpkg is invoked on a file with a bad md5 but if there is disk
corruption or something it could happen.

I am almost totally certain that this is true for HTTP and I am mostly
certain that it is true for FTP, but either could have a bug :>

How apt works is it downloads all files into a partial/ directory, files
in that directory are never used by dpkg. When a download is complete the
md5 that was generated by the download method [md5 hashing is done on the
fly as the file is written to disk] is compared against what the package
file claims and the size is checked as well. When those both match the
file is moved from partial/ to .. and is now considered 'ok'. After this
the only thing that is checked is that the file has the correct size. 

Aborted downloads and corrupted downloads are all handled neatly by the
partial directory in a nice fast manner.

Someday I will add an option to md5 every file before invoking dpkg but
not right now :>

Jason


Reply to: