Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install or upgrade any package #19339

Open
3 tasks done
lorenzo93 opened this issue Feb 19, 2025 · 5 comments
Open
3 tasks done

Unable to install or upgrade any package #19339

lorenzo93 opened this issue Feb 19, 2025 · 5 comments
Labels
bug Reproducible Homebrew/brew bug

Comments

@lorenzo93
Copy link

lorenzo93 commented Feb 19, 2025

brew doctor output

Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: Some installed formulae are deprecated or disabled.
You should find replacements for the following formulae:
  libassuan@2

Warning: /private/tmp is world-writable but does not have the sticky bit set.
To set it, run the following command:
  sudo chmod +t /private/tmp

Verification

  • My "brew doctor output" above says Your system is ready to brew. and am still able to reproduce my issue.
  • I ran brew update twice and am still able to reproduce my issue.
  • This issue's title and/or description do not reference a single formula e.g. brew install wget. If they do, open an issue at https://github.com/Homebrew/homebrew-core/issues/new/choose instead.

brew config output

HOMEBREW_VERSION: 4.4.21
ORIGIN: https://github.com/Homebrew/brew
HEAD: 2e57f8f794af60804dcc185d1807c6d6ca10418c
Last commit: 3 days ago
Branch: stable
Core tap JSON: 19 Feb 23:29 UTC
Core cask tap JSON: 19 Feb 23:29 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_EDITOR: code
HOMEBREW_MAKE_JOBS: 12
Homebrew Ruby: 3.3.7 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.7/bin/ruby
CPU: dodeca-core 64-bit arm_lobos
Clang: 16.0.0 build 1600
Git: 2.39.5 => /Library/Developer/CommandLineTools/usr/bin/git
Curl: 8.7.1 => /usr/bin/curl
macOS: 15.3.1-arm64
CLT: 16.2.0.0.1.1733547573
Xcode: N/A
Rosetta 2: false

What were you trying to do (and why)?

Hi,
I was trying to upgrade my packages with the brew upgrade command but keeps failing on the sqllite package.
Then I've tried to manually upgrade a specific package brew upgrade <package_name> and it kept failing. I very rapidly discover that I was unable to install nor upgrade anything.

What happened (include all command output)?

Each time I try to install or upgrade or reinstall a package I get the error

cp: chflags: /opt/homebrew/Cellar/wget: Operation not permitted

