Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การแก้ไขปัญหา >> ข้อผิดพลาด Windows

วิธีแก้ 'The WSL Optional Component is not Enabled. Please Enable it and Try again' Error บน Ubuntu

Ubuntu เป็น Linux distribution ที่ฟรีและ open source ทั้งหมด โปรแกรมนี้รองรับ Windows 10 และใช้โดยผู้คนมากสำหรับการพัฒนาซอฟต์แวร์ อย่างไรก็ตาม เมื่อเร็วๆ นี้ มีรายงานมาว่าผู้ใช้ไม่สามารถใช้งานได้ และ Error “The WSL Optional Component is not Enabled. Please Enable it and Try Again” ปรากฏขณะพยายามทำเช่นนั้น

วิธีแก้  The WSL Optional Component is not Enabled. Please Enable it and Try again  Error บน Ubuntu

สาเหตุของ “The WSL Optional Component is Not Enabled. Please Enable it and Try Again” Error บน Ubuntu

หลังได้รับรายงานมาจากผู้ใช้หลายคน เราสืบสวนและจัดทำวิธีแก้ชุดหนึ่งให้กำจัดปัญหาได้สมบูรณ์ รวมถึงสาเหตุที่ทำให้ issue ถูกกระตุ้น ดังนี้

  • Disabled Component: ตามที่ error message บ่งชี้ error ถูกกระตุ้นหาก Windows Subsystem for Linux ถูกปิดใช้งาน Windows Subsystem for Linux เป็นฟีเจอร์สำคัญมากและต้องเปิดใช้งานเพื่อให้ Ubuntu ทำงานถูกต้องบน Windows 10 เพราะมันให้ configurations และ distributions สำคัญทั้งหมดที่ Ubuntu ต้องการเพื่อรันได้ถูกต้อง

ตอนเข้าใจลักษณะปัญหาแล้ว ไปที่วิธีแก้ ปฏิบัติวิธีแก้อย่างระมัดระวังตามลำดับเพื่อหลีกเลี่ยง conflict

วิธีที่ 1: เปิด WSL ผ่าน Control Panel

มีหลายวิธีแก้ปัญหา แต่ในขั้นตอนนี้จะใช้เส้นทางง่ายที่สุด คือเปิด WSL ผ่าน Control Panel วิธีทำ:

  1. กด “Windows” + “R” พร้อมกัน เปิด Run prompt
  2. พิมพ์ “Control Panel” กด “Shift” + “Ctrl” + “Enter” ให้สิทธิ์แอดมินวิธีแก้  The WSL Optional Component is not Enabled. Please Enable it and Try again  Error บน Ubuntu
  3. คลิก “View By” เลือก “Small Icons”วิธีแก้  The WSL Optional Component is not Enabled. Please Enable it and Try again  Error บน Ubuntu
  4. คลิก “Programs and Features”
  5. เลือก “Turn Windows Features On or OFF” ใน pane ซ้าย
  6. เลื่อนลงเลือก “Windows Subsystem for Linux”วิธีแก้  The WSL Optional Component is not Enabled. Please Enable it and Try again  Error บน Ubuntu
  7. คลิก “OK” เพื่อเปิดฟีเจอร์
  8. ตรวจสอบ ว่าปัญหายังคงอยู่หรือไม่

วิธีที่ 2: เปิด WSL ผ่าน PowerShell

สามารถเปิด WSL Feature ด้วย Command Prompt ได้อีกด้วย ในขั้นตอนนี้จะ implement คำสั่งใน command prompt เพื่อเปิด WSL Feature วิธีทำ:

  1. กด “Windows” + “R” พร้อมกัน เปิด Run prompt
  2. พิมพ์ “Powershell” กด “Shift”+ “Ctrl” + “Enter” ให้สิทธิ์แอดมิน
  3. พิมพ์คำสั่งด้านล่างกด “Enter”
    Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
  4. รอ จนคำสั่ง execute เสร็จ ตรวจสอบว่าปัญหายังคงอยู่หรือไม่วิธีแก้  The WSL Optional Component is not Enabled. Please Enable it and Try again  Error บน Ubuntu