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

Re: is dpkg install atomic?



On Tue, Oct 26, 2021 at 10:31:54AM -0700, Han wrote:
> Hi,
> 
> This might be a dumb question:  is dpkg installing (or updating) a package
> using a .deb file atomic in the event of power outage?
> 
> By atomic, I meant either the new version of the application is fully
> installed, or not at all.  Is this always guaranteed?

No.  A package can be in a "half-installed" state.

unicorn:~$ dpkg -l | head -n3
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)

See where it says "Half-inst" in the middle?  If an "H" is shown in
that column, the package is half-installed.

Also, the post-install scripts that most packages use are shell scripts,
so you already know a priori that the script could be interrupted
partway through.


Reply to: