Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a bug of check_installed on Debian squeeze. #138

merged 1 commit into from Jun 7, 2013


Copy link

@ryotarai ryotarai commented Jun 7, 2013

On debian squeeze, dpkg -s <purged package name> returns 0 as exit code.

For example:

vagrant@debian-squeeze:~$ cat /etc/debian_version
vagrant@debian-squeeze:~$ dpkg -s git
Package `git' is not installed and no info is available.
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.
vagrant@debian-squeeze:~$ echo $?
vagrant@debian-squeeze:~$ sudo apt-get install git
# abbr.
vagrant@debian-squeeze:~$ dpkg -s git
# abbr.
vagrant@debian-squeeze:~$ echo $?
vagrant@debian-squeeze:~$ sudo apt-get purge git
# abbr.
vagrant@debian-squeeze:~$ dpkg -s git
Package: git
Status: unknown ok not-installed
Priority: optional
Section: vcs
vagrant@debian-squeeze:~$ echo $?

Because of this problem, I use dpkg -s <package> && ! dpkg -s <package> | grep -E '^Status: .+ not-installed$' instead of dpkg -s <package>

I tested this command on Ubuntu (Precise) and Debian (Squeeze).
Test log is here:

mizzy added a commit that referenced this issue Jun 7, 2013
Fix a bug of check_installed on Debian squeeze.
@mizzy mizzy merged commit 1f86918 into mizzy:master Jun 7, 2013
1 check passed
Copy link

@mizzy mizzy commented Jun 7, 2013


@ryotarai ryotarai deleted the fix-debian-check_installed branch Jun 8, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet
2 participants