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 10 1903

Check for new feature at What's new in Windows 10, version 1903 IT Pro content

Data Recovery Softwares

Follow 3-2-1 backup rule so you do not need these data recovery softwares.

Tiếng Nhật: 7 ngày trong tuần

Tìm thấy món quà xinh xắn mà một đồng nghiệp đã tặng trong dịp đi Nhật tham gia khóa học quản lý dự án. Desk Calendar in Japanese Thử một mục tiêu nhỏ để luyện tập não và cách gõ tiếng Nhật trên máy tính. Dưới đây là bảy ngày trong tuần, bắt đầu từ Chủ Nhật, đến thứ hai,... và cuối cùng là thứ bảy (Nhựt, Nguyệt, Hỏa, Thủy, Mộc, Kim, Thổ). 日曜日 にちようび 月曜日 げつようび 火曜日 かようび 水曜日 すいようび 木曜日 もくようび 金曜日 きんようび 土曜日 どようび  [Nguồn tham khảo] http://www.cjvlang.com/Dow/dowjpn.html Cám ơn bạn đã đọc!