An older version of a cookbook installed a package that I no longer want on my systems. My understanding is that chef doesn't have a straightforward way to explicitly remove a package, so I resorted to the blunt hammer of
execute "Remove nasty perl gearman-server" do command "apt-get -y remove gearman-server" ignore_failure true end
But this fails, I'm guessing because chef itself has the lock on dpkg?
STDERR: E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable) E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
How can I programmatically ensure that this package is no longer on my machines? If it's not clear, I'm totally happy with an ubuntu-only solution.