owned this note changed 2 years ago
Published Linked with GitHub

CCNS 定期聚

Steam 的掌上遊戲機都裝 Linux 了
你的電腦也該裝了吧


什麼是 Linux?

Linux kernel 是作業系統核心
提供一個作業系統運作所需的基本功能

使用包裝好 Linux kernel 的發行版(distro)
手機 伺服器 嵌入式裝置
個人電腦?

Note:
Linux kernel 是作業系統核心,提供一個作業系統運作所需的基本功能
普存在於手機與伺服器及嵌入式裝置
一般我們使用的是 Linux kernel 的發行版 (distro)
發行版是 kernel 再加上一些其他軟體(library, GNU tool chain, file manager, window manager, package manager)的軟體套裝,使其成為一個可以日常使用的作業系統

大家最常聽到的 Ubuntu 就是一種發行版(distro)
還有一些發行版像是 Rocky, Redhat Enterprise 是針對伺服器的發行版,Raspberry Pi OS 則是給樹梅派的發行版

先調查一下現場聽眾的背景再決定要講多少
options - 沒聽過、聽過而已、有用過裝好的、有自己裝過 desktop/server、有動手改過


什麼是 Linux desktop?

Linux desktop 泛指具備圖形界面
給一般使用者日常使用的發行版

kernel
+
library GNU tool chain file manager windows system package manager browser

Debian Fedora Android


GNU GPLv2

Linux kernel 採 GNU GPLv2 授權釋出
是促使 GNU/Linux 遍布全世界的關鍵之一

詳細請看 啊是多開放?

Note:
tl;dr - 使用者可以任意的使用、修改、散佈,但是原始碼同時也必須使用 GPLv2 授權釋出


這麼多發行版怎麼選?









https://distrowatch.com/ > 1000 種!


知名、新手友善 Ubuntu, elementary, Pop!OS
老牌 Debian, Fedora, OpenSuSE
進階使用者 Arch, Gentoo, LFS, Kali
伺服器 RHEL, Rocky, CentOS

Note:
每個發行版各有特色
可以基於某個發行版進行改造,變成另一個發行版
Debian 系
Fedora 系
Opensuse
最常見的 Ubuntu 屬於 Debian 的分支版,Ubuntu 又還有 Lubuntu, Kubuntu, Ubuntu bridge,由 Canonical 開發
新手友善發行版:popos, elementary, zorin,以及各基於 Ubuntu 的衍伸版
ArchLinux 社群維護,滾動更新
其他 rolling: Manjaro, Tumbleweed. Artix
Gentoo
LFS
Steam deck 使用基於 Arch Linux 改裝的發行版,據說會有自己的 repository


什麼是桌面環境?(DE)

早期的電腦沒有圖形界面,僅可透過文字界面與系統互動
桌面環境是在圖形界面上處理使用者輸入與視窗輸出、編排的一整套程式

1996 1996 1997 2006 2010
Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

KDE
Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

xfce
Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Gnome
Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

LXDE
Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Unity

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →
現在的終端機模擬器所支援的各種 escape sequence 還有 vim 的 h j k l 方向鍵
都是以前終端機的所確實在使用的組合鍵及鍵位

Note:
精準講法 - 僅可使用 command line interface(cli) 在終端機上透過 shell 與系統互動
KDE 與 gnome 是最常見的兩種 DE,如果是筆電建議裝 gnome,本身設計上比較面向筆電。Gnome 作為 Ubuntu 的預設桌面(Ubuntu 曾經有一段時間想一統所有裝置而採用 Unity,但是後來失敗就改回 Gnome 了)基本上可以說是有最多的使用者,各式各樣奇怪怪的插件都有,有問題也好解決。Steam deck 是用 KDE 因為比較像 Windows。Gnome 自帶 Js 執行環境,十分方便開發插件,主題也是用 CSS ,如果你是網頁開發者應該會很好上手。KDE 的好東西大部分也都會被搬過來
要簡潔一點可以用 xfce,手不想離開鍵盤 wm 可以換 i3 (r/unixporn 上的炫砲截圖很多是 i3,極度 geek 那種)