I've already tried:

  • to check for permission problems, by running sudo chown -R lollo:staff $(brew --prefix)/*where "lollo" is my username.
  • to do a brew cleanup
  • to reboot the Mac
  • to reinstall an already install package brew reinstall wget
  • to empty the /tmp and /private/tmp dirs
  • to disable SIP
  • to run again the brew setup (I have brew installed for almost a year now, just hoping that it would fix whatever strange permission problem I'm having)

The error is always the same:

==> Downloading https://ghcr.io/v2/homebrew/core/wget/manifests/1.25.0
################################################################################################################################################################################### 100.0%
==> Fetching wget
==> Downloading https://ghcr.io/v2/homebrew/core/wget/blobs/sha256:a93dd95c5d63036e026b526e000d33fae7fb44d9a8fda5afc89bff112438c6b3
################################################################################################################################################################################### 100.0%
==> Reinstalling wget 
==> Pouring wget--1.25.0.arm64_sequoia.bottle.tar.gz
cp: chflags: /opt/homebrew/Cellar/wget: Operation not permitted
Error: Failure while executing; `/usr/bin/env cp -pR /private/tmp/homebrew-unpack-20250220-13080-3msve0/wget /opt/homebrew/Cellar` exited with 1. Here's the output:
cp: chflags: /opt/homebrew/Cellar/wget: Operation not permitted

Here you can find the output for the command brew reinstall wget --debug --verbose

Here is the output of command ls -alO /opt/homebrew/Cellar | grep wget inside the /opt/homebrew/Cellardirectory

drwxr-xr-x   3 lollo  staff  -   96 Feb 20 00:41 wget

And here is the output of command ls -alO /opt/homebrew/Cellar/wget

total 0
drwxr-xr-x   3 lollo  staff  -   96 Feb 20 00:47 .
drwxrwxr-x  97 lollo  staff  - 3104 Feb 19 23:18 ..
drwxr-xr-x  13 lollo  staff  -  416 Dec 11 17:46 1.25.0

What did you expect to happen?

The packages should upgrade or install without problems

Step-by-step reproduction instructions (by running brew commands)

brew upgrade
@lorenzo93 lorenzo93 added the bug Reproducible Homebrew/brew bug label Feb 19, 2025
@gromgit
Copy link
Contributor

gromgit commented Feb 20, 2025

What's the output of ls -ldO /opt/homebrew/Cellar?

@MikeMcQuaid
Copy link
Member

Warning: /private/tmp is world-writable but does not have the sticky bit set.
To set it, run the following command:
sudo chmod +t /private/tmp

Please comment if you've tried this and it still happens.

@MikeMcQuaid MikeMcQuaid closed this as not planned Won't fix, can't repro, duplicate, stale Feb 20, 2025
@lorenzo93
Copy link
Author

What's the output of ls -ldO /opt/homebrew/Cellar?

ls -alO /opt/homebrew/Cellar/
total 0
drwxrwxr-x  97 lollo  staff  - 3104 Feb 19 23:18 .
drwxr-xr-x  33 lollo  admin  - 1056 Feb 19 23:38 ..
drwxr-xr-x   3 lollo  staff  -   96 Feb  2 16:54 ansible
drwxr-xr-x   3 lollo  staff  -   96 Feb  2 16:53 ca-certificates
drwxr-xr-x   3 lollo  staff  -   96 Sep  9 00:49 cairo
drwxr-xr-x   3 lollo  staff  -   96 Sep  2 13:21 capstone
drwxr-xr-x   3 lollo  staff  -   96 Feb  2 16:53 certifi
drwxr-xr-x   3 lollo  staff  -   96 Oct 15 12:37 cffi
drwxr-xr-x   3 lollo  staff  -   96 Aug 10  2024 cmatrix
drwxr-xr-x   3 lollo  staff  -   96 Dec 11 17:45 cryptography
drwxr-xr-x   3 lollo  staff  -   96 Dec 11 17:46 dtc
drwxr-xr-x   3 lollo  staff  -   96 Aug 10  2024 duti
drwxr-xr-x   3 lollo  staff  -   96 Feb  2 16:53 fontconfig
drwxr-xr-x   3 lollo  staff  -   96 Sep  2 13:21 freetype
drwxr-xr-x   3 lollo  staff  -   96 Feb  2 16:53 gettext
drwxr-xr-x   3 lollo  staff  -   96 Aug 10  2024 giflib
drwxr-xr-x   3 lollo  staff  -   96 Dec 17 15:50 glib
drwxr-xr-x   3 lollo  staff  -   96 Aug 10  2024 gmp
drwxr-xr-x   3 lollo  staff  -   96 Feb  2 16:54 gnupg
drwxr-xr-x   3 lollo  staff  -   96 Aug 10  2024 gnutls
drwxr-xr-x   3 lollo  staff  -   96 Aug 10  2024 graphite2
drwxr-xr-x   3 lollo  staff  -   96 Feb  2 16:53 harfbuzz
drwxr-xr-x   3 lollo  staff  -   96 Nov 17 23:44 hashcat
drwxr-xr-x   3 lollo  staff  -   96 Nov 12 19:27 icu4c@76
drwxr-xr-x   3 lollo  staff  -   96 Aug 10  2024 jansson
drwxr-xr-x   3 lollo  staff  -   96 Dec 17 15:50 jpeg-turbo
drwxr-xr-x   3 lollo  staff  -   96 Feb 20 00:41 libassuan
drwxr-xr-x   3 lollo  staff  -   96 Aug 10  2024 libassuan@2
drwxr-xr-x   3 lollo  staff  -   96 Aug 10  2024 libevent
drwxr-xr-x   3 lollo  staff  -   96 Feb  2 16:53 libgcrypt
drwxr-xr-x   3 lollo  staff  -   96 Dec 11 17:46 libgpg-error
drwxr-xr-x   3 lollo  staff  -   96 Aug 10  2024 libidn2
drwxr-xr-x   3 lollo  staff  -   96 Aug 10  2024 libksba
drwxr-xr-x   3 lollo  staff  -   96 Feb  2 16:54 liblinear
drwxr-xr-x   3 lollo  staff  -   96 Oct 29 19:43 libnghttp2
drwxr-xr-x   3 lollo  staff  -   96 Feb  2 16:53 libpng
drwxr-xr-x   3 lollo  staff  -   96 Feb  2 16:53 libslirp
drwxr-xr-x   3 lollo  staff  -   96 Oct 15 12:38 libsodium
drwxr-xr-x   3 lollo  staff  -   96 Sep  2 13:21 libssh
drwxr-xr-x   3 lollo  staff  -   96 Oct 29 19:43 libssh2
drwxr-xr-x   3 lollo  staff  -   96 Aug 10  2024 libtasn1
drwxr-xr-x   3 lollo  staff  -   96 Oct 15 12:38 libtiff
drwxr-xr-x   3 lollo  staff  -   96 Oct 29 19:43 libunistring
drwxr-xr-x   3 lollo  staff  -   96 Aug 10  2024 libusb
drwxr-xr-x   3 lollo  staff  -   96 Aug 10  2024 libx11
drwxr-xr-x   3 lollo  staff  -   96 Dec 17 15:50 libxau
drwxr-xr-x   3 lollo  staff  -   96 Aug 10  2024 libxcb
drwxr-xr-x   3 lollo  staff  -   96 Aug 10  2024 libxdmcp
drwxr-xr-x   3 lollo  staff  -   96 Aug 10  2024 libxext
drwxr-xr-x   3 lollo  staff  -   96 Dec 17 15:50 libxrender
drwxr-xr-x   3 lollo  staff  -   96 Aug 10  2024 libyaml
drwxr-xr-x   3 lollo  staff  -   96 Aug 10  2024 little-cms2
drwxr-xr-x   3 lollo  staff  -   96 Aug 10  2024 lsusb
drwxr-xr-x   3 lollo  staff  -   96 Aug 10  2024 lua
drwxr-xr-x   3 lollo  staff  -   96 Sep  2 13:21 lz4
drwxr-xr-x   3 lollo  staff  -   96 Aug 10  2024 lzo
drwxr-xr-x   3 lollo  staff  -   96 Nov 12 19:27 maven
drwxr-xr-x   3 lollo  staff  -   96 Nov 17 23:44 minizip
drwxr-xr-x   3 lollo  staff  -   96 Aug 10  2024 mpdecimal
drwxr-xr-x   3 lollo  staff  -   96 Aug 10  2024 mtr
drwxr-xr-x   3 lollo  staff  -   96 Aug 10  2024 ncurses
drwxr-xr-x   3 lollo  staff  -   96 Feb  2 16:54 nettle
drwxr-xr-x   3 lollo  staff  -   96 Feb  2 16:54 nmap
drwxr-xr-x   3 lollo  staff  -   96 Dec 11 17:46 npth
drwxr-xr-x   3 lollo  staff  -   96 Aug 10  2024 ntfs-3g-mac
drwxr-xr-x   3 lollo  staff  -   96 Aug 10  2024 openconnect
drwxr-xr-x   3 lollo  staff  -   96 Feb  2 16:53 openjdk
drwxr-xr-x   3 lollo  staff  -   96 Feb  2 16:53 openjdk@17
drwxr-xr-x   3 lollo  staff  -   96 Oct 29 19:43 openssl@3
drwxr-xr-x   3 lollo  staff  -   96 Aug 10  2024 p11-kit
drwxr-xr-x   3 lollo  staff  -   96 Aug 10  2024 pcre2
drwxr-xr-x   3 lollo  staff  -   96 Aug 10  2024 pinentry
drwxr-xr-x   3 lollo  staff  -   96 Feb  2 16:54 pinentry-mac
drwxr-xr-x   3 lollo  staff  -   96 Aug 10  2024 pinentry-touchid
drwxr-xr-x   3 lollo  staff  -   96 Dec 11 17:45 pixman
drwxr-xr-x   3 lollo  staff  -   96 Oct 15 12:37 pycparser
drwxr-xr-x   3 lollo  staff  -   96 Dec 11 18:12 python-packaging
drwxr-xr-x   3 lollo  staff  -   96 Dec 11 17:46 [email protected]
drwxr-xr-x   3 lollo  staff  -   96 Dec 11 17:46 [email protected]
drwxr-xr-x   3 lollo  staff  -   96 Dec 11 17:45 [email protected]
drwxr-xr-x   3 lollo  staff  -   96 Dec 17 15:50 qemu
drwxr-xr-x   3 lollo  staff  -   96 Sep  2 13:21 readline
drwxr-xr-x   3 lollo  staff  -   96 Aug 10  2024 slides
drwxr-xr-x   3 lollo  staff  -   96 Aug 10  2024 snappy
drwxr-xr-x   3 lollo  staff  -   96 Aug 10  2024 speedtest-cli
drwxr-xr-x   3 lollo  staff  -   96 Feb 19 23:21 sqlite
drwxr-xr-x   3 lollo  staff  -   96 Aug 10  2024 stoken
drwxr-xr-x   3 lollo  staff  -   96 Aug 10  2024 sudo-touchid
drwxr-xr-x   3 lollo  staff  -   96 Sep  2 13:21 telnet
drwxr-xr-x   3 lollo  staff  -   96 Dec 11 17:46 tree
drwxr-xr-x   3 lollo  staff  -   96 Oct 29 19:43 unbound
drwxr-xr-x   3 lollo  staff  -   96 Aug 10  2024 vde
drwxr-xr-x   3 lollo  staff  -   96 Feb 20 00:47 wget
drwxr-xr-x   3 lollo  staff  -   96 Aug 10  2024 xorgproto
drwxr-xr-x   3 lollo  staff  -   96 Feb  2 16:54 xxhash
drwxr-xr-x   3 lollo  staff  -   96 Feb  2 16:53 xz
drwxr-xr-x   3 lollo  staff  -   96 Aug 10  2024 zstd

Warning: /private/tmp is world-writable but does not have the sticky bit set.
To set it, run the following command:
sudo chmod +t /private/tmp

Please comment if you've tried this and it still happens.

I've forgot to write it in the original issue. I've tried, every time I reboot my Mac it reset. After I execute the command, brew doctor doest not cite that issue anymore till the next reboot.

brew doctor

Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: Some installed formulae are deprecated or disabled.
You should find replacements for the following formulae:
  libassuan@2

But the problem persist, same error :(

@MikeMcQuaid MikeMcQuaid reopened this Feb 20, 2025
@gromgit
Copy link
Contributor

gromgit commented Feb 21, 2025

After I execute the command, brew doctor doest not cite that issue anymore till the next reboot.

Are you running any systems management (e.g. Jamf) or anti-virus software? If so, try disabling it, as that might be removing the sticky bit on each reboot...and causing the original issue.

Also, just to be sure, what's the output of ls -ld@Oe /opt/homebrew/Cellar?

@lorenzo93
Copy link
Author

Are you running any systems management (e.g. Jamf) or anti-virus software?

No, nothing. The vast majority of packages are the ones from Brew (the ls of the Cellar folder shows the installed packages). Outside of brew I have just the Bitwarden app from AppStore.

Also, just to be sure, what's the output of ls -ld@Oe /opt/homebrew/Cellar?

drwxrwxr-x 97 lollo staff - 3104 Feb 19 23:18 /opt/homebrew/Cellar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Reproducible Homebrew/brew bug
Projects
None yet
Development

No branches or pull requests

3 participants