Skip to content

Installing cask claude-code on Linux unnecessarily asks for sudo password #22120

@XuehaiPan

Description

@XuehaiPan

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: You have an unnecessary local Core tap!
This can cause problems installing up-to-date formulae.
Please remove it by running:
 brew untap homebrew/core

Verification

  • I ran brew update twice and am still able to reproduce my issue.
  • My "brew doctor output" above says Your system is ready to brew or a definitely unrelated Tier message.
  • 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: 5.1.8-52-gb43d073
ORIGIN: https://github.com/Homebrew/brew
HEAD: b43d073e5f47bbc7493ff191710d5ca812c0c84d
Last commit: 18 hours ago
Branch: main
Core tap HEAD: c668a61a7a6010be70adeb1e921b2406eba7ab43
Core tap last commit: 19 hours ago
Core tap JSON: 02 May 07:24 UTC
HOMEBREW_PREFIX: /home/linuxbrew/.linuxbrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_DOWNLOAD_CONCURRENCY: 32
HOMEBREW_FORBID_PACKAGES_FROM_PATHS: set
HOMEBREW_MAKE_JOBS: 16
Homebrew Ruby: 4.0.3 => /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/portable-ruby/4.0.3/bin/ruby
CPU: 16-core 64-bit arm
Clang: N/A
Git: 2.43.0 => /bin/git
Curl: 8.5.0 => /bin/curl
Kernel: Linux 6.12.76-linuxkit aarch64 GNU/Linux
OS: Ubuntu 24.04.4 LTS
Host glibc: 2.39
Host libstdc++: 6.0.33
/usr/bin/gcc: 13.3.0
/usr/bin/ruby: N/A
glibc: N/A
gcc@12: N/A
gcc: N/A
xorg: N/A

What were you trying to do (and why)?

This issue was originally posted as a discussion: https://github.com/orgs/Homebrew/discussions/6831

When I install the claude-code cask on Linux, brew asks for the sudo password. The installation is successful either if I type the password or press Ctrl+D to send EOF.

I'd suppose installing formulae/casks on Linux does not require a sudo password, and the installation can run non-interactively.

What happened (include all command output)?

brew prompts for a sudo password during installation, which is unnecessary and makes the process require user interaction.

What did you expect to happen?

Install the cask on Linux non-interactively.

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

Steps to reproduce:

  • Installation with NOPASSWD: success without asking for sudo password.
$ docker run -it --rm -h ubuntu ghcr.io/homebrew/ubuntu24.04:main
linuxbrew@ubuntu:~$ brew install claude-code
✔︎ JSON API formula_tap_migrations.jws.json                                                           Downloaded    2.0KB/  2.0KB
✔︎ JSON API cask_tap_migrations.jws.json                                                              Downloaded    2.2KB/  2.2KB
✔︎ JSON API cask.jws.json                                                                             Downloaded   15.4MB/ 15.4MB
✔︎ JSON API formula.jws.json                                                                          Downloaded   32.0MB/ 32.0MB
==> Fetching downloads for: claude-code
✔︎ Cask claude-code (2.1.118)                                                                         Verified    239.8MB/239.8MB
==> Installing Cask claude-code
==> Linking Binary 'claude' to '/home/linuxbrew/.linuxbrew/bin/claude'
🍺  claude-code was successfully installed!
linuxbrew@ubuntu:~$
  • Installation without NOPASSWD (my use case): ask for sudo password, but the password is unneeded for installation success. The installation cannot run non-interactively.
$ docker run -it --rm -h ubuntu ghcr.io/homebrew/ubuntu24.04:main
linuxbrew@ubuntu:~$ sudo sed -i'' 's|linuxbrew|#linuxbrew|g' /etc/sudoers
linuxbrew@ubuntu:~$ brew install claude-code
✔︎ JSON API formula_tap_migrations.jws.json                                                           Downloaded    2.0KB/  2.0KB
✔︎ JSON API cask_tap_migrations.jws.json                                                              Downloaded    2.2KB/  2.2KB
✔︎ JSON API cask.jws.json                                                                             Downloaded   15.4MB/ 15.4MB
✔︎ JSON API formula.jws.json                                                                          Downloaded   32.0MB/ 32.0MB
==> Fetching downloads for: claude-code
✔︎ Cask claude-code (2.1.118)                                                                         Verified    239.8MB/239.8MB
==> Installing Cask claude-code
[sudo] password for linuxbrew:
sudo: no password was provided
sudo: a password is required
==> Linking Binary 'claude' to '/home/linuxbrew/.linuxbrew/bin/claude'
🍺  claude-code was successfully installed!
linuxbrew@ubuntu:~$

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions