製作linux啟動盤︱ubuntu22.04使用筆記

ubuntu有一個Startup Disk Creator,這個系統自帶程式可以方便的製作usb系統安裝盤。

但是我記的以前我一直用的一個更酷的方法,dd命令,直接把系統寫進usb碟中。但是這個方法我現在找不到了,當時我是在linuxmint的官方幫助文檔裏見到的,已經不知多少年過去了。

製作usb系統棒(來自這裡):

sudo umount /dev/sdb1
sudo dd if=~/Desktop/target.iso of=/dev/sdx oflag=direct bs=1048576

查看usb碟的盤符:

sudo fdisk -l

屏幕亮度

發覺ubuntu22.04有些地方還不如18.04,比如brightness-control,18.04能從最亮調到最黑,而22.04完全用不了。

找了不少辦法,後來是改grub之後重啟,就能調到黑,然而這時只能從很暗調到全黑,想調亮一點卻不行…

最終我滿足於只能調高亮到低亮,魚與熊掌不可兼得。

中文輸入法

我一直忠心的在使用gcin,因為它確實好用。然而,gcin在ubuntu22.04不僅無法使用,還會造成系統錯誤:在安裝完gcin之後,無法打開terminal,連語言設置都不能打開。

寡人只好換ibus-table,這個其實挺好用的。甚至比gcin反應快,如果能去掉「逐漸提示」就更好了。

ibus-table的碼表格式

### File header must not be modified
### This file must be encoded into UTF-8.
### This table under LGPL
### comments start with ### not single #
### Derive from the format of SCIM Table, so you can modify the table from
### scim-tables' table

Ejsoon_Cangjie_Table_Phrase_Library_TEXT
VERSION_202208

### Begin Table definition.
BEGIN_DEFINITION

### License
LICENSE = LGPL

### An unique id to distinguish this table among others.
### Use uuidgen to generate this kind of id.
UUID = 41d16dbb-3765-4b30-8547-9fc7379930f1

### A unique number indicates the version of this file.
### For example the last modified date of this file.
### This number must be less than 2^32.
### Just make your table version-able
SERIAL_NUMBER = 20220805

### ICON can be any format as long as your pygtk can recognized
### the most widely ones are "png" and "svg", letter one is recommended
ICON = ibus-table.svg

### The symbol to be displayed in IM switchers
SYMBOL = 尹

### The default name of this table, this is needed
NAME = Table

### The local names of this table, this is optional
NAME.zh_CN = 尹倉
NAME.zh_HK = 尹倉
NAME.zh_TW = 尹倉

### Description
DESCRIPTION = This is a template engine table for IBus Table.

### Supported languages of this table
### sigle "zh_CN" just be recognized as zh_CN,
### but "zh_CN, zh_HK" or more zh_XX will be recognized as zh;
### and "en_US, zh_CN" will be just ignored.
LANGUAGES = zh_CN,zh_SG,zh_TW,zh_HK

### The author of this table
AUTHOR = Ejsoon <ejsoon@outlook.com> 

### Prompt string to be displayed in the status area, CN will be replaced by
### the gettext tools in runtime as 中.
STATUS_PROMPT = CN

### Valid input chars.
VALID_INPUT_CHARS = abcdefghijklmnopqrstuvwxyz

### Layout
LAYOUT = us

### The max number of input keys for every phrase or character.
MAX_KEY_LENGTH = 5

### Use auto_commit mode as default
AUTO_COMMIT = FALSE

### Automatically selects the first phrase when typing
AUTO_SELECT = FALSE

### Use full width punctuation by default
DEF_FULL_WIDTH_PUNCT = TRUE
### Not use full width letter by default
DEF_FULL_WIDTH_LETTER = FALSE

### Whether user are allow to define phrase, default is true
### You have to define the word construction rules below.
### For input methods which do not input phrases, set this to False
USER_CAN_DEFINE_PHRASE = FALSE

### Whether support PinYin Mode, default is true.
### this feature is just for Chinese, set it to False if your IM is not
### Chinese.
PINYIN_MODE = FALSE

### If true then the phrases' frequencies will be adjusted dynamically
### according your using frequency.
DYNAMIC_ADJUST = FALSE

### Some characters whose frequencies should be fix all the time, e.g. 
### some punctuations
### NO_CHECK_CHARS = 

### Rules for constructing user defined phrase
### "ce" stands for "ci equal", a Chinese English :), means "phrase length
### equal to", thus ce2 -> phrase length equal to 2; and "ca" means "phrase
### length equal or above", so ca4 -> phrase length equal or above 4.
### p21 -> the 1st key of 2nd character in the phrase, and so on.
### Each rule separate via ";". 
### Example below is a complete rule-set, 
### becuase [2,2] ∩ [3,3] ∩ [4,+∞] = [2,+∞], which is the range of length
### of phrase. This have to be satisfied if you need ibus-table to build up
### your own inputed phrase via your daily using.
RULES = ce2:p11+p12+p21+p22;ce3:p11+p21+p22+p31;ca4:p11+p21+p31+p41

### The key strokes to page up the lookup table.
PAGE_UP_KEYS = Page_Up,KP_Page_Up,minus,comma

### The key strokes to page down.
PAGE_DOWN_KEYS = Page_Down,KP_Page_Down,equal,period

### The key strokes to select candidiate phrases.
### Usually "1,2,3,4,5,6,7,8,9" but if this conflicts with
### characters one wants to use for input one can also
### use something like “F1,F2,F3,F4,F5,F6,F7,F8,F9”
SELECT_KEYS = 1,semicolon,apostrophe,4,5,6,7,8,9

### The default orientation of the candidate list
### TRUE means the candidate list is vertical, FALSE means it is vertical
ORIENTATION=FALSE

END_DEFINITION

### Begin Table data.
### Format of every line whose formated in "input_keys\tphrase\tfreq\n" is an
### entry.
### From left to right, the 1st column are the input key combination that you
### entered via keyboard; the 2nd column are presented character or phrase of
### the key combination you want; the 3rd column are frequency of the character
### or phrase.
BEGIN_TABLE
a	日	209030000000
a	曰	209020000000
...
END_TABlE

之後用ibus-table-createdb -s 碼表,生成db之後,放進「/usr/share/ibus-table/tables/」,之後在設置->鍵盤裏面,就可以添加尹倉。

禁用筆記本鍵盤

之前用xinput來禁用筆記本鍵盤,但是到ubuntu22.04不管用了。原因是ubuntu某個新版本開始,啟用wayland。解決方法就是把wayland禁用掉。

根據這篇文章,打開/etc/gdm3/custom.conf,把「WaylandEnable=true」注釋去掉,並改成false。重啟,之後就可以用xinput來禁用筆記本鍵盤:

xinput set-prop 15 "Device Enabled" 0

把以上這行寫入.bashrc中。

安裝Chromium

ubuntu22.04安裝chromium時默認調用snap,然而國內snap不是很好用。這篇文章講了如何自加ppa,之後可以繼續用apt來安裝chromium。

sudo add-apt-repository ppa:saiarcot895/chromium-beta

不過這個源是beta版的。想找個穩定版的ppa沒找到,sudo add-apt-repository ppa:canonical-chromium-builds/stage這個雖然是穩定版,但是不能用。

安裝LAMP

根據這篇文章安裝即可,不過中途的「mysql安全問題」需要另外找辦法解決。安裝php擴展這裏有介紹。

CREATE USER `admin`@`localhost` IDENTIFIED WITH mysql_native_password BY 'yourpass';
GRANT ALL ON linuxconfig.* TO `admin`@`localhost`;
FLUSH PRIVILEGES;

一些必要擴展:

sudo apt install php-{curl,intl,zip,soap,xml,gd,mbstring,bcmath,common,mysqli}

1 thought on “製作linux啟動盤︱ubuntu22.04使用筆記”

Leave a Comment