How To Install Bash Script
Brief: This beginner'southward tutorial shows yous how to install bash on Windows.
Linux on Windows is a reality, thanks to the partnership between Canonical (parent visitor of Ubuntu) and Microsoft. When Microsoft's CEO announced that the Bash shell was coming to Windows, a number of people just couldn't believe it. #BashOnWindows trended on Twitter for days, such was the impact of this news.
But Bash on Windows was not bachelor to everyone immediately. People had to install the Windows 10 technical preview to install Linux on Windows 10. But this is not the example anymore. The Windows 10 ceremony upgrade is here and now you can easily get Fustigate on Windows. And, earlier we go along installing Fustigate on Windows, permit me tell you a little more than about it.
Annotation: This tutorial was tested with the latest available Windows ten version 2004 and build 19041.450. You might need to update your Windows installation if y'all've an older build to follow everything in this tutorial.
What is Bash on Windows?
Bash on Windows provides a Windows subsystem and Ubuntu Linux runs atop it. Information technology is not a virtual machine or an application similar Cygwin. Information technology is complete Linux system inside Windows 10.
Basically, information technology allows yous to run the same Bash shell that you lot find on Linux. This style you tin can run Linux commands inside Windows without the needing to install a virtual automobile, or dual kick Linux and Windows. You install Linux inside Windows similar a regular awarding. This is a adept option if your main aim is to learn Linux/Unix commands.
I recommend reading this article to know more about Fustigate on Windows.
Method one: Install Linux Bash Shell on Windows ten Newer Versions
Skillful matter is that the Fall Creator'south Update and the recent Windows x, version 2004 makes it easier to install Bash on Windows 10. You tin get it in one click from Windows Store. In that location are even so a few things to do however.
I am installing Ubuntu using Windows Subsystem for Linux. You lot can also use SUSE Linux. The procedure is same for both distributions.
Step 1: Enable "Windows Subsystem for Linux" characteristic
The first affair you need to do is to enable Windows Subsystem for Linux feature from PowerShell or from the Windows characteristic options.
If you want to employ the GUI, you tin can simply search for option to get the list of Windows features to enable a few things as shown in the screenshot beneath.
At present, you but have to open it to access all the options. Among the ones listed, you have to enable (or check) the characteristic for "Windows Subsystem for Linux" and "Virtual Automobile Platform" and then perform a reboot to make sure you accept both of them enabled.
In either case, if you want to employ the PowerShell, you lot can just become to the Start menu and search for PowerShell. Run it as administrator:
In one case you have the PowerShell running, use the command beneath to enable Bash in Windows ten.
Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform -norestart dism.exe /online /enable-characteristic /featurename:Microsoft-Windows-Subsystem-Linux /all You'll be asked to confirm your option. Type Y or press enter:
Now you should be asked to reboot. Even if yous are non asked to, you must restart your system.
Stride two: Download a Linux system from the Windows store
In one case your system has rebooted, get to the Windows Shop and search for "Linux" or just "Ubuntu".
You'll meet the selection to install Ubuntu or SUSE. I take installed Ubuntu for Fustigate on Windows here.
What's the divergence between using Ubuntu or openSUSE or SUSE Linux Enterprise? And which one should you use?
To tell you quickly, the main difference would be in the commands for installing new packages inside these Linux subsystems. I suggest going for Ubuntu in this case.
Once you choose the distribution of your pick, you'll encounter the selection to install information technology. Practice note that it volition download files of around 1Gb in size or less depending on what you lot're downloading.
Footstep 3: Run Linux inside Windows 10
You are almost there. Once you lot have installed Linux, it's time to meet how to access Fustigate in Windows 10.
Simply search for the Linux distribution y'all installed in the previous step. In my case it was Ubuntu. You'll encounter that it runs like a normal Windows awarding.
It will accept some time installing and then you'll have to gear up upwardly the username and password.
Don't worry, it'southward just for the starting time run. Bash shell will be available for utilize straight from the next time onwards.
Savor Linux inside Windows 10.
Troubleshooting 1: The WSL optional component is not enabled. Please enable it and try again.
You lot may see an error like this when y'all try to run Linux inside Windows 10:
The WSL optional component is non enabled. Delight enable it and try again. See https://aka.ms/wslinstall for details. Mistake: 0x8007007e Press whatever cardinal to proceed... And when you press whatsoever cardinal, the application closes immediately.
The reason here is that the Windows Subsystem for Linux is not enabled in your case. You should enable it equally explained in pace one of this guide. Yous can do that even later you have installed Linux from Windows Store.
Troubleshoot 2: Installation failed with error 0x80070003
This is because Windows Subsystem for Linux only runs on the system drive i.east. the C bulldoze. You should make sure that when y'all download Linux from the Windows Store, it is stored and installed in the C Drive.
Get to Settings -> Storage -> More Storage Settings: Modify where new content is saved and select C Drive here.
Method 2: Install Linux Bash Beat on older Windows 10
If you cannot get the Fall Creator's update on Windows 10 for some reason, you can withal install it if you have the Anniversary update of Windows 10. Just here, y'all'll have to enable programmer fashion. I still recommend upgrading to the Fall Creator's update or the latest Windows x 2004 version update though.
Installing Linux Bash Shell on Older Windows 10 (Click to aggrandize)
Step ane:
Printing Windows Primal + I to admission Windows system settings. In here, go to Update & Security:
Pace 2:
From the left side pane, choose "For developers." You'll run into an option for "Developer style." Enable information technology.
Step 3:
Now search for Control Panel and in Control Console, click on "Programs":
Footstep 4:
In Programs, click "Plough Windows features on or off":
Step 5:
When you practise this, you lot'll see several Windows features. Await for "Windows Subsystem for Linux" and enable it.
Footstep vi:
You'll demand to restart the arrangement after doing this.
Step 7:
Afterward restarting the computer, click the start button and search for "fustigate".
Step 8:
When you run information technology for the first time, you'll exist given the pick to download and install Ubuntu. You'll be asked to create a username and password during this process. It will install an entire Ubuntu Linux arrangement, then accept patience as information technology volition accept some time in downloading and installing Linux on Windows.
Footstep 9:
Once this is done, go back to the Showtime menu and search for Ubuntu or Bash.
Step 10:
Now you have a command line version of Ubuntu Linux. You can use apt to install various command line tools in it.
Bonus Tip: Run GUI Apps On Windows Subsystem for Linux
The ability to run GUI apps on Windows Subsystem for Linux was introduced with WSL two release in May 2022.
It's withal not something officially supported out-of-the-box, merely if you're curious, y'all can experiment with it by following the steps beneath:
Step 1: Enable/Update WSL two
If you have the latest Windows version 2004, build 19041, you already have WSL two support simply you need to enable it and set it to default instead of WSL 1.
To practice that, offset you demand to ensure that y'all take the latest WSL 2 Linux Kernel by updating the WSL 2 Linux Kernel.
You just demand to follow the instructions on the official documentation page and download/install the package. Once done, y'all need to launch the PowerShell (run it as administrator) and set WSL 2 every bit the default by typing the following command:
wsl --set-default-version 2 You should go a message that says "For information on key differences with WSL 2 please visit https://aka.ms/wsl2".
In example you get an fault (Error: 0x1bc), yous need to make sure that you have updated the WSL 2 Linux Kernel, that solved the issue for me.
Step 2: Download and Install a Windows Ten Server Program
As I mentioned, WSL two does non have the official support for running GUI apps by default. So, to practise it, we need to download and install a Windows X Server program to give WSL admission to display the apps.
You tin try the open-source XLaunch server that we're using here.
Stride 3: Configure Windows 10 Server
At present that you lot have installed it, you lot just demand to configure a few things.
First, Launch XLaunch and proceed to ensure that you have the following options enabled:
1. Go along the Display number fix as -1 and select "Multiple Windows"
two. Next, yous need to enable "Start no client".
3. Finally, you but need to check "Disable admission control" to avert permission issues and relieve the configuration on the side by side step to complete the configuration.
At present everything's nearly washed, y'all need to launch Ubuntu from the list of apps installed and configure it to launch Linux GUI apps on Windows.
Just enter the following command in the Linux terminal (Ubuntu):
export Brandish="`grep nameserver /etc/resolv.conf | sed 'due south/nameserver //'`:0" Now, merely install your favorite Linux GUI app from the concluding and test if information technology works! In my case, I installed and launched Gedit using the following commands:
sudo apt update sudo apt install gedit gedit And, hither's how it looks:
I hope you find this tutorial helpful for installing bash on Windows 10 and experimenting Linux GUI apps on Windows 10. No wonder WSL lets you play with Linux inside of Windows. If you take questions or suggestions, feel gratuitous to ask.
Source: https://itsfoss.com/install-bash-on-windows/
Posted by: riddersonch1955.blogspot.com

0 Response to "How To Install Bash Script"
Post a Comment