- 安装ArchLinux
- 常用命令
- 国内镜像
- 常用软件
- Enables context sensitive auto-completion. If this is disabled then all
- possible completions will be listed.
- Multi-line mode allows breaking up the sql statements into multiple lines. If
- this is set to True, then the end of the statements must have a semi-colon.
- If this is set to False then sql statements can’t be split into multiple
- lines. End of line (return) is considered as the end of the statement.
- Destructive warning mode will alert you before executing a sql statement
- that may cause harm to the database such as “drop table”, “drop database”
- or “shutdown”.
- log_file location.
- Default log level. Possible values: “CRITICAL”, “ERROR”, “WARNING”, “INFO”
- and “DEBUG”.
- Log every query and its results to a file. Enable this by uncommenting the
- line below.
- audit_log = ~/.mycli-audit.log
- Timing of sql statments and table rendering.
- Table format. Possible values: ascii, double, github,
- psql, plain, simple, grid, fancy_grid, pipe, orgtbl, rst, mediawiki, html,
- latex, latex_booktabs, textile, moinmoin, jira, vertical, tsv, csv.
- Recommended: ascii
- Syntax Style. Possible values: manni, igor, xcode, vim, autumn, vs, rrt,
- native, perldoc, borland, tango, emacs, friendly, monokai, paraiso-dark,
- colorful, murphy, bw, pastie, paraiso-light, trac, default, fruity
- Keybindings: Possible values: emacs, vi.
- Emacs mode: Ctrl-A is home, Ctrl-E is end. All emacs keybindings are available in the REPL.
- When Vi mode is enabled you can use modal editing features offered by Vi in the REPL.
- Enabling this option will show the suggestions in a wider menu. Thus more items are suggested.
- MySQL prompt
- \t - Product type (Percona, MySQL, Mariadb)
- \u - Username
- \h - Hostname of the server
- \d - Database name
- \n - Newline
- Skip intro info on startup and outro info on exit
- Use alias from —login-path instead of host name in prompt
- Cause result sets to be displayed vertically if they are too wide for the current window,
- and using normal tabular format otherwise. (This applies to statements terminated by ; or \G.)
- keyword casing preference. Possible values “lower”, “upper”, “auto”
- Enable the pager on startup.
- Custom colors for the completion menu, toolbar, etc.
- Completion menus.
- Selected text.
- Search matches. (reverse-i-search)
- The bottom toolbar.
- Search/arg/system toolbars.
- Favorite queries.
- Use the -d option to reference a DSN.
- example_dsn = mysql://[user[:password]@][host][:port][/dbname]
- Jenkins
- VSCode-Insider
- unetbootin
- gwenview
- 常用小部件
- 桌面环境
- 常见问题
安装ArchLinux
下载
到 archlinux下载 中找到合适的资源下载镜像。推荐使用 国内镜像下载。
安装启动盘
这里使用 Ventoy 做PE。
安装
常用命令
修改默认编辑器
在 .bashrc 或 .zshrc 中加入: export EDITOR=/usr/bin/vim
设置镜像
sudo pacman-mirrors -i -c China -m rank
重启桌面
ps -ef | grep plasmashellkill -9 pidkstart5 plasmashell
国内镜像
使用国内源:
## Our main server (Amsterdam, the Netherlands) (ipv4, ipv6, http, https)[archlinuxcn]Server = https://repo.archlinuxcn.org/$arch## OpenTUNA (China CDN) (ipv4, https)[archlinuxcn]Server = https://opentuna.cn/archlinuxcn/$arch## 北京外国语大学 (北京) (ipv4, ipv6, http, https)## Added: 2020-05-18[archlinuxcn]Server = https://mirrors.bfsu.edu.cn/archlinuxcn/$arch## 腾讯云 (Global CDN) (ipv4, http, https)## Added: 2018-11-23[archlinuxcn]Server = https://mirrors.cloud.tencent.com/archlinuxcn/$arch## 网易 (China CDN) (ipv4, http, https)[archlinuxcn]Server = https://mirrors.163.com/archlinux-cn/$arch## 阿里云 (Global CDN) (ipv4, http, https)## Added: 2020-07-03[archlinuxcn]Server = https://mirrors.aliyun.com/archlinuxcn/$arch## 华为云 (Global CDN) (ipv4, http, https)## Added: 2020-10-31[archlinuxcn]Server = https://repo.huaweicloud.com/archlinuxcn/$arch## 清华大学 (北京) (ipv4, ipv6, http, https)[archlinuxcn]Server = https://mirrors.tuna.tsinghua.edu.cn/archlinuxcn/$arch## 中国科学技术大学 (安徽合肥) (ipv4, ipv6, http, https)[archlinuxcn]Server = https://mirrors.ustc.edu.cn/archlinuxcn/$arch## 哈尔滨工业大学 (黑龙江哈尔滨) (ipv4, ipv6, http, https)## Added: 2021-01-09[archlinuxcn]Server = https://mirrors.hit.edu.cn/archlinuxcn/$arch## 浙江大学 (浙江杭州) (ipv4, http, https)## Added: 2017-06-05[archlinuxcn]Server = https://mirrors.zju.edu.cn/archlinuxcn/$arch## 重庆大学 (重庆) (ipv4, ipv6, https)[archlinuxcn]Server = https://mirrors.cqu.edu.cn/archlinuxcn/$arch## SJTUG 软件源镜像服务 (上海) (ipv4, https)## Added: 2018-05-21[archlinuxcn]Server = https://mirrors.sjtug.sjtu.edu.cn/archlinux-cn/$arch## 南京大学 (江苏南京) (ipv4, ipv6, http, https)[archlinuxcn]Server = https://mirrors.nju.edu.cn/archlinuxcn/$arch## 莞工 GNU/Linux 协会 开源软件镜像站 (广东东莞) (ipv4, https)## Added: 2018-11-03[archlinuxcn]Server = https://mirrors.dgut.edu.cn/archlinuxcn/$arch## 南方科技大学 (广东深圳) (ipv4, ipv6, http, https)## Added: 2021-08-17[archlinuxcn]Server = https://mirrors.sustech.edu.cn/archlinuxcn/$arch
来源:
安装:
sudo pacman -Sy && sudo pacman -S archlinuxcn-keyring
在每次启动后,运行 sudo pacman -Syyu 或 paru -Syyu 来重新系统。
常用软件
列表
paru -S --needed zsh jetbrains-toolbox goldendict fcitx5-im fcitx5-rime ranger vim xclip mycli tldr oh-my-zsh virtuallbox nvm deno thefuck pamac iredis rdesktopparu -S --needed wqy-microhei wqy-zenhei wqy-bitmapfont noto-fonts-sc adobe-source-han-sans-cn-fonts adobe-source-han-serif-cn-fontsparu -S --needed ttf-twemoji ttf-twemoji-color ttf-symbola otf-openmoji ttf-mac-fonts
- zsh
- rdesktop
- jetbrains-toolbox
- goldendict
- paru
- fcitx5-im
- fcitx5-rime
- ranger
- vim
- xclip
- mycli
- tldr
- oh-my-zsh
- virtualbox
- nvm
- deno
- thefuck
- pamac
- iredis
-
Paru
install
sudo pacman -S --needed base-develgit glone https://aur.archlinux.org/paru.gitcd parumakepkg -si
使用
paru中常用的一些命令:
paru同步源,并更新系统(同_paru -Syu_)_paru -Sy_仅同步源paru -Su -ignore foo升级时不升级包fooparu -Sua更新当前安装的所有AUR包paru -S foo从repos或AuR安装foo包paru -Ss foo搜索foo包paru -Si foo获取foo包的信息paru abc交互式安装abc包paru -S abc从本地数据库中得到abc的信息,下载安装abc包paru -c删除没有依赖的包paru -U foo安装本地包fooxfce桌面环境
paru -S xfce4 xfce4-goodies
Asbru-cm
远程终端管理器,类似于window下的xshell。安装
paru -S asbru-cm
Remmina
remmina也是一个远程终端管理器。安装
paru -S remmina
ZSH
安装oh-my-zsh
manjaro自带zsh,要额外安装一下.oh-my-zsh插件来让zsh更好用。
安装完成后,会把之前的sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
.zshrc配置文件复制为.zshrc.pre-oh-my-zsh文件。把之前的配置复制到新的zshrc文件底部。
添加插件:
要使用plugins=(gitautojump)
autojump需要安装autojump本身。
安装完成后,要在paru -S autojump
.zshrc中加入以下内容:[[ -s /etc/profile.d/autojump.sh ]] && source /etc/profile.d/autojump.sh
更新oh-my-zsh
omz update
修改主题
安装 powerlevel10k
git clone --depth=1 https://gitee.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
把.zshrc中的ZSH-THEME内容修改为ZSH-THEME='powerlevel10k/powerlevel10k'。
使用自定义插件
如果我们有能力的话,我们可以为使用自定义插件。只要我们把自定义插件放到$HOME/.oh-my-zsh/custom/plugins中并以xxx.plugin.zsh命令,最后在.zshrc文件的plugins字段中添加我们的插件名xx即可。
以自定义deno的自动完成为例:
生成插件内容
deno completions zsh > ~/.oh-my-zsh/custom/plugins/deno.plugin.zsh
修改
.zshrc内容plugins = (gitdeno)
配置zsh
常用插件安装:
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting // 语法高高git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions //自动完成
启用插件:
plugins = (gitdenozsh-syntax-highlightingzsh-autosuggestionscommand-not-foundautojump)
Jetbrains Toolbox
mariadb数据库安装
paru -Syyuparu -S mysqlsudo mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysqlsudo /usr/bin/mysql_secure_installation
postgreSQL数据库安装
paru -Syyuparu -S postgresqlsudo systemctl start postgresql // 启动postgresql服务sudo systemctl enable postgresql //开机启动postgresql服务(可选)sudo su - postgres -c "initdb --locale en_US.UTF-8 -E UTF8 -D '/var/lib/postgres/data'" // 初始化设置sudo su - postgres[postgres@linux ~]$ createuser --interactive //设置postgreSQL用户
mycli
paru -S mycli
配置:
~/.myclirc: ``` [main]
Enables context sensitive auto-completion. If this is disabled then all
possible completions will be listed.
smart_completion = True
Multi-line mode allows breaking up the sql statements into multiple lines. If
this is set to True, then the end of the statements must have a semi-colon.
If this is set to False then sql statements can’t be split into multiple
lines. End of line (return) is considered as the end of the statement.
multi_line = False
Destructive warning mode will alert you before executing a sql statement
that may cause harm to the database such as “drop table”, “drop database”
or “shutdown”.
destructive_warning = True
log_file location.
log_file = ~/.mycli.log
Default log level. Possible values: “CRITICAL”, “ERROR”, “WARNING”, “INFO”
and “DEBUG”.
log_level = INFO
Log every query and its results to a file. Enable this by uncommenting the
line below.
audit_log = ~/.mycli-audit.log
Timing of sql statments and table rendering.
timing = True
Table format. Possible values: ascii, double, github,
psql, plain, simple, grid, fancy_grid, pipe, orgtbl, rst, mediawiki, html,
latex, latex_booktabs, textile, moinmoin, jira, vertical, tsv, csv.
Recommended: ascii
table_format = ascii
Syntax Style. Possible values: manni, igor, xcode, vim, autumn, vs, rrt,
native, perldoc, borland, tango, emacs, friendly, monokai, paraiso-dark,
colorful, murphy, bw, pastie, paraiso-light, trac, default, fruity
syntax_style = vim
Keybindings: Possible values: emacs, vi.
Emacs mode: Ctrl-A is home, Ctrl-E is end. All emacs keybindings are available in the REPL.
When Vi mode is enabled you can use modal editing features offered by Vi in the REPL.
key_bindings = vim
Enabling this option will show the suggestions in a wider menu. Thus more items are suggested.
wider_completion_menu = False
MySQL prompt
\t - Product type (Percona, MySQL, Mariadb)
\u - Username
\h - Hostname of the server
\d - Database name
\n - Newline
prompt = ‘\t \u@\h:\d> ‘
Skip intro info on startup and outro info on exit
less_chatty = False
Use alias from —login-path instead of host name in prompt
login_path_as_host = False
Cause result sets to be displayed vertically if they are too wide for the current window,
and using normal tabular format otherwise. (This applies to statements terminated by ; or \G.)
auto_vertical_output = False
keyword casing preference. Possible values “lower”, “upper”, “auto”
keyword_casing = auto
Enable the pager on startup.
enable_pager = True
Custom colors for the completion menu, toolbar, etc.
[colors]
Completion menus.
Token.Menu.Completions.Completion.Current = ‘bg:#00aaaa #000000’ Token.Menu.Completions.Completion = ‘bg:#008888 #ffffff’ Token.Menu.Completions.MultiColumnMeta = ‘bg:#aaffff #000000’ Token.Menu.Completions.ProgressButton = ‘bg:#003333’ Token.Menu.Completions.ProgressBar = ‘bg:#00aaaa’
Selected text.
Token.SelectedText = ‘#ffffff bg:#6666aa’
Search matches. (reverse-i-search)
Token.SearchMatch = ‘#ffffff bg:#4444aa’ Token.SearchMatch.Current = ‘#ffffff bg:#44aa44’
The bottom toolbar.
Token.Toolbar = ‘bg:#222222 #aaaaaa’ Token.Toolbar.Off = ‘bg:#222222 #888888’ Token.Toolbar.On = ‘bg:#222222 #ffffff’
Search/arg/system toolbars.
Token.Toolbar.Search = ‘noinherit bold’ Token.Toolbar.Search.Text = ‘nobold’ Token.Toolbar.System = ‘noinherit bold’ Token.Toolbar.Arg = ‘noinherit bold’ Token.Toolbar.Arg.Text = ‘nobold’
Favorite queries.
[favorite_queries]
Use the -d option to reference a DSN.
[alias_dsn]
example_dsn = mysql://[user[:password]@][host][:port][/dbname]
<a name="OpES3"></a>## iredisiredis是一个好用的redis管理命令行工具。<a name="WJ1Rw"></a>### 安装```typescriptparu -S iredis
GoldenDict
goldenDict是linux系统中很好用的一个语言翻译工具。
安装
paru -S goldendict
配置词典
- 必应词典 http://cn.bing.com/dict/search?q=%GDWORD%&go=&qs=n&form=CM&pq=developer&sc=8-9&sp=-1&sk=&mkt=zh-CN&setlang=ZH
- 有道 https://cn.bing.com/dict/search?q=%GDWORD%
JetBrianRunner
安装
paru -S --needed plasma5-runners-jetbrains-runner
Rime
安装 表型码输入法
先安装 rime 输入法
yay -S fcitx5-im fcitx-rime
配置 .pam_environment 文件:
GTK_IM_MODULE=fcitx5QT_IM_MODULE=fcitx5XMODIFIERS="@im=fcitx5"
配置 ~/.xprofile 文件:
export GTK_IM_MODULE=fcitx5export XMODIFIERS=@im=fcitx5export QT_IM_MODULE=fcitx5fcitx5 &
配置 ~/.xinitrc 文件:
export GTK_IM_MODULE=fcitx5export XMODIFIERS=@im=fcitx5export QT_IM_MODULE=fcitx5
注意:上述内容需要添加在exec $(get_session)之前
安装完成后,进入到 ~/.local/share/fcitx5/rime 目录中,把设置文件和码表复制到该目录下。文件和码表请到下面下载:
定制
配置UI:
添加 输入法面板 小部件。在 输入法面板 小部件中设置字体和大小。
VimPlus
安装
git clone https://github.com/chxuan/vimplus.git ~/.vimpluscd ~/.vimplus./install.sh
ranger
终端文件管理器
修改默认的文件编辑器:
vim ~/.bashrcexport EDITOR=/usr/bin/vimexport VISUAL=/usr/bin/vim
xclip
功能
安装
yay -S xclip
使用 xclip finename 把文件内容复制到剪贴板中。
Jenkins
切换 java 环境
archlinux-java statussudo archlinux-java set java-8-openjdk/jrearchlinux-java status // should display java-8-openjdk
安装
paru -S jenkins
启动
sudo systemctl start jenkins
访问
http://localhost:8090
重启/退出/重新加载
重启
要想重启jenkins,我们只要在jenkins的访问地址上添加restart即可。本例中即:http://localhost:8090/restart.
退出
要想重启jenkins,我们只要在jenkins的访问地址上添加exit即可。本例中即:http://localhost:8090/exit.
重新加载
要想重启jenkins,我们只要在jenkins的访问地址上添加reload。本例中即:http://localhost:8090/reload.
查看admin密码
sudo cat /var/lib/jenkins/secrets/initialAdminPassword
VSCode-Insider
源码安装
- 下载
- 解压
tar -zxvf code-insider-x64-1615971321.tar.gz 移动到 /opt/ 目录下
sudo mv VSCode-linux-x64 /opt/
添加执行权限
sudo chomd +x /opt/VSCode-linux-x64/code-insiders
在桌面上添加图标
sudo cp /opt/VSCode-linux-x64/resources/app/resources/linux/code.png /usr/share/icons/sudo vim /usr/share/applications/vscode-insider.desktop
[Desktop Entry]Name=VS-Code-InsiderComment=Multi-platform code editor for linuxExec=/opt/VSCode-linux-x64/code-insidersIcon=/usr/share/icons/code.pngType=ApplicationStartupNotify=trueCategories=TextEditor;Development;Utility;MimeType=text/plain;
unetbootin
介绍
安装
paru -S unetbootin
gwenview
安装
paru -S gwenview qt5-imageformats kimageformats
kimageformats和qt5-imageformats都是可选安装的组件。
kimageformats可以使得 gwenview查看psd格式的图片
qt5-imageformats可以使得 gwenview查看webp格式的图片常用小部件
-
桌面环境
KDE桌面
KDE桌面是ArchLinux中自定义最强的一个桌面环境。我们可以把KDE桌面订制成我们想要的样子。可以是
Window风格,也可以是MacOS风格,同样也可以是其他风格。
下面是本人常用的设置:
全局主题: Sweet
图标:Kora
字体:文泉驿微米黑
光标:Sweet或Future cursors
登录屏幕:Beautiful-splash-SSDM9
欢迎屏幕:Animated_abstract在KDE桌面环境下输入Emoji:
使用
window+.即可,macos的键盘对应的的super+.。常见问题:
在我们使用
KDE作为桌面环境的时候,难免会遇到这样或那样的问题。为了方便以后遇到同样的问题可以及早解决,把自己或大家遇到的问题在这里列举一下:外观问题
在安装完全局主题或应用程序风格后,看到不需要的应用程序风格后,找不到删除不需要的应用程序风格的地方
要想删除不需要的应用程序风格,我们只需要在这几个地方把对应的文件删除就可以:
- /usr/share/kstyle/themes/*.themerc
- /usr/share/doc/qt/qtwidgets/images/*.png
- /usr/share/doc/qt/qtdesigner/images/*.png
- /usr/lib/qt/plugins/styles/*.so
记得删除的是不需要的对应的文件,不要都删除哦!
常见问题
修改主目录为英文
把HOME目录改为英文
$ sudo pacman -S xdg-user-dirs-gtk$ export LANG=en_US$ xdg-user-dirs-gtk-update$ #然后会有个窗口提示语言更改,更新名称即可$ export LANG=zh_CN.UTF-8$ #然后重启电脑如果提示语言更改,保留旧的名称即可
微信输入中文乱码
http://linux-wiki.cn/wiki/Wine%E7%9A%84%E4%B8%AD%E6%96%87%E6%98%BE%E7%A4%BA%E4%B8%8E%E5%AD%97%E4%BD%93%E8%AE%BE%E7%BD%AE
打印机服务不可用,错误的文件描述符
有一个可能的原因是 cups 服务没有启动。
sudo systemctl start cups.service // 启动 cupssudo systemctl enable cups.service // 设置 cups 为开机启动
ThinkPad E14 AMD 功能键不能使用的bug修复
discover无法使用
在使用 archlinux的discover安装器的时候,可能会遇到discover当前无法用于安装任何应用程序,这是因为它所需的后端程序均不可用。请将此错误报告给您安装的发行版项目的问题。这是因为我们没有安装必要的安装包packagekit-qt5,只要我们安装上这个包,就可以解决这个问题。然后,重新启动discover即可。
paru -S packagekit-qt5
使用彩色Emoji
要在ArchLinux或Manjaro中使用彩色Emoji,我们需要做三步:
- 安装字体;
- 添加配置文件;
-
安装字体
paru -S noto-fonts-emoji
添加配置文件
在
/etc/fonts/conf.avail/中创建75-noto-color-emoji.conf文件 ```xml <?xml version=”1.0” encoding=”UTF-8”?> <!DOCTYPE fontconfig SYSTEM “fonts.dtd”>emoji Noto Color Emoji sans Noto Color Emoji serif Noto Color Emoji sans-serif Noto Color Emoji monospace Noto Color Emoji Symbola Apple Color Emoji Noto Color Emoji Segoe UI Emoji Noto Color Emoji Segoe UI Symbol Noto Color Emoji Android Emoji Noto Color Emoji Twitter Color Emoji Noto Color Emoji Twemoji Noto Color Emoji Twemoji Mozilla Noto Color Emoji TwemojiMozilla Noto Color Emoji EmojiTwo Noto Color Emoji Emoji Two Noto Color Emoji EmojiSymbols Noto Color Emoji Symbola Noto Color Emoji
<a name="lyqwG"></a>### 添加软链接```xmlsudo ln -sf /etc/fonts/conf.avail/75-noto-color-emoji.conf /etc/fonts/conf.d/
通过Virtual Box安装win11
在我们使用Virtual Box安装win11的过程中,我们可能会遇到一个错误类似于您的设备不符合windows11的最低要求的错误。解决这个问题的方法就是修改注册表。如下:
- 在界面中按下SHIFT+F10调用控制台。
- 在控制台中输入
regedit调起注册表窗口。 - 在 HKEY_LOCAL_MACHINE->SYSTEM->Setup下新建一下LabConfig的选项。在这个选项下新建四个字段,值的类型都为 DWORD(32 位)位,值都为1。它们是:
- BypassTPMCheck
- BypassCPUCheck
- BypassRAMCheck
- BypassSecureBootCheck
无线网络不可用
有时候,我们可能会发现无线网络突然不能用了。这个时候,我们可以使用iw命令行工具来查找原因。在我的一次经历中,我使用了iw dev发现,我本地找不到网络设备。但是可以通过lspci -k命令找到无线网卡。这个时候,可能是无线网卡的接莫名其妙的消失了。在这个时候,我们可以使用iw list来找到无线网卡在系统中的“物理命令”,一般会是phy0之类的字样。然后使用下面的命令修复。
iw phy phy0 interface add wlan0 type station
配置lstp/ipsec的VPN连接
在我们使用lstp/ipsec的VPN的连接的时候,有时候会连接不上。如果我们是使用的networkmanager-l2tp和stronswan的组合的话。我们就可以使用sudo /usr/lib/NetworkManager/nm-l2tp-service --debug命令来调试。如果我们在调试中发现了no acceptable traffic selectors found这样的错误,那么就可能是IKEv1 Cisco Unity Extension出错了。我们有一个选择就是禁用对IKEv1 Cisco Unity Extension的加载。具体方法如下:
编辑
/etc/strongswan.d/charon.conf文件并取消# cisco_unity = no的注释# Send Cisco Unity vendor ID payload (IKEv1 only).cisco_unity = no
创建或修改
/etc/strongswan.d/charon/unity.conf文件,使其包含下面的内容:unity {# Whether to load the plugin. Can also be an integer to increase the# priority of this plugins.load = no}
