dockutil icon indicating copy to clipboard operation
dockutil copied to clipboard

Not working on macOS 12.3 - need to upgrade Homebrew version from 2 to 3

Open Mellbourn opened this issue 2 years ago • 9 comments

Could you please update the homebrew installation so that it installs version 3 instead of 2?

Version 2 doesn't even work on standard macOS Monterey 12.3 anymore, since python 2 has been removed.

> dockutil
zsh: /opt/homebrew/bin/dockutil: bad interpreter: /usr/bin/python: no such file or directory

Thanks for a great tool!

Mellbourn avatar Mar 15 '22 18:03 Mellbourn

I get the same error, also use homebrew for installation, and would appreciate a fix (thanks @Mellbourn). Doubling down on the thanks for making a great tool! ❤️

Screen Shot 2022-03-23 at 4 09 03 PM

karnaker avatar Mar 23 '22 20:03 karnaker

@Mellbourn and @karnaker that's actually the wrong place for this issue I think. As it is a homebrew issue and not a dockutil issue. That beeing said, I may bring some light into the darkness:

There was once a pull request on homebrew-core for this: https://github.com/Homebrew/homebrew-core/pull/96391. But it wouldn't build.

Fast forward, someone else opened a new PR for this: https://github.com/Homebrew/homebrew-core/pull/97394 There's a discussion in this PR about the build issue. As fas as I understood (I'm not a developer) situation is this: To be a formulae, the software must be able to be built from source. Which does not work for this software withe the current tools available in Homebrew. If this can not be fixed, the dockutil formulae must be removed and replaced by a cask. As casks can be binaries.

There's also already a corresponding issue over here: https://github.com/kcrawford/dockutil/issues/122. Still not being a developer, I understand from there that @sashkab has an idea for a solution for which he is awaiting a basic approval from @kcrawford prior to do all the work needed.

That being said, I see chances that eventually dockutil version 3.x will be available in Homebrew.

Meanwhile, if you need to have it installed and want to do it in a automated manner, something like this would be possible:

brew install jq
DLURL=$(curl --silent "https://api.github.com/repos/kcrawford/dockutil/releases/latest" | jq -r .assets[].browser_download_url | grep pkg)
curl -sL ${DLURL} -o /tmp/dockutil.pkg
sudo installer -pkg "/tmp/dockutil.pkg" -target /
rm /tmp/dockutil.pkg

tuxpeople avatar Apr 01 '22 14:04 tuxpeople

Meanwhile, if you need to have it installed and want to do it in a automated manner, something like this would be possible:

brew install jq
DLURL=$(curl --silent "https://api.github.com/repos/kcrawford/dockutil/releases/latest" | jq -r .assets[].browser_download_url | grep pkg)
curl -sL ${DLURL} -o /tmp/dockutil.pkg
sudo installer -pkg "/tmp/dockutil.pkg" -target /
rm /tmp/dockutil.pkg

@tuxpeople thanks so much for posting this! Ran into this issue and your snippets worked great (clean install of macOS Monterey 12.3).

shawndwells avatar Apr 02 '22 00:04 shawndwells

I've made temporary solution to get 3.0.2 version with brew:

$ brew tap lotyp/homebrew-formulae
$ brew install lotyp/formulae/dockutil
$ dockutil --version
3.0.2

But as it is *.pkg file with bin inside, probably by now it should be cask, or changes should be made in brew official formluae/cask

https://github.com/lotyp/homebrew-formulae

lotyp avatar Apr 12 '22 16:04 lotyp

For zsh, you need quotes here ... jq -r '.assets[].browser_download_url' .... Becomes

brew install jq
DLURL=$(curl --silent "https://api.github.com/repos/kcrawford/dockutil/releases/latest" | jq -r '.assets[].browser_download_url' | grep pkg)
curl -sL ${DLURL} -o /tmp/dockutil.pkg
sudo installer -pkg "/tmp/dockutil.pkg" -target /
rm /tmp/dockutil.pkg

brianephraim avatar May 05 '22 15:05 brianephraim

If anyone is willing to use a temporary solution, I've created a cask to use the new version here.

$ brew install --cask hpedrorodrigues/tools/dockutil

However, I'll deprecate it once an official cask is released.

hpedrorodrigues avatar May 05 '22 15:05 hpedrorodrigues

As happy as I am that there are a few community provided temporary solutions, this still needs to be fixed. Anyone actively working on this?

boldandbrad avatar Jul 19 '22 18:07 boldandbrad

Hello, AFAIK autor does not support Hombrew formula of dockutil. If you want to add support you can do it on your own, please see https://docs.brew.sh/Adding-Software-to-Homebrew

ferben avatar Jul 20 '22 06:07 ferben

I use a similar method to @tuxpeople 's method, but it doesn't depend on jq or homebrew at all:

pkg_name=$(curl -s https://api.github.com/repos/kcrawford/dockutil/releases/latest | grep "dockutil-.*\.pkg\"" \
     | head -1| cut -d : -f 2,3 | tr -d \" | tr -d ,| xargs )
source="https://github.com/kcrawford/dockutil/releases/latest/download/${pkg_name}"
tempPath=$(mktemp -t "dockutil.XXXXXXXXX")
curl -L --max-redirs 5 -sS "$source" -o "$tempPath"

etc

nighthawk663 avatar Jul 20 '22 13:07 nighthawk663

With the 3.1.0 release, I think homebrew formula maintainers should have what they need now to update the formula.

kcrawford avatar Dec 30 '23 20:12 kcrawford

This is great! Just a piece of advice for others who may also be as confused as I was:

If you have the old dockutil cask installed from hpedrorodrigues/tools/dockutil then:

You should first uninstall the old dockutil cask, explicitly:

brew uninstall --cask dockutil

then you can install the formula

brew install dockutil

If you do not uninstall the cask, the cask may be found instead of the formula when running on the command line.

Mellbourn avatar Dec 30 '23 22:12 Mellbourn