How To Install Brew On Windows 10
Using Mash on Windows 10 with Windows Subsystem for Linux (WSL)
There's merely something poetic about using mash
in Ubuntu's GNU fustigate beat running on a Linux compatibility layer in Windows 10… natively . And it works surprisingly well.
How?
Windows Subsystem for Linux (WSL) is a Windows x characteristic that provides native support for the Linux/GNU surroundings. When enabled, you are able to download and run the command line interface for various Linux distributions as a Windows app.
The recent release of Homebrew ii.0 brings official support for Linux and Windows ten (through WSL). This is based on a fork of Homebrew known as Linuxbrew.
Enable WSL and Install Ubuntu
From the Windows start menu, open Turn Windows features on or off. Click the checkbox for Windows Subsystem for Linux, and your estimator will take a few minutes to download and install the necessary files. You'll be prompted to restart (make sure to bookmark this article!).
Side by side, open Microsoft Store and search for Linux. Select Show all next to Apps and y'all'll see a listing of distros to pick from including Kali, Ubuntu, Ubuntu LTS, and Debian.
I picked Ubuntu. It will take a few minutes to install afterward it is downloaded (~200 MB).
Afterwards creating a user account, you'll be able to launch Ubuntu as an app, which will open a command line window to its bash shell.
Get ahead and convince yourself you lot are really running a Linux bash shell in Windows 10. (Endeavour which $SHELL
, uname -o
, or ls -al /
).
Install and Configure brew
Run the following to install brew every bit Linuxbrew. Note: right-clicking in the window volition paste and run your clipboard contents.
sh -c "$(coil -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"
Pay close attending to the output; y'all'll be instructed to Configure Linuxbrew in your ~.profile and Add Linuxbrew to your PATH. Normally, Homebrew on MacOS will install packages to /usr/local/bin
or /usr/local/Cellar
. Linuxbrew, on the other paw, will install packages to /home/linuxbrew/.linuxbrew/bin
. Therefore, you will need to manually add that directory to your PATH. Additionally, this means that you won't need to use sudo
to usebrew
.
Run these commands:
test -d ~/.linuxbrew && eval $(~/.linuxbrew/bin/brew shellenv) test -d /home/linuxbrew/.linuxbrew && eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv) test -r ~/.bash_profile && echo "eval \$($(brew --prefix)/bin/brew shellenv)" >>~/.bash_profile echo "eval \$($(brew --prefix)/bin/mash shellenv)" >>~/.profile
And that's it! At present you lot can utilize mash
! Try installing a uncomplicated package to test:
brew install hi
You should go the below output if everything is working as expected. If you become an error concerning patchelf
, see below for a fix. Otherwise, y'all can skip ahead to "Usage Notes".
Error: patchelf fix
If yous have the following mistake:
Error: patchelf must be installed: brew install patchelf
Warning: Bottle installation failed: building from source.
Mistake: The following formula
patchelf
cannot exist installed every bit binary parcel and must be built from source.
The recommended solution of brew install gcc
may issue in the same mistake. A ready is to run the following commands to get brew
working properly.
sudo apt-get update
sudo apt-get install build-essential
Usage Notes
So how is the file system set upwards? If you cd ~
and pwd
, yous'll get /domicile/<username>/
… but that can't really be the path from /
! The root directory for your Linux filesystem should await something like the following.
C:\Users\edwar\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\
I recommend bookmarking this in Windows Explorer.
How do I admission Windows files? The operating system bulldoze folder volition announced in /mnt/
most likely every bit /mnt/c/
.
Homebrew compatibility. I found some apps that didn't work well from apt-become
worked flawlessly when installed with brew
, like zplug
. Inversely, I couldn't become ranger
to piece of work with brew
just got it working with apt-get
. This very conveniently gives y'all multiple options for installing a packet, potentially skipping the step of Googling vague errors.
What tin can I do if I mess up? If you mess something up badly, yous can just uninstall and reinstall the Linux application to quickly commencement everything over.
Can I use a shell other than bash
? Yup! I personally set zsh
. Here's a tip: I had problems setting the default shell to zsh
after installing it. Instead of installing zsh
directly from source, installing it through oh-my-zsh
worked fine. In addition, I had to source ~/.contour
in my .zhsrc
file for Linuxbrew to work properly.
This definitely makes the transition from MacOSX to Windows development much friendlier! Thanks for reading!
Source: https://medium.com/@edwardbaeg9/using-homebrew-on-windows-10-with-windows-subsystem-for-linux-wsl-c7f1792f88b3
Posted by: deansthiletwed.blogspot.com
0 Response to "How To Install Brew On Windows 10"
Post a Comment