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

Re: How to find out if a package is installed?



Steve Greenland writes ("How to find out if a package is installed?"):
> I'm trying to work out how to upgrade an existing installation
> of cern-httpd to use the new names. Before I blow away the existing
> /usr/sbin/httpd, I need to determine if it's cern's, apache's, or
> (possibly), somebody else's. Since cern and apache conflict, it
> should be one or the other's. What's the best way to do this?
> 
> 1) apache has /etc/httpd as a directory, while with cern (rev 4),
>    it's a file. This seems to work, but doesn't solve the
>    general case.
> 
> 2) make dpkg tell me. I can grep the output from dpkg --status,
>    but that seems cludgy.

Yes, do that.  dpkg --list may also help you here.  dpkg --status is
not likely to change format dramatically.

> 3) Look for /var/lib/dpkg/info/{pkg}.list. I have no idea if
>    this is reliable, but I really hate to muck around in other
>    packages property.

This is unsupported and likely to change in the future.  Don't mess
about with things in /var/lib/dpkg, or at least not without asking me
first :-).

Ian.


Reply to: