claude-code - 💡(How to fix) Fix [BUG] install.sh errors out on Ubuntu if curl was installed with Snap [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#49455Fetched 2026-04-17 08:40:42
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Participants
Timeline (top)
labeled ×4

Error Message

Following the "Get started" instructions from https://code.claude.com/docs/en/overview on Ubuntu 22.04, I got the following error: curl: (23) client returned ERROR on write of 1369 bytes 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.

Error Messages/Logs

curl: (23) client returned ERROR on write of 1369 bytes

Root Cause

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.

Code Example

thejakeschmidt:~$ curl -fsSL https://claude.ai/install.sh | bash
curl: (23) client returned ERROR on write of 1369 bytes
Download failed

---

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!

---

# 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
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • 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

extent analysis

TL;DR

The issue can be resolved by modifying the install script to use a temporary directory for downloads instead of the user's home directory.

Guidance

  • The root cause of the issue is the Snap sandbox's restriction on writing to dot-prefixed subdirectories of the user's home directory.
  • To fix this, the install script should use the $TMPDIR environment variable as the download location and then move the file to the desired location.
  • The user can verify this fix by checking the install script's download location and ensuring it is not within the user's home directory.
  • As a temporary workaround, users can install the apt version of curl instead of the Snap version.

Example

# Modified install script
curl -sSL -o "$TMPDIR/claude" https://storage.googleapis.com/claude-code-dist-86c565f3-f756-42ad-8dfa-d59b1c096819/claude-code-releases/2.1.56/linux-x64/claude
mv "$TMPDIR/claude" ~/.claude/downloads/

Notes

This fix assumes that the $TMPDIR environment variable is set and points to a writable directory. If this is not the case, an alternative temporary directory can be used.

Recommendation

Apply the workaround by installing the apt version of curl until the install script is modified to use a temporary directory for downloads. This is because the Snap version of curl has restrictions that prevent it from writing to certain directories.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [BUG] install.sh errors out on Ubuntu if curl was installed with Snap [1 participants]