The edit tool is not currently available in common Linux package managers (such as apt, dnf, or yum). This script provides a convenient and reliable way to always install the latest official release directly from Microsoft's GitHub repository, without waiting for distribution maintainers to package it.
This project provides a simple shell script to install the latest release of Microsoft's edit command-line editor on Linux.
- Automatically fetches the latest release from GitHub
- Downloads and installs the correct Linux binary for your architecture
- Adds the binary to
~/.local/bin(creating the directory if needed) - Optionally updates your
PATHin~/.profileif required - Checks if
editis already installed and up-to-date, and only updates if a newer version is available - Optional: Can set Microsoft
editas your defaulteditcommand (overriding/usr/bin/edit) with a flag - Provides clear instructions to undo this change
curl -fsSL https://raw.githubusercontent.com/raymondlowe/install-msedit-linux/main/install_msedit.sh | sh- The script will:
- Detect the latest version
- Download and extract the binary
- Place it in
~/.local/bin/edit - Make it executable
- Optionally update your
PATHif needed
- After install, the script will tell you how to make Microsoft
editthe default (see below).
If you want the Microsoft version to take precedence over /usr/bin/edit, run:
curl -fsSL https://raw.githubusercontent.com/raymondlowe/install-msedit-linux/main/install_msedit.sh | sh -s -- --set-default- This creates a symlink at
~/bin/editpointing to the Microsoft binary. - Make sure
~/binis in yourPATH(the script will tell you if it isn't).
To remove the Microsoft edit as the default and restore your previous edit (e.g., /usr/bin/edit):
rm ~/bin/editsource ~/.profileedit --versioncurlawktarzstdorunzstd(for .tar.zst archives)- Install with:
sudo apt install zstd(Debian/Ubuntu) orsudo dnf install zstd(Fedora/RHEL)
- Install with:
unxz(for .xz archives)- Standard POSIX
sh(no bashisms required) - glibc 2.34+ (or whatever version the Microsoft binary requires)
Note: The Microsoft
editbinary may require a recent version of glibc (e.g., 2.34+). If you see errors about missing GLIBC versions when runningedit, you may need to upgrade your Linux distribution to a newer release that includes a compatible glibc version.
- The script is designed for x86_64 and aarch64 Linux systems.
- If you encounter issues, ensure you have the required tools installed.
- For more information about
edit, see the official repository.
This project is not affiliated with Microsoft. It simply automates installation of their open source tool.