Re: Always run dpkg --dry-run -i before running dpkg -i!
On Fri, Jan 07, 2005 at 11:22:43AM +0000, Colin Watson wrote:
> On Thu, Jan 06, 2005 at 04:58:56PM -0500, William Ballard wrote:
> > Given that -source packages do not adequately specify the dependencies
> > to be able to use the output, one must NEVER run "dpkg -i" a given deb
> > without first running "dpkg --dry-run -i" on the same debs and verifying
> > that it returns a zero exit code.
> Are you aware that dpkg --dry-run -i unpacks the new package before
> checking that the package can be configured (i.e. it's equivalent to
> dpkg --dry-run --unpack; dpkg --dry-run --configure), so your "solution"
> is at best a no-op? See bug #183470.
> In fact, your approach is worse because --no-act doesn't even report
> dependency problems encountered in the configure step, nor exit non-zero
> when it encounters them. See bug #55364. It's much more efficient for
> users to keep the old .debs around and simply use dpkg -i, which will
> exit non-zero on errors and allow you to put the old .deb back.
> Seems clear that you didn't try this before recommending it ...
Actually, I take some of that back; dpkg --no-act -i apparently does
check dependencies well enough now. However, it doesn't report errors
usefully either in its output or in its exit code, so it's only useful
if you're familiar with it and are paying a lot of attention:
$ sudo dpkg --no-act -i kdepim_3.3.1-3_all.deb
Selecting previously deselected package kdepim.
(Reading database ... 119331 files and directories currently installed.)
Unpacking kdepim (from kdepim_3.3.1-3_all.deb) ...
$ echo $?
$ dpkg -l kdepim
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name Version Description
pn kdepim <none> (no description available)
$ dpkg -L kdepim
Package `kdepim' is not installed.
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.
Colin Watson [email@example.com]