真的想要長的像 mac 或 Windows: how to make gnome looks like windows and mac

https://en.wikipedia.org/wiki/IBM_2250






魔改 Gnome

想改的像 windows 或 mac 也可以

Gnome demo


Shell theme
Application theme
Icon
Cursor (沒有無名小站那麼花俏)
Tons of extension
Gnome-Look.org

可以改的超浮誇: r/unixporn
例如 wm 換 i3,變得很 geek



Fedora, Debian, Ubuntu, SUSE Linux Enterprise, Red Hat Enterprise Linux, CentOS, Pop!_OS, Oracle Linux, Endless OS, Tails, Solaris

預設使用 Gnome


Linux desktop 優點

  • 深度客製化,界面隨心所欲
  • 龐大的社群及自製內容,且任何人都可以回饋及協助開發(翻譯!)
  • 開發者友善,自帶多種工具以及 package manager
  • 原生的使用 Linux 上的技術:
    QEMU/KVM, anbox, dockeretc.

  • Valve 的加持下會有更多使用者及開發者投入
  • 不太需要裝防毒軟體
  • 不會被強迫更新
  • 沒有使用者行為追蹤,沒有強迫登入帳號
  • Win11 更新的一大亮點就是大幅改進的 WSL
    • 直接裝 Linux 就好了,幹麻綁手綁腳

Note:
package manager: 這才是安裝軟體的正確姿勢,winodws 簡直自殘


Linux desktop 缺點

  • 耗電量
  • 中文輸入法後繼無人
  • 還是需要一點門檻,非開箱即用
  • 普及率不高而較少預裝和軟體支援
  • 應用程式打包的格式不一樣所帶來的碎片化。為什麼不一樣?因為
  • Snap store? Flatpak? Appimage?
    🗳️

Linus Torvalds on why desktop Linux sucks (2014)

大多數觀點放到今天仍舊為真

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →


No Adobe !

Creative Software Alternatives
GIMP inkscape blender Darktable/RawThearapy kdenlive/Olive Ardour/VCVRack

more alternatives

