
เผยแพร่เมื่อวันที่ 25 ตุลาคม 2022 เวลา 09:15 น. EDT
Former Deputy Editor for Security, Linux, DIY, Programming, และ Tech Explained Christian มีประสบการณ์กว้างเป็น Writer และ Editor เผยแพร่ใน Computer Weekly, Linux Format, Tech Radar, ComputerActive และ Titles อื่นๆ
Christian ยังผลิต MakeUseOf's Weekly Show, Really Useful Podcast, จาก 2018-2024
Current Passions ของเขาคือ Cigar Box Guitar, Retro Gaming Site (gamingretro.co.uk) และ Family
การติดตั้ง Raspberry Pi OS Lite เป็นวิธีดีที่สุดได้ Most Out Of Any Raspberry Pi Computer มัน Useful มากบน Older Models และ Pi Zero Series
แต่ถ้าคุณทันใจต้องใช้ Desktop? Raspberry Pi OS Lite ไม่ Ship พร้อม Desktop Environment ดังนั้นคุณควรทำอะไร?
Well คุณไม่ต้อง Switch ไป Standard Raspberry Pi OS แทน คุณสามารถ Install Raspberry Pi's Own Desktop Environment, PIXEL ได้ง่ายๆ
Raspberry Pi OS Lite คืออะไร?
หลาย Operating Systems Available สำหรับ Raspberry Pi วันนี้ แต่ Recommended Option คือ Raspberry Pi OS นี่มาใน 3 Flavors:
- Raspberry Pi OS Lite
- Raspberry Pi OS Full
- Raspberry Pi OS Extended
ใน Most Cases เมื่อ Install Raspberry Pi OS คุณน่าจะ Rely บน Full หรือ Extended Versions ที่ Ship Complete พร้อม Desktop Environment และ Various Apps (Extended มี Apps มากกว่า Full)
แต่สำหรับ Scenarios ที่ไม่ต้องการ Desktop Environment -- เช่น Running Server, หรือ Controlling Robot -- Raspberry Pi OS Lite เป็น Best Option
Based บน Debian 11 (ตอนเขียน) และ Just 338MB In Size (Pre-installation) Raspberry Pi OS Lite ไม่ใช่ Most Lightweight Option สำหรับ Raspberry Pi แต่เป็น Official Lightweight OS
Note ว่ามี 32-bit และ 64-bit Versions ของ Raspberry Pi OS Lite
ทำไมคุณอาจ Switch จาก Lite ไป Desktop
As You Might Have Guessed Raspberry Pi OS Lite Slimline เพราะ No Desktop Environment แตคุณอาจต้องการให้เปลี่ยน อาจมี App ที่คุณต้อง Run หรือ Service ที่ง่ายกว่า Manage ด้วย Mouse แทน Keyboard
คุณอาจแค่ต้อง Access Internet และ Prefer Desktop Web Browser แทน Lynx Text-based Browser (หรือ Other Slower Methods ของการ Access Web Without Browser) มีหลาย Reasons สำหรับ Install Desktop Environment บน Raspberry Pi OS Lite
ตัวอย่าง ใช้ Raspberry Pi OS Lite สำหรับ Barebones Project 最近 หลัง Into Difficulty และ Realize ต้องการ Additional Desktop-only Software Install Desktop Environment กลายเป็น Necessary
While Sticking to Pi's CLI เป็น Preferable ใน Many Cases บางครั้งคุณแค่ต้องการ Desktop
Raspberry Pi OS Desktop Environment คืออะไร?
If You're Thinking of Raspberry Pi OS You're Probably Picturing PIXEL
Using Modified Version ของ LXDE กับ Openbox Stacking Window Manager PIXEL Features Unique Theme ที่ให้ Raspberry Pi Feel Introduced in 2017 It's Certainly Improvement On Basic Desktop Included With Original Raspbian Operating System
As You Know Raspberry Pi OS Full และ Extended Versions Feature PIXEL Desktop As Raspberry Pi OS Lite Does Not หากคุณต้องใช้ Desktop Environment คุณต้อง Install มัน
วิธีติดตั้ง Official PIXEL Desktop บน Raspberry Pi OS Lite
Deciding to Install Desktop บน Raspberry Pi OS Lite Isn't Unusual Consequently Instructions สำหรับการทำเช่นนั้น Relative Straightforward
At the Prompt, Enter:
sudo apt install xserver-xorg raspberrypi-ui-mods
Tap Y เมื่อ Prompted เพื่อ Confirm Installation Note ว่านี้อาจ Take A While แต่ No Further Interaction Required ดังนั้นคุณสามารถ Occupy Yourself Elsewhere จน Completion
Once Basic Desktop Installed ใช้
startx
...to Boot Into Desktop UI หาก Prefer Boot Into Desktop Permanently:
- Run sudo raspi-config
- Select System Options
- Choose Boot/Auto Login
- Select Desktop หรือ Desktop Autologin Depending on Preference
- Select Finish, Then Reboot When Prompted
To Exit to Command Line (As Opposed to Running Terminal Window) Press Ctrl+Alt+F2 This Will Exit Desktop Environment Immediately Dropping You Back In Text-based CLI
You Can Also Undo Permanently Booting Into Desktop:
- Run sudo raspi-config
- Select System Options
- Choose Boot/Auto Login
- Select Console หรือ Console Autologin Depending on Preference
- Select Finish, Then Reboot When Prompted
(The Above Can Also Be Done In Desktop Using Raspberry Pi Configuration Tool Select System > Boot Choose Between To Desktop และ To CLI.)
BONUS: วิธีติดตั้ง GNOME บน Raspberry Pi OS Lite
What If You Wanted To Install Completely Different Desktop Environment บน Raspberry Pi OS Lite? Plenty of Alternatives Available แต่ For Typically Modern Linux Look GNOME Is Strong Contender
Better Still, It's Relatively Straightforward to Install บน Raspberry Pi OS Lite Note, However, That This Is More Suited To 64-bit Version ของ Raspberry Pi OS Lite In Fact, It Probably Won't Be Usable On 32-bit Version
To Do This, Enter:
wget https://github.com/TerraGitHuB/gnomeforpi/archive/refs/heads/stable.zip
Then Unpack the ZIP File:
unzip stable.zip
Change Directory:
cd gnomeforpi-stable
Finally, Run the Installation Script. You Have Two Choices Here:
- sudo ./gnomeforpi-install
- sudo ./gnomeforpi-install –lite
If You Select the First, the Standard Installation Will Be Used; With the Second, Fewer Packages Are Installed, Making the Process Faster. For Example, Chromium Browser Is Installed With the Full Option. Whichever You Choose, Installation Is Going To Take A Few Minutes To Complete.
Midway Through the Process, You'll Be Prompted To Choose Between the Following As the Default Display Manager
- gdm3
- lightdm
Either Option Is Fine, But You May Prefer gdm3 As This Is Designed For Use With GNOME.
The Raspberry Pi Should Automatically Reboot. At the Login Screen, You Can Use Your Usual Credentials, But Log In With the Xorg Display Server. To Do This:
- Click the Settings Cog
- Choose GNOME on Xorg
- Enter Your Credentials
- Click OK
You Should Now See the GNOME Desktop Running on Your Raspberry Pi.
การติดตั้ง Desktop Environment บน Raspberry Pi OS Lite ง่ายมาก
The Most Important Thing to Take from This is that While Reinstalling your Pi's SD Card with a Full OS Might Seem Easier, It Isn't. It Takes Just a Couple of Minutes to Install a Desktop Environment on the Raspberry Pi OS Lite. That Makes It a Far Quicker Solution, and One That Doesn't Overwrite Any Saved Data on the Device.
Better Still, You're Not Limited to the Default PIXEL Desktop as Many Other Desktop Environments Can Be Installed on Raspberry Pi OS.