Homebrew / homebrew-cask

🍻 A CLI workflow for the administration of macOS applications distributed as binaries
https://brew.sh
BSD 2-Clause "Simplified" License
20.72k stars 10.61k forks source link

Better instructions for: Cask xxx is unavailable: No Cask with this name exists. #71221

Open muescha opened 4 years ago

muescha commented 4 years ago

Description of feature/enhancement

what i do:

what i see:

brew cask outdated
Error: Cask 'betterzipql' is unavailable: No Cask with this name exists. 

(all?) brew commands fail now

what i expected

Justification

sometimes there is an cask deleted, and always people start to file an issue about this and they have no clue how to resolve this breaking the workflow

Example use case

betterzipql is removed and now i get the error messages above and can not use the brew command anymore

muescha commented 4 years ago

is this issue the right place here or should it go to the homebrew core repo?

muescha commented 4 years ago

similar issues:

jacksun111 commented 4 years ago

when i do brew cask install iterm2 the same issues has

geekhch commented 4 years ago

me,too. Cask 'android-platform-tools' is unavailable: No Cask with this name exists.

vitorgalvao commented 4 years ago

Please avoid “me too” posts. We’re already aware this is a problem; replies stating “this also happens to me” without extra information don’t bring us closer to a resolution.

hackroid commented 4 years ago

Suggest executing brew untap $xxx$ && brew tap $xxx$, where $xxx$ can represent any taps you have trouble with, like homebrew/cask.

nijikon commented 3 years ago

I was able to fix my issue by removing directories from /usr/local/Caskroom.

schlomo commented 3 years ago

The last comment helped: Remove the cask from /usr/local/Caskroom. It would be nice if the error message could suggest this as a remedy. Or if the code could handle the case of removed casks better.

vitorgalvao commented 3 years ago

It would be nice if the error message could suggest this as a remedy.

There are multiple problems caused by the same underlying issue; adding workaround messages to all of them is a bad solution.

Or if the code could handle the case of removed casks better.

That’s the point of an open issue, to track the problem so it’s eventually fixed. PRs are welcome.

PeterLi commented 3 years ago

The last comment helped: Remove the cask from /usr/local/Caskroom. It would be nice if the error message could suggest this as a remedy. Or if the code could handle the case of removed casks better.

This helped me. I believe this issue is triggered when updating the OS and the item is no longer compatible with the OS and is moved out of the folder it was originally residing in. This was the case for the betterzipql and another item I had when updating to BigSur recently.

telamonian commented 3 years ago

For me it started with a brew update about a week ago. First, I was getting

Error: Cask 'font-dejavu-sans' is unavailable: No Cask with this name exists.

and I was unable to run any brew commands, including brew doctor. The suggestion of manually removing font-dejavu-sans from /usr/local/Caskroom is the only thing that seems to have done anything, and appears to have fixed that issue.

However, then things got zanier:

Error: Cask 'java' definition is invalid: Token '{:v1=>"java"}' in header line does not match the file name.

Again, removing the java cask fixed the issue. I hope simply rm-ing a couple of casks won't cause further knock-on problems?

vitorgalvao commented 3 years ago

I hope simply rm-ing a couple of casks won't cause further knock-on problems?

It won’t (shouldn’t).