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

Re: problem searching packages



Hello and welcome Bernard!

On Thu, Feb 08, 2007 at 11:49:55PM +0100, Bernard wrote:
> [...]
> #apt-cache search hplip
> 
> lists a number of related packages that, I think, are supposed de operate
> together... but this does not tell me whether hplip is installed or not in
> my system. I think it is not installed, since
> [...]

This is because apt-cache search also includes package descriptions.
So every package containing "hplip" in its name and/or description
will be shown. This does not always mean, that the package is related.
It could also mean that one package is a drop in replacement. OK that
is a relation in the wider sense ;).

> [...]
> #man hplip
> 
> tells me that there is no manual entry for hplip.
> 
> In fact, hplip has been in turn installed, removed, re-installed and
> re-removed on my system, so it should not be there at this time, except if
> I got mixed up somewhere. I can't remember what hplip version I had, and I
> don't plan to reinstall blindly as I had done before.
> [...]

If the package is not installed then there is no man page.

> [...]
> #dpkg -I hplip
> 
> I get : dpkg-deb: unable to read the archive "hplip", no file or directory
> of this type.
> [...]

The option "-I" requests a filename not a package name. You can find
those files in /var/cache/apt/archives/. But read on, there are easier
ways to get the info you want. Also /var/cache/apt/archives will only
contain .deb's of packages that have already been downloaded for
installation.

> [...]
> My first question will be :
> 
> How to check whether hplip (or any other package) is installed on my
> system or not ?
> [...]

As often there are more than one ways to achieve this:

$ dpkg --status <package name> 
(note: here it has to be the package name and not the file name)

My prefered method is:

$ aptitude show <package name>

This gives you a list of all information reagarding the package: 
status, description, version number etc.

> [...]
> The second question : how to investigate what packages are installed in my
> system, with all informations (package name, version etc...)
> [...]

Opposed to some other replies I have to say that dpkg -l (or --list)
does *not* show installed packages only. It also shows you packages
which have already been removed but their respective configuration
remained. But one can filter those out:

$ dpkg -l | grep "^ii" | less

But this method lacks some informations you asked for.

Again my preference lies on aptitude:

$ aptitude show ~i | less


This will show the same list as the above "$ aptitude show <package name>"
for all installed packages.

If you like to use graphical tools, then you can use the interactive
mode of aptitude (aptitude called with no arguments) on the console,
or you can give Synaptic a try as it was already suggested.

Some useful documentation can be found here:

man 1 dpkg
man 8 aptitude
/usr/share/doc/aptitude/html/en/index.html (found in the package
aptitude-doc-en)


Regards
-- 
Marcus Blumhagen

"Any intelligent fool can make things bigger, more complex, and more
violent. It takes a touch of genius -- and a lot of courage -- to move
in the opposite direction."
                                                      -- Albert Einstein

Attachment: signature.asc
Description: Digital signature


Reply to: