Packages built in both Ubuntu and Debian packages lack behind, therefore, to get the latest version of jq, build from source.
There are a few prerequisites to install:
Both GCC and Make are usually installed if you do development, but not Autotools. Luckily, this is easy to fulfill:
Install from source:
The installed path is at:
However, this gives me an unexpected tag:
I have no idea why there is
dirty suffix, did a quick search, saw the same tag referenced in this issue: https://github.com/stedolan/jq/issues/916, but yet to have answer for it. I might be using the wrong commit, but instead of searching and figuring out why, sometimes it’s easier to take the different road, if your goal is not to debug. So, went ahead and just downloaded the tarball:
Now it looks to be something I want:
Try an example:
So far so good. For more information, see https://stedolan.github.io/jq/download/.