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

Re: How to check that if a package is installed?

On Ma, 30 nov 10, 16:28:12, Bob Proulx wrote:
> If you decide you should use dpkg directly to query for the existence
> of the package then it is better to use dpkg --status.  Sorry but that
> awk piped to awk pipeline isn't particularly attractive.
> if ! dpkg --status tofrodos | grep -q "^Status: install ok installed$"; then
>   echo "Error: Missing package: tofrodos"
>   echo "You could install it with: apt-get install tofrodos"
> fi

You don't even need the 

'dpkg -l' is fine as well, if used properly ;)

$ dpkg -l tofrodos
No packages found matching tofrodos.

Offtopic discussions among Debian users and developers:

Attachment: signature.asc
Description: Digital signature

Reply to: