[BUG] install.sh errors out on Ubuntu if curl was installed with Snap
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Following the "Get started" instructions from https://code.claude.com/docs/en/overview on Ubuntu 22.04, I got the following error:
thejakeschmidt:~$ curl -fsSL https://claude.ai/install.sh | bash
curl: (23) client returned ERROR on write of 1369 bytes
Download failed
It turns out the error it's getting is a "Permission denied" from the subcommand curl -sSL -o /home/thejakeschmidt/.claude/downloads/claude-2.1.56-linux-x64 https://storage.googleapis.com/claude-code-dist-86c565f3-f756-42ad-8dfa-d59b1c096819/claude-code-releases/2.1.56/linux-x64/claude, and that turned out to be because curl was installed by Snap (not apt). The Snap sandbox doesn't allow writing to dot-prefixed subdirectories of the user's home directory, so curl gets an EACCES error trying to save the output under ~/.claude.
What Should Happen?
The install script should probably use $TMPDIR for its download location; it can mv the file to ~/.claude afterward.
Error Messages/Logs
Here's a (nearly-)full trace from my shell when I ran the repro steps specified below:
# 1. Confirm we're starting with no curl installed
thejakeschmidt:~$ hash -r
thejakeschmidt:~$ command -v curl
# 2. Install the snap version of curl
thejakeschmidt:~$ sudo snap install curl
curl 8.18.0 from Yuzukosho (aoilinux) installed
thejakeschmidt:~$ hash -r
thejakeschmidt:~$ command -v curl
/snap/bin/curl
thejakeschmidt:~$ curl.snap-acked
You will no longer see the Snap warning message.
thejakeschmidt:~$ curl --version
curl 8.18.0 (x86_64-pc-linux-gnu) libcurl/8.18.0 OpenSSL/3.6.0 zlib/1.3 brotli/1.1.0 zstd/1.5.5 libidn2/2.3.7 libpsl/0.21.2 libssh2/1.11.0 nghttp2/1.68.0 nghttp3/1.15.0 librtmp/2.3 mit-krb5/1.20.1 OpenLDAP/2.6.7
Release-Date: 2026-01-07
Protocols: dict file ftp ftps gopher gophers http https imap imaps ipfs ipns ldap ldaps mqtt pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp ws wss
Features: alt-svc AsynchDNS brotli GSS-API HSTS HTTP2 HTTP3 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM PSL SPNEGO SSL threadsafe TLS-SRP UnixSockets zstd
# 3. Attempt to install Claude Code (fails)
thejakeschmidt:~$ curl -fsSL https://claude.ai/install.sh | bash
curl: (23) client returned ERROR on write of 1369 bytes
Download failed
# 4. Clean up first attempt
thejakeschmidt:~$ sudo snap remove curl
curl removed (snap data snapshot saved)
thejakeschmidt:~$ hash -r
thejakeschmidt:~$ command -v curl
thejakeschmidt:~$ rm -r ~/.claude ~/.local/bin/claude ~/.local/share/claude/
# 5. Install apt version of curl
thejakeschmidt:~$ sudo apt install curl
[...]
Setting up curl (7.81.0-1ubuntu1.22) ...
[...]
thejakeschmidt:~$ hash -r
thejakeschmidt:~$ command -v curl
/usr/bin/curl
# 6. Attempt to install Claude Code (succeeds)
thejakeschmidt:~$ curl -fsSL https://claude.ai/install.sh | bash
Setting up Claude Code...
✔ Claude Code successfully installed!
Version: 2.1.56
Location: ~/.local/bin/claude
Next: Run claude --help to get started
✅ Installation complete!
Steps to Reproduce
# 1. Confirm we're starting with no curl installed
hash -r
command -v curl
# 2. Install the snap version of curl
sudo snap install curl
hash -r
command -v curl
# This command removes a warning message explaining the issue we're about to hit, which is verbose in the install script output
curl.snap-acked
curl --version
# 3. Attempt to install Claude Code (fails)
curl -fsSL https://claude.ai/install.sh | bash
# 4. Clean up first attempt
sudo snap remove curl
hash -r
command -v curl
rm -r ~/.claude ~/.local/bin/claude ~/.local/share/claude/
# 5. Install apt version of curl
sudo apt install curl
hash -r
command -v curl
# 6. Attempt to install Claude Code (succeeds)
curl -fsSL https://claude.ai/install.sh | bash
Claude Model
None
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.56
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
Other
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