Skip to content

Commit

Permalink
Change default temp on Linux to /var/tmp.
Browse files Browse the repository at this point in the history
Previously, the default temporary directory was /tmp on Linux and
/private/tmp on macOS. On many Linux distros, including at least Fedora,
/tmp is stored in RAM. This diverges from the behavior on macOS and has
led to bugs, most notably the inability to install large bottles on
memory-limited machines.

This fixes Homebrew#19037.
  • Loading branch information
averms committed Jan 5, 2025
1 parent b6fafba commit b77b809
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Library/Homebrew/brew.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ else
CACHE_HOME="${HOMEBREW_XDG_CACHE_HOME:-${HOME}/.cache}"
HOMEBREW_DEFAULT_CACHE="${CACHE_HOME}/Homebrew"
HOMEBREW_DEFAULT_LOGS="${CACHE_HOME}/Homebrew/Logs"
HOMEBREW_DEFAULT_TEMP="/tmp"
HOMEBREW_DEFAULT_TEMP="/var/tmp"
fi

realpath() {
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/env_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ module EnvConfig
"different volumes, as macOS has trouble moving symlinks across volumes when the target " \
"does not yet exist. This issue typically occurs when using FileVault or custom SSD " \
"configurations.",
default_text: "macOS: `/private/tmp`, Linux: `/tmp`.",
default_text: "macOS: `/private/tmp`, Linux: `/var/tmp`.",
default: HOMEBREW_DEFAULT_TEMP,
},
HOMEBREW_UPDATE_TO_TAG: {
Expand Down

0 comments on commit b77b809

Please sign in to comment.