Quickly extracting a downloaded .deb file in UbuntuCore

When developing on top of an UbuntuCore system I sometimes need to quickly grab a binary from a deb package, installing the classic environment snap is often overkill here.

While you can easily download a deb from the ubuntu archive server using the mget snap (kudos to @weaming for not making this a classic snap (which would not be installable on Core)), unpacking the .deb file is impossible.

To overcome this I snapped up a patched version of dpkg with a little wrapper tool that calls dpkg -x to extract the .deb in your home dir.

$ snap install extract-deb
$ snap connect extract-deb:home
$ extract-deb foobar_1.2.3-1_armhf.deb foobar