最好用的Linux——Manjaro配置

http://panqiincs.me/2019/06/05/after-installing-manjaro/

https://www.jianshu.com/p/4fce765a306b

基本設置

更換國內源

使用國內的源有更快的下載速度,pacman能夠測試不同源的速度並給它們排名,從中選擇一個快的即可。我選擇的是上海交大sjtu的源,下載速度能夠達到10兆每秒。

1
2
3
sudo pacman -Syy
sudo pacman-mirrors -i -c China -m rank
sudo pacman -Syyu

添加arch源

編輯/etc/pacman.conf文件,加入下面的內容:

1
2
3
[archlinuxcn]
SigLevel = Optional TrustedOnly
Server = https://mirrors.sjtug.sjtu.edu.cn/archlinux-cn/$arch

然後

1
sudo pacman -Syy && sudo pacman -S archlinuxcn-keyring

現在可以升級一下系統:

1
sudo pacman -Su

pacman

包管理工具pacman非常強大,常見用法需要學習一下:

1
2
3
4
5
6
7
8
9
10
11
12
13
pacman -S package_name        # 安裝軟件  
pacman -S extra/package_name  # 安裝不同倉庫中的版本
pacman -Syu                   # 升級整個系統,y是更新數據庫,yy是強制更新,u是升級軟件
pacman -Ss string             # 在包數據庫中查詢軟件
pacman -Si package_name       # 顯示軟件的詳細信息
pacman -Sc                    # 清除軟件緩存,即/var/cache/pacman/pkg目錄下的文件
pacman -R package_name        # 刪除單個軟件
pacman -Rs package_name       # 刪除指定軟件及其沒有被其他已安裝軟件使用的依賴關係
pacman -Qs string             # 查詢已安裝的軟件包
pacman -Qi package_name       # 查詢本地安裝包的詳細信息
pacman -Ql package_name       # 獲取已安裝軟件所包含的文件的列表
pacman -U package.tar.zx      # 從本地文件安裝
pactree package_name          # 顯示軟件的依賴樹

常用軟件

下面是我安裝的常用軟件:

1
2
3
4
5
6
7
8
9
10
sudo pacman -S yay                     # AUR助手
sudo pacman -S google-chrome           # 最流行的瀏覽器
sudo pacman -S clang make cmake gdb    # 編譯調試環境
sudo pacman -S visual-studio-code-bin  # 牛逼的編輯器
sudo pacman -S vim                     # 命令行下的編輯器
sudo pacman -S qtcreator               # IDE for Qt
sudo pacman -S wireshark-qt            # 抓包工具
sudo pacman -S git                     # 版本管理工具
sudo pacman -S octave                  # Matlab的開源替代
sudo pacman -S netease-cloud-music     # 網易雲音樂

直接安裝完Wireshark後啓動軟件,會提示/usr/bin/dumpcap無權限,運行下面的命令即可解決問題:

1
sudo gpasswd -a username wireshark  # username是用戶名

中文環境

輸入法

安裝fcitx和搜狗拼音輸入法:

1
2
3
sudo pacman -S fcitx-sogoupinyin
sudo pacman -S fcitx-im
sudo pacman -S fcitx-configtool

設置環境變量,在~/.xprofile文件(如果文件不存在就新建一個)末尾加上:

1
2
3
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS="@im=fcitx"

中文字體

Manjaro默認的中文顯示效果非常差,不美觀也就罷了,還會有很多奇形怪狀的字形(比如“門”,“畫”等字)出現。配置字體效果非常耗費時間,如果想仔細折騰,可以參考如下幾個網頁:

  1. Localization/Simplified Chinese (簡體中文)
  2. Font configuration (簡體中文)
  3. Font Configuration/Chinese (簡體中文)

我參考上面的第3個鏈接中的配置,做了點小修改,效果基本能夠接受。先安裝如下字體:

1
2
3
4
5
sudo pacman -S ttf-roboto noto-fonts ttf-dejavu
# 文泉驛
sudo pacman -S wqy-bitmapfont wqy-microhei wqy-microhei-lite wqy-zenhei
# 思源字體
sudo pacman -S noto-fonts-cjk adobe-source-han-sans-cn-fonts adobe-source-han-serif-cn-fonts

創建文件.config/fontconfig/fonts.conf,加入下面的配置:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">

<fontconfig>

    <its:rules xmlns:its="http://www.w3.org/2005/11/its" version="1.0">
        <its:translateRule translate="no" selector="/fontconfig/*[not(self::description)]"/>
    </its:rules>

    <description>Manjaro Font Config</description>

    <!-- Font directory list -->
    <dir>/usr/share/fonts</dir>
    <dir>/usr/local/share/fonts</dir>
    <dir prefix="xdg">fonts</dir>
    <dir>~/.fonts</dir> <!-- this line will be removed in the future -->

    <!-- 自動微調 微調 抗鋸齒 內嵌點陣字體 -->
    <match target="font">
        <edit name="autohint"> <bool>false</bool> </edit>
        <edit name="hinting"> <bool>true</bool> </edit>
        <edit name="antialias"> <bool>true</bool> </edit>
        <edit name="embeddedbitmap" mode="assign"> <bool>false</bool> </edit>
    </match>

    <!-- 英文默認字體使用 Roboto 和 Noto Serif ,終端使用 DejaVu Sans Mono. -->
    <match>
        <test qual="any" name="family">
            <string>serif</string>
        </test>
        <edit name="family" mode="prepend" binding="strong">
            <string>Noto Serif</string>
        </edit>
    </match>
    <match target="pattern">
        <test qual="any" name="family">
            <string>sans-serif</string>
        </test>
        <edit name="family" mode="prepend" binding="strong">
            <string>Roboto</string>
        </edit>
    </match>
    <match target="pattern">
        <test qual="any" name="family">
            <string>monospace</string>
        </test>
        <edit name="family" mode="prepend" binding="strong">
            <string>DejaVu Sans Mono</string>
        </edit>
    </match>

    <!-- 中文默認字體使用思源宋體,不使用 Noto Sans CJK SC 是因爲這個字體會在特定情況下顯示片假字. -->
    <match>
        <test name="lang" compare="contains">
            <string>zh</string>
        </test>
        <test name="family">
            <string>serif</string>
        </test>
        <edit name="family" mode="prepend">
            <string>Source Han Serif CN</string>
        </edit>
    </match>
    <match>
        <test name="lang" compare="contains">
            <string>zh</string>
        </test>
        <test name="family">
            <string>sans-serif</string>
        </test>
        <edit name="family" mode="prepend">
            <string>Source Han Sans CN</string>
        </edit>
    </match>
    <match>
        <test name="lang" compare="contains">
            <string>zh</string>
        </test>
        <test name="family">
            <string>monospace</string>
        </test>
        <edit name="family" mode="prepend">
            <string>Noto Sans Mono CJK SC</string>
        </edit>
    </match>

    <!-- 把Linux沒有的中文字體映射到已有字體,這樣當這些字體未安裝時會有替代字體 -->
    <match target="pattern">
        <test qual="any" name="family">
            <string>SimHei</string>
        </test>
        <edit name="family" mode="assign" binding="same">
            <string>Source Han Sans CN</string>
        </edit>
    </match>
    <match target="pattern">
        <test qual="any" name="family">
            <string>SimSun</string>
        </test>
        <edit name="family" mode="assign" binding="same">
            <string>Source Han Serif CN</string>
        </edit>
    </match>
    <match target="pattern">
        <test qual="any" name="family">
            <string>SimSun-18030</string>
        </test>
        <edit name="family" mode="assign" binding="same">
            <string>Source Han Serif CN</string>
        </edit>
    </match>
    
    <!-- Load local system customization file -->
    <include ignore_missing="yes">conf.d</include>
    <!-- Font cache directory list -->
    <cachedir>/var/cache/fontconfig</cachedir>
    <cachedir prefix="xdg">fontconfig</cachedir>
    <!-- will be removed in the future -->
    <cachedir>~/.fontconfig</cachedir>

    <config>
        <!-- Rescan in every 30s when FcFontSetList is called -->
        <rescan> <int>30</int> </rescan>
    </config>

</fontconfig>

辦公軟件

WPS Office

WPS Office是金山公司開放辦公套件,兼容微軟Office的格式,真乃良心之作!前不久剛推出WPS Office 2019 For Linux,我覺得非常不錯。WPS可以直接從Manjaro的軟件倉庫中安裝:

1
sudo pacman -S wps-office

安裝完後啓動WPS,可能會彈出窗口,提示“系統缺失字體”。問題原因是WPS For Linux沒有自帶Windows的字體。其他發行版可能需要自己找字體安裝,Manjaro可以用一條命令搞定:

1
sudo pacman -S ttf-wps-fonts

如果需要修改WPS的界面語言,先打開WPS Writer,新建一個文件,界面的右上方有個A字符的按鈕,點進去後,取消勾選“跟隨系統語言”選項,然後選擇你想要的語言即可。

TeXLive

LaTeX是學術出版的標準排版軟件。可以直接從軟件倉庫中安裝,不需要完全安裝,安裝基礎組件以及中文語言包即可:

1
sudo pacman -S texlive-most texlive-langchinese

編輯器TexStudio也是必備的:

1
sudo pacman -S texstudio

桌面操作

默認設置下,單擊鼠標即打開文件,大多數人還是習慣雙擊打開文件。修改方法如下:依次進入System Settings - Desktop Behavior - Workspace,將Click Behavior修改爲Double-click即可。

默認設置下,按Del鍵刪除文件沒有確認提示。按照下面方法添加確認提示:依次進入Control - Configure Dolphin - General - Confirmations,勾選對應項即可。

使用感受

Manjaro的軟件太豐富了,好多直接可以從軟件倉庫中安裝,太方便了!雖然同是滾動發行版,但Manjaro更新沒有openSUSE Tumbleweed那麼頻繁,內核也依然停留在4.x版本。但有過幾次鎖屏後卡死的情況,不知道這個問題在最近的更新中解決了沒有。總體來說,體驗非常完美,不愧是世界排名第一的發行版!

 

 

參考

  1. 人生苦短,我用Manjaro
  2. pacman - ArchWiki
  3. Manjaro Linux + KDE 安裝使用手記
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章