Manjaro 初体验
2024-09-18 02:46:04 # Technical # Linux

简单记录下 Manjaro 的折腾过程

下载镜像

直接到 官网 下载合适的镜像即可(x86 + KDE)

制作启动 U 盘

目前暂时先在虚拟机中运行,试试效果

更新系统

1
$ sudo pacman -Syyu

让 Manjaro 使用 LocalTime,解决与 Windows 共存主板时间冲突问题:

1
$ sudo timedatectl set-local-rtc true

AUR 管理工具

1
sudo pacman -S yay

Emoji Support

1
$ sudo pacman -S noto-fonts-emoji

代理工具

合适好用的代理工具是决定一个系统是否好用的关键

这里根据 novice 的推荐,选择了 mihomo

先搜索 mihomo 相关的包

1
$ yay -Ss mihomo

然后选择 mihomo-bin 1.18.4-1 进行安装

1
$ yay -Sy mihomo-bin

安装完成后到 /etc/mihomo 下创建配置文件 config.yaml

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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
######### 锚点 start #######
# 策略组相关
pr: &pr {type: select, proxies: [默认,香港,台湾,日本,新加坡,美国,其它地区,全部节点,自动选择,直连]}

#这里是订阅更新和延迟测试相关的
p: &p {type: http, interval: 3600, health-check: {enable: true, url: https://www.gstatic.com/generate_204, interval: 300}}

######### 锚点 end #######

# url 里填写自己的订阅,名称不能重复
proxy-providers:
provider1:
<<: *p
url: ""

provider2:
<<: *p
url: ""

ipv6: true
allow-lan: true
mixed-port: 7890
unified-delay: false
tcp-concurrent: true
external-controller: 127.0.0.1:9090
external-ui: ui
external-ui-url: "https://github.com/MetaCubeX/metacubexd/archive/refs/heads/gh-pages.zip"

geodata-mode: true
geox-url:
geoip: "https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geoip-lite.dat"
geosite: "https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geosite.dat"
mmdb: "https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/country-lite.mmdb"

find-process-mode: strict
global-client-fingerprint: chrome

profile:
store-selected: true
store-fake-ip: true

sniffer:
enable: true
sniff:
HTTP:
ports: [80, 8080-8880]
override-destination: true
TLS:
ports: [443, 8443]
QUIC:
ports: [443, 8443]
skip-domain:
- "Mijia Cloud"

tun:
enable: true
stack: mixed
dns-hijack:
- "any:53"
auto-route: true
auto-detect-interface: true

dns:
enable: true
listen: :1053
ipv6: true
enhanced-mode: fake-ip
fake-ip-filter:
- "*"
- "+.lan"
- "+.local"
nameserver:
- https://doh.pub/dns-query
- https://dns.alidns.com/dns-query
proxy-server-nameserver:
- https://doh.pub/dns-query
nameserver-policy:
"geosite:cn,private":
- https://doh.pub/dns-query
- https://dns.alidns.com/dns-query
"geosite:geolocation-!cn":
- "https://dns.cloudflare.com/dns-query#dns"
- "https://dns.google/dns-query#dns"
proxies:
- name: "直连"
type: direct
udp: true
proxy-groups:
- {name: 默认, type: select, proxies: [自动选择, 直连, 香港, 台湾, 日本, 新加坡, 美国, 其它地区, 全部节点]}
- {name: dns, type: select, proxies: [自动选择, 默认, 香港, 台湾, 日本, 新加坡, 美国, 其它地区, 全部节点]}
- {name: Google, <<: *pr}
- {name: Telegram, <<: *pr}
- {name: Twitter, <<: *pr}
- {name: Pixiv, <<: *pr}
- {name: ehentai, <<: *pr}
- {name: 哔哩哔哩, <<: *pr}
- {name: 哔哩东南亚, <<: *pr}
- {name: 巴哈姆特, <<: *pr}
- {name: YouTube, <<: *pr}
- {name: NETFLIX, <<: *pr}
- {name: Spotify, <<: *pr}
- {name: Github, <<: *pr}
- {name: 国内, type: select, proxies: [直连, 默认, 香港, 台湾, 日本, 新加坡, 美国, 其它地区, 全部节点, 自动选择]}
- {name: 其他, <<: *pr}

#分隔,下面是地区分组
- {name: 香港, type: select , include-all-providers: true, filter: "(?i)港|hk|hongkong|hong kong"}
- {name: 台湾, type: select , include-all-providers: true, filter: "(?i)台|tw|taiwan"}
- {name: 日本, type: select , include-all-providers: true, filter: "(?i)日|jp|japan"}
- {name: 美国, type: select , include-all-providers: true, filter: "(?i)美|us|unitedstates|united states"}
- {name: 新加坡, type: select , include-all-providers: true, filter: "(?i)(新|sg|singapore)"}
- {name: 其它地区, type: select , include-all-providers: true, filter: "(?i)^(?!.*(?:🇭🇰|🇯🇵|🇺🇸|🇸🇬|🇨🇳|港|hk|hongkong|台|tw|taiwan|日|jp|japan|新|sg|singapore|美|us|unitedstates)).*"}
- {name: 全部节点, type: select , include-all-providers: true}
- {name: 自动选择, type: url-test, include-all-providers: true, tolerance: 10}

rules:
- DOMAIN-REGEX,^ad.*com,REJECT
- DOMAIN-SUFFIX,jetbrains.com,DIRECT
- DOMAIN-SUFFIX,cocopilot.org,DIRECT
- GEOIP,lan,直连,no-resolve
- GEOSITE,biliintl,哔哩东南亚
- GEOSITE,ehentai,ehentai
- GEOSITE,github,Github
- GEOSITE,twitter,Twitter
- GEOSITE,youtube,YouTube
- GEOSITE,google,Google
- GEOSITE,telegram,Telegram
- GEOSITE,netflix,NETFLIX
- GEOSITE,bilibili,哔哩哔哩
- GEOSITE,bahamut,巴哈姆特
- GEOSITE,spotify,Spotify
- GEOSITE,pixiv,Pixiv
- GEOSITE,CN,国内
- GEOSITE,geolocation-!cn,其他

- GEOIP,google,Google
- GEOIP,netflix,NETFLIX
- GEOIP,telegram,Telegram
- GEOIP,twitter,Twitter
- GEOIP,CN,国内
- MATCH,其他

proxy-providers 下的 url 填入自己的订阅地址即可

路由规则

rules 下的路由规则可根据自己的需求进行配置

优先级将按照 从上到下 的顺序进行匹配,列表顶部的规则优先级高于其底下的规则

如请求为 udp,而代理节点没有 udp 支持 (例如 ss 节点没写 udp: true),则会继续向下匹配

DOMAIN

完整域名匹配

e.g.

1
2
rules:
- DOMAIN,ad.com,REJECT

DOMAIN-SUFFIX

域名后缀匹配

e.g.

1
2
rules:
- DOMAIN-SUFFIX,google.com,PROXY

DOMAIN-KEYWORD

域名关键字匹配

e.g.

1
2
rules:
- DOMAIN-KEYWORD,google,PROXY

DOMAIN-REGEX

域名正则表达式匹配

e.g.

1
2
rules:
- DOMAIN-REGEX,^abc.*com,PROXY

GEOSITE

GeoSite 内的域名匹配

e.g.

1
2
rules:
- GEOSITE,youtube,PROXY

GEOIP

IP 所属国家代码匹配

e.g.

1
2
rules:
- GEOIP,CN,DIRECT

IP-CIDR & IP-CIDR6

IP 地址范围匹配,IP-CIDRIP-CIDR6 的效果是一样的,IP-CIDR6 只是一个别名

e.g.

1
2
3
rules:
- IP-CIDR,127.0.0.0/8,DIRECT,no-resolve
- IP-CIDR6,2620:0:2d0:200::7/32,auto

IP-SUFFIX

IP 后缀范围匹配

e.g.

1
2
rules:
- IP-SUFFIX,8.8.8.8/24,PROXY

IP-ASN

IP 所属 ASN 匹配

e.g.

1
2
rules:
- IP-ASN,13335,DIRECT

SRC-GEOIP

来源 IP 所属国家代码匹配

e.g.

1
2
rules:
- SRC-GEOIP,cn,DIRECT

SRC-IP-ASN

来源 IP 所属 ASN 匹配

e.g.

1
2
rules:
- SRC-IP-ASN,

SRC-IP-CIDR

来源 IP 地址范围匹配

e.g.

1
2
rules:
- SRC-IP-CIDR,192.168.1.201/32,DIRECT

SRC-IP-SUFFIX

来源 IP 后缀范围匹配

e.g.

1
2
rules:
- SRC-IP-SUFFIX,192.168.1.201/8,DIRECT

DST-PORT

请求目标端口范围匹配

e.g.

1
2
rules:
- DST-PORT,80,DIRECT

SRC-PORT

请求来源端口范围匹配

e.g.

1
2
rules:
- SRC-PORT,7777,DIRECT

IN-PORT

入站端口匹配,可用端口范围

e.g.

1
2
rules:
- IN-PORT,7890,PROXY

IN-TYPE

入站类型匹配

e.g.

1
2
rules:
- IN-TYPE,SOCKS/HTTP,PROXY

IN-USER

入站用户名匹配,支持使用 / 分隔多个用户

e.g.

1
2
rules:
- IN-USER,mihomo,PROXY

IN-NAME

入站名称匹配

e.g.

1
2
rules:
- IN-NAME,ss,PROXY

NETWORK

匹配 tcp 或者 udp

e.g.

1
2
rules:
- NETWORK,udp,DIRECT

RULE-SET

引用规则集合,需配置 rule-providers

e.g.

1
2
rules:
- RULE-SET,providername,proxy

SUB-RULE

匹配至子规则

e.g.

1
2
rules:
- SUB-RULE,(NETWORK,tcp),sub-rule

MATCH

匹配所有请求

e.g.

1
2
rules:
- MATCH,auto

web 管理工具

yacd

IDEA

到官网下载 .tar.gz 后缀的安装包

解压按照包

1
$ tar -zxvf <安装包>

/usr/share/applications 创建 idea.desktop 快捷方式

1
2
3
4
5
6
7
8
9
10
[Desktop Entry]
Name=IdeaIU
Comment=IdeaIU
Exec=<idea安装目录下/bin/idea.sh>
Icon=<idea安装目录下/bin/idea.png>
Terminal=false
Type=Application
Categories=Application;
X-Deepin-CreatedBy=com.deepin.dde.daemon.Launcher
X-Deepin-AppID=idea

Docker & Docker Compose

安装 docker

1
$ sudo pacman -Syu docker

启用并启动 docker 服务

1
2
$ sudo systemctl enable docker.service
$ sudo systemctl start docker.service

将当前用户添加到 docker 组

1
$ sudo usermod -aG docker $USER

注销并登陆后生效

安装 docker compose

1
2
3
$ DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
$ mkdir -p $DOCKER_CONFIG/cli-plugins
$ curl -SL https://github.com/docker/compose/releases/download/v2.27.0/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose

给 docker compose 添加执行权限

1
$ chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose

Typora & PicGo

搜索 typora 版本

1
$ yay -Ss typora

安装最后的免费版

1
$ yay -S typora-free

安装完成后,到 typora 中打开 偏好设置...->图像->上传服务设定 选择 PicGo-Core (Command line) 然后点击 下载或更新,等待安装

结束后,点击 打开配置文件,配置 github 仓库相关信息

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{
"picBed": {
"current": "github",
"github": {
"repo": "<自己的仓库名>",
"branch": "<分支>",
"token": "<github的token>",
"path": "<在仓库下再建一个img文件夹,可以为空>",
"customUrl": "<可以直接配置github的地址,或者其他cdn,如jsdelivr>"
},
"uploader": "github",
"transformer": "path"
},
"picgoPlugins": {
"picgo-plugin-github-plus": true
}
}