如何(以及為何)在 Windows 11 上運行 Ubuntu 應用程式

PHPz
發布: 2024-06-19 03:44:02
原創
1034 人瀏覽過

您知道使用 Ubuntu 獨有的應用程式不需要覆蓋您的作業系統嗎?透過在 Windows 11 上使用 Ubuntu 應用程式來釋放 Windows 桌面的真正潛力,透過融合 Linux 和 Windows 的強大功能來增強您的 PC 體驗。

為什麼在 Windows 11 上使用 Ubuntu 應用程式?

將 Ubuntu 新增至 Windows 11 可以存取僅在 Windows 上無法使用的各種免費應用程式。這些也不僅僅是普通的程序;它們幾乎可以在您的電腦上完成任何任務,從增強文件管理到創意專案。例如,如果您正在尋找 Windows 11 上找不到的絕佳照片管理工具,您可以嘗試使用 Shotwell 和 WSL。或者,如果您不喜歡 Windows 上提供的電子郵件應用程序,您可以安裝 Ubuntu 原生 Geary 電子郵件用戶端。有許多很棒的 Ubuntu 專屬應用程式可以提升您的 Windows PC 等級。

此外,如果您喜歡手動製作和編碼,那麼 Windows 和 Ubuntu 的組合會讓您受益匪淺。它簡化了面向 Linux 的專案的工作流程,而無需離開 Windows 環境。無論您的追求是為了享受編碼還是建立重要項目,這種整合都可以減少複雜性並提高生產力。

假設您是從事跨平台專案的開發人員。在 Windows 上使用 Ubuntu 應用程式意味著您可以在 Linux 和 Windows 上輕鬆快速有效地測試您的新專案。相信我:我用 Go 程式語言編寫程序,能夠測試我的程式碼並在 Ubuntu 和 Windows 11 上無縫運行它是非常強大的。

開始之前的要求

在 Windows 11 系統上開始使用 Ubuntu 之前,必須滿足一些要求以確保流程順利進行。在我的測試過程中,直到我安裝了Windows 11 上安裝的最新WSL2 核心軟體包後,WSL 才會運作。 。它將確保 WSL v2 作業系統正確運作。您可以直接從 Microsoft 下載並安裝 EXE 檔案。

除了 WSL2 Kernel EXE 套件之外,您還需要在 Windows 11 的「Windows 功能」區域中啟用「虛擬機器平台」功能。充分利用Ubuntu 的必要條件。使用 WSL 需要修改 Windows 功能,如果沒有管理員權限則無法使用。

啟用適用於Linux 的Windows 子系統(WSL)

Windows 11 上預設不會啟用適用於Linux 的Windows 子系統。來運行Windows PC 上的 Ubuntu 應用程式。

首先,開啟桌面上的 Windows 開始功能表。開啟後,在搜尋框中輸入「開啟或關閉 Windows 功能」。啟動其下方標有「控制台」的圖標,以存取Windows 11 的「新增/刪除功能」區域。子系統」。找到它後,點擊它旁邊的空白框即可啟動此功能。做出選擇後選擇「確定」。

現在已選擇「確定」按鈕,Windows 11 將開始在您的系統上設定 WSL。此設定過程應該需要幾分鐘才能完成。設定完成後,您必須重新啟動 Windows PC。選擇“立即重新啟動”按鈕重新啟動。

重新啟動後,重新登入 Windows 11 桌面。重新登入後,將在 Windows 11 上啟用適用於 Linux 的 Windows 子系統。上安裝Ubuntu 以在Windows 11 中執行Linux 應用程式。打開後,找到“搜尋應用程式、遊戲、電影等”框並點擊它。 How (and Why) to Run Ubuntu Apps on Windows 11

在搜尋框中輸入「Ubuntu」。進入「Ubuntu」後,Microsoft Store 將顯示 Ubuntu 應用程式的各個版本。使用滑鼠選擇“Ubuntu 22.04.3 LTS”。

How (and Why) to Run Ubuntu Apps on Windows 11

選擇「Ubuntu 22.04.3 LTS」後,您將被引導至 Microsoft Store 中的功能頁面。找到“獲取”按鈕並單擊它。選擇「取得」按鈕將啟動 Windows 11 的 Ubuntu 下載。下載完成後,即可在 Windows 開始功能表中存取 Ubuntu。

Ubuntu 22.04.3 LTS 在 Windows 11 上完成安裝後,請存取 Windows 開始功能表,搜尋「Ubuntu 22.04.3 LTS」並啟動它。首次啟動時,Ubuntu 將自動進行自我配置並準備使用。

Ubuntu 在 Windows 11 上完成設定後,您將看到一個空的終端機窗口,準備好與 Windows 11 系統上的 Ubuntu 進行互動。 How (and Why) to Run Ubuntu Apps on Windows 11

基本設定提示

以下是一些用於改善Windows 11 上的WSL 體驗的基本設定提示。 Windows 和Linux 檔案系統整合簡化了 Ubuntu WSL 設定和 Windows 11 桌面之間的檔案移動。以下是如何利用此功能。

若要從 Windows 11 存取 Ubuntu 文件,請先開啟 Windows 資源管理器。打開後,在側邊欄中找到“Linux”企鵝圖示並選擇它。

選擇「Linux」後,將出現一個名為「Ubuntu-22.04」的資料夾。右鍵單擊該資料夾並選擇“固定到快速存取”。此操作使您可以輕鬆地從 Windows 存取您的 Ubuntu 檔案。

若要從 Ubuntu 存取 Windows 文件,請使用 cd 指令導覽至 /mnt/c 資料夾。此方法提供與 Windows 11 C:/ 磁碟機的互動。

cd /mnt/c
登入後複製

更新您的 Ubuntu WSL 應用程式 How (and Why) to Run Ubuntu Apps on Windows 11

不時更新您的 Ubuntu WSL 應用程式是一個很好的做法,否則程式將停止工作。以下是在 Windows 11 上執行此操作的方法。開啟後,執行 apt update 指令檢查 Ubuntu 軟體更新。

sudo apt update
登入後複製

檢查完更新後,可以使用 apt Upgrade 指令來安裝它們。

sudo apt upgrade
登入後複製

啟動和使用 Ubuntu

Windows 11 中的 Ubuntu 有一個帶有 WSL 的終端介面。 WSL 是一個可直接從 Windows 存取的 Linux 系統層,而不是 Windows 桌面之上的 Linux 桌面。

使用 Ubuntu 意味著安裝要在 Windows 11 上使用的軟體包。打開後即可使用。

從這裡,您可以安裝任何您喜歡的應用程式。要在 Windows 11 系統上安裝 Ubuntu 應用程序,請先搜尋應用程式的名稱。您可以使用 apt search 指令進行搜尋。例如,要尋找“wireshark”,請執行以下操作: How (and Why) to Run Ubuntu Apps on Windows 11

apt search wireshark
登入後複製

# 在搜尋結果中尋找您要安裝的程式。然後,使用「apt install programname」指令。例如,要安裝 Wireshark,則為:

sudo apt install wireshark
登入後複製

安裝程式後,您可以使用下列命令直接從終端機啟動它:

nohup program_name & disown
登入後複製

或者,可以從Windows 11 開始功能表啟動應用程式。

與 Windows 11 整合

透過 WSL 安裝應用程式時,它們可以透過將自身安裝到 Windows 11 開始功能表中來很好地整合到 Windows 11 中。若要從 Windows 11 存取已安裝的 WSL 程序,請查看您的程式。每個整合的應用程式都會有一個 Linux 圖示。

WSL 與 Windows 11 的整合非常好。但是,請記住,並非每個應用程式都會建立桌面圖示。有時,您可能需要直接從終端啟動 Ubuntu 程式。通常,您可以透過鍵入其套件名稱並按 Enter 鍵來完成此操作。 How (and Why) to Run Ubuntu Apps on Windows 11

Troubleshooting Common Setup Issues

WSL usually installs without a hitch on Windows 11. However, if you're having issues, there is a quick and easy fix. First, open up PowerShell in Windows 11. Once it is open, use the update command for WSL. Updating WSL will install various patches and fixes that are sure to alleviate the issues you're experiencing.

wsl --update
登入後複製

Alternatively, if updating doesn't help, consider re-installing Ubuntu WSL again by following the installation instructions in the "Setup" portion of this guide.


WSL upgrades your Windows 11 experience by bringing Ubuntu apps to your desktop without the hassle of virtualization. Jump into Ubuntu and WSL to enhance the power of your Windows 11 PC and discover new possibilities in computing.

以上是如何(以及為何)在 Windows 11 上運行 Ubuntu 應用程式的詳細內容。更多資訊請關注PHP中文網其他相關文章!

來源:howtogeek.com
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!