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

IIS: Delete cached files on server running IIS

Delete cached files on server running IIS When changing css, javascript files, check to delete if IIS still caches old files in the default folder C:\inetpub\temp\IIS Temporary Compressed Files\<sitename>\$^_gzip_D^\ Apply to: IIS 8.5

Linux command: du - disk usage

Where have all my storage gone? du summarize disk usage of the set of FILEs, recursively for directories.

ManageEngine ServiceDesk Plus - Reset password

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