Note:
偷曬作品
Linus: 需要 pre-installed (目前只有 dell 和一些專門賣 Linux 硬體的廠商
no PS on Linux :(


動手裝起來

如果害怕,可以先用虛擬機試試看!


Ubuntu/Pop!OS/ElementaryOS 安裝

下載 .iso 並製作 Live boot USB

  • Windows: use rufus
  • Linux/Mac: dd if=/path/to/iso of=/path/to/device

Boot with your flash drive

在開機後有製造商 logo 的時候瘋狂按 delete, F11 或 F12

In UEFI:

  • secure boot off
  • adjust boot device order



直接進入暫時的系統使用或真的裝起來

Note: 圖片來源


選擇語言、時區、鍵盤配置


第三方可以考慮勾一下,可避免掉一些驅動問題


硬碟分割、格式化: 雙系統? 只裝 Linux?

若 Windows 和 Linux 要裝在同一顆硬碟,必須共用 EFI 分割區


也可以用 Windows 的分割工具分割
同磁碟上有 winodws 的話建議就用 windows 分割工具


填寫使用者資料


watch it install


Add ccns repository


如何使用 Ubuntu 的 package manager apt
或是使用內建應用程式商店




Note:
https://www.reddit.com/r/linuxmasterrace/comments/b28ug4/i_use_arch/


btw I use Arch


Arch Linux 安裝大致流程

想試試看的話可以先用最新的官方安裝腳本玩玩看。docker 版不建議,據說問題多

安裝參考文件:

Arch Wiki 是 Linux 知識寶庫,及便是其他發行版使用者也可以參考

Note:
The Arch friend


硬碟分割

  • fdisk -l
  • fdisk /dev/the_disk_to_be_partitioned
  • 仔細閱讀 official guide 再依據機器狀況決定要怎麼割
  • Wiki: Duel boot with Windows

格式化

  • mkfs.ext4 /dev/root_partition
  • 或其他格式

掛載

  • mount /dev/root_partition /mnt

安裝主要系統

  • pacstrap /mnt base linux linux-firmware

設定系統(包含設定使用者跟密碼)

  • 產生 fstab 檔案 genfstab -U /mnt >> /mnt/etc/fstab
  • 別忘了 arch-chroot /mnt 再進行其他設定

安裝 Boot Loader

  • 如果是用 grub 記得配 os-prober,自動偵測讚

安裝路連線套件

  • wiki 上說可能需要裝但是我覺得一定要裝不然沒有固定 IP 的會不能連網
  • Network Managers 選一個裝Gnome 就裝 NetworkManager,懶得選就全家桶 Systemd-Networkd,不然至少也要有 dhcpcd 來索取 IP

重開機


安裝圖形化界面

  • Gnome: pacman -S gnome gnome-extra, systemctl enable gdm

Add ccns repository
and
anything else you want


常見問題

Display driver:
wayland + N 卡 = 祝你好運!
如果開機開到螢幕黑不會動可以先加 nomodeset 參數,暫時能開機後換成 NVIDIA 的驅動或是直接換成 X11

Windows 升級或是筆電電池沒電都有可能會重製 UEFI 設定


CCNS 鏡像站

Arch Linux Rocky Linux Alpine Linux CentOS Ubuntu/Debian

Note:
解釋鏡像站


Pre-installed linux

Linux laptop

Dell XPS, framework, Librem 14, pine book, Musicha musictop, System76 laptops
(no msi, no asus, no acer)


Linux phone

distro: Ubuntu touch, Manjaro, Arch, Mobian, postmarketOS
Hardware: pine phone, Librem 5, Fairphone
https://fosstodon.org/@linmob


Linux watch

Pine Time


推薦安裝的工具

  • 小提醒:建議網路上查到的指令不要就直接複製貼上,先看懂再貼
  • Nyan Cat
  • Audio: Carla
    Linux Audio Production 是另一個很有趣的議題
  • VirualCam: v4l2loopback kernel module
  • Gconnect/Kconnect: 連接電腦和手機

  • PowerTOP
  • Wine/proton: 跑那些 windows only 的東西
  • QEMU + KVM: 效率比較接近原生
  • EastEffect: 給音訊輸出加點效果

Note:
Wine/proton 有點肥,因為基本上他就是把整個 windows 應用程式所需的 Library 和 runtime 都搬過來了


偷推廣

  • 遊戲引擎請愛用 Godot (MIT),不要用坑一堆又跟不上時代的 Unity
  • Linux 上的數位音樂製作資源多又有彈性的工作流程還有超低延遲的 kernel

進階議題

What are those partitions?


Wayland vs X11


Systemd, Yay?Nay?


User 權限, root , sudoer(doas)


目錄結構


How a system is booted


fstab


Swap, zram and OOM killer


r/unixporn


COSCUP arch 議程軌


audio server - ALSA? Jack? Pipiewire?


Windows System


Everything is a file


換 kernel、kernel module


對 Linux kernel 更進階的內容有興趣的話歡迎一起挑戰下學期的 jserv 開的 「Linux 核心設計」「Linux 核心實作和改進」



Canonical 的春秋大夢 - Unity


Linux 相關笑話


We've all been there
https://twitter.com/nixcraft/status/1383700478547034124

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →
歡迎踏入 Linux 的世界!
Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

https://discord.ccns.io

Note:
感謝 CCNS 讓我有機會可以上台和大家分享
有任何疏失歡迎指正


Linux Audio

Distro: Ubuntu Studio, AV Linux, KX Studio

Select a repo