Description
Verification
- I understand that if I ignore these instructions, my issue may be closed without review.
- I have retried my command with
--force
. - I ran
brew update-reset && brew update
and retried my command. - I ran
brew doctor
, fixed as many issues as possible and retried my command. - I have checked the instructions for reporting bugs.
- I made doubly sure this is not a checksum does not match / SHA256 mismatch error (do not open an issue before trying to open a PR to fix first).
Description of issue
I'd like to re-raise #49127 and other tickets filed for this. I believe the original justification given doesn't address the problems that pinning would solve. Therefore, the topic requires a reconsideration.
A huge chunk of casks auto-update and we can’t stop that. So pin would at best be inconsistent and not work in a lot of cases.
If you do a search you’ll see we’ve discussed this in the past, especially in the upgrade issues on brew’s repository.
Argument 1: a counter-argument to "pin would at best be inconsistent and not work in a lot of cases"
Casks with auto_updates
are effectively pinned. brew upgrade
will not update them, unless --greedy-auto-updates
is passed. They may be upgraded externally by the application itself, and Homebrew won't know the actual version installed over time or what files were modified...
...so how is this different from an explicit pin on the package? auto_updates
and latest
markers are pins. Permanent ones that prevent them from being upgraded on brew upgrade
- but still pins. They just can't be arbitrarily removed or added by the user to achieve their own goals.
Argument 2: auto-update feature is often optional, let brew do it
Out of all my auto_updates
casks listed with brew info --json=v2 --installed --casks | jq -r '.casks[] | select(.auto_updates) | .token'
, most have optional auto-updates:
- Check optional: iterm2, menumeters, nextcloud, orbstack, teamviewer, visual-studio-code, vlc, wireshark, witch
- Check mandatory but update optional: firefox, imageoptim, macfuse, pika, sublime-text, xee, spectacle
- Check and update mandatory: adobe-acrobat-reader, discord, dropbox, google-chrome, onedrive, signal
How do I update all packages except these listed in "Check and update mandatory" category, without this kind of trickery? brew upgrade --cask --greedy-auto-updates $(brew info --json=v2 --installed --casks | jq -r '.casks[] | select(.auto_updates) | .token' | grep -vE '^(adobe-acrobat-reader|discord|dropbox|onedrive|signal)$')
There is absolutely nothing wrong about brew pin adobe-acrobat-reader discord dropbox google-chrome onedrive signal
so we can brew update --greedy-auto-updates
and get everything up-to-date except the ones we pinned.
Argument 3: the fundamental issue
All package manager in existence - except pkgin/pksrc and Homebrew (for casks) - allow their users to "upgrade all except these":
pacman -Syu --ignore <pkg1>,<pkg2>
apt-mark hold <pkg1> <pkg2>; apt upgrade; apt-mark unhold <pkg1> <pkg2>
dnf upgrade --refresh --exclude=<pkg1>,<pkg2>
- or
dnf versionlock add <pkg1> <pkg2>; dnf upgrade --refresh; dnf versionlock delete <pkg1> <pkg2>
- or
yum update --exclude=<pkg1>,<pkg2>
- or
yum versionlock add <pkg1>-* <pkg2>-*; yum update; yum versionlock delete <pkg1>-* <pkg2>-*
- or
zypper up --exclude <pkg1>,<pkg2>
- or
zypper addlock <pkg>; zypper up; zypper removelock <pkg>
- or
emerge -avuD --exclude <pkg1>,<pkg2> @world
- or add
=<pkg>-*
to/etc/portage/package.mask
- or add
choco upgrade all --except=<pkg1>,<pkg2>
- or
choco pin add -n=<pkg>; choco upgrade all; choco pin remove -n=<pkg>
- or
winget pin add --id <PackageID>; winget upgrade --all; winget pin remove --id <PackageID>
scoop hold <pkg1> <pkg2>; scoop update *; scoop unhold <pkg1> <pkg2>
port upgrade outdated and not <port>
brew pin something; brew upgrade; brew unpin something
- (except for casks)
Why would one want to "upgrade all except these"? Every user has their own reasons. For me:
- I do it to skip large packages when my download speed is limited at that time. I tend to run
pacman -Syu --ignore libreoffice-fresh,signal
quite a bit. - There are certain packages that I update myself. On Arch, I never update
linux
andlinux-lts
packages at the same time.linux-lts
stays inIgnorePkg
(it's pinned). - For Homebrew specifically, I'd like to execute
brew update --greedy-auto-updates
and get everything upgraded except for those that perform mandatory updates. Whether that's via a permanent pinbrew pin signal; brew update --greedy-auto-updates
, or a one-time exclusionbrew update --greedy-auto-updates --ignore pkg1,pkg2
, it's all good. - ...But most importantly: why not? All other package manager do it, and there must be many good reasons why.
Argument 4: by popular vote
Users have been requesting it all the time:
- Brew pin not working for the vmware-fusion cask #150045 by @edpichler
brew pin
for casks #100700 by @alexregbrew upgrade
fails forever when installed casks become uninstallable #97285 by @nopdotcom- Add "brew cask pin" and "brew cask unpin" commands #90242 by @ericbn
- Allow pinning casks #49127 by @boobaa
- Allow pinning casks brew#12425 by @rafalkrupinski
- Allow pinning for casks brew#11860 by @cglong
- Add an ability to pin casks brew#4898 by @ondrejfuhrer
Users simply want this feature.
Thank you in advance for reconsidering this.
Command that failed
brew pin nextcloud
Output of command with --verbose --debug
nowaker@nwkr-m1pro ~ % brew pin nextcloud --verbose --debug
/opt/homebrew/Library/Homebrew/brew.rb (Formulary::NullLoader): loading nextcloud
/opt/homebrew/Library/Homebrew/brew.rb (Formulary::NullLoader): loading nextcloud
Error: No available formula with the name "nextcloud".
/opt/homebrew/Library/Homebrew/formulary.rb:826:in 'Formulary::NullLoader#get_formula'
/opt/homebrew/Library/Homebrew/formulary.rb:931:in 'Formulary.factory'
...not relevant
Output of brew doctor
and brew config
irrelevant
Output of brew tap
homebrew/cask-versions
homebrew/services