Skip to main content

Linux Bash Shell on Windows 10

Let's enable Ubuntu on Bash on Windows 10 Anniversary Update and later.

Windows 10: Enable 'Windows Subsystems for Linux' feature
Windows 10: Enable 'Windows Subsystems for Linux' feature



What happens if Developer mode is not enabled





Turn on developer mode





Run C:\Windows\Systems32\bash.exe


Check Ubuntu version

lsb_release -a


Update Ubuntu

sudo apt-get update



Ubuntu upgrade

sudo apt-get upgrade




Check Ubuntu version after upgrading



Notes from the fields

Ubuntu package's location in user's profile

By default, it is in:

%userprofile%\AppData\Local\Packages

In powershell, run this command to find out: Get-AppxPackage *Ubuntu*

PS C:\WINDOWS\system32> Get-AppxPackage *Ubuntu*
Name              : CanonicalGroupLimited.Ubuntu18.04onWindows
Publisher         : CN=23596F84-C3EA-4CD8-A7DF-550DCE37BCD0
Architecture      : X64
ResourceId        :                                                                                            
Version           : 2020.1804.7.0
PackageFullName   : CanonicalGroupLimited.Ubuntu18.04onWindows_2020.1804.7.0_x64__79rhkp1fndgsc
InstallLocation   : C:\Program Files\WindowsApps\CanonicalGroupLimited.Ubuntu18.04onWindows_2020.1804.7.0_x64__79rhkp1fndgsc                                                                             IsFramework       : False
PackageFamilyName : CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc
PublisherId       : 79rhkp1fndgsc
IsResourcePackage : False
IsBundle          : False
IsDevelopmentMode : False
NonRemovable      : False
IsPartiallyStaged : False
SignatureKind     : Store
Status            : Ok                                                                                                                                                                                                                                                                                                                                                                                                                                      PS C:\WINDOWS\system32> 

Move Ubuntu package to another drive

Refer to this question on superuser.com: https://superuser.com/questions/1443995/how-to-move-ubuntu-on-windows-to-drive-d-or-other-drive

C:\Users\Tuyen>wsl -l
Windows Subsystem for Linux Distributions:
Ubuntu-18.04 (Default)

C:\Users\Tuyen>mkdir E:\wsl

C:\Users\Tuyen>wsl --export ubuntu-18.04 E:\wsl\ubuntu-18.04.tar.gz

C:\Users\Tuyen>dir E:\wsl\ubuntu-18.04.tar.gz
 Volume in drive E has no label.
 Volume Serial Number is 0285-3B90

 Directory of E:\wsl

03/27/2020  12:07 PM     9,084,385,280 ubuntu-18.04.tar.gz
               1 File(s)  9,084,385,280 bytes
               0 Dir(s)  158,935,080,960 bytes free

C:\Users\Tuyen>

Remove/Uninstall Ubuntu package

PS C:\WINDOWS\system32> Remove-AppxPackage -Package (Get-AppxPackage *Ubuntu*).PackageFullname
PS C:\WINDOWS\system32> (Get-AppxPackage *Ubuntu*).Name                                                        PS C:\WINDOWS\system32>              

Import Ubuntu package

C:\Users\Tuyen>wsl --import ubuntu-18.04 E:\wsl E:\wsl\ubuntu-18.04.tar.gz

C:\Users\Tuyen>wsl -l
Windows Subsystem for Linux Distributions:
ubuntu-18.04 (Default)

C:\Users\Tuyen>

Popular posts from this blog

Microsoft Windows Server 2012 R2 Standard Evaluation Product Key

Microsoft Windows Server 2012 R2 Standard Evaluation D2N9P-3P6X9-2R39C-7RTCD-MDVJX DBGBW-NPF86-BJVTX-K3WKJ-MTB6V

ManageEngine ServiceDesk Plus - Reset password

Let's reset the default administrator's password to 'admin'

hmailserver: Notes from the field

hmailserver is one of free open source mail servers running on Microsoft Windows operating system.