manjaro usage

包管理工具

  • pacman / pamac (GUI)
  • AUR
  • snap
  • flatpak
  • homebrew

搜索包

初始化

1
2
3
4
# 安装并启用 sshd.service
$ sudo pacman install openssl openssh
$ sudo systemctl enable sshd.service
$ sudo systemctl start sshd.service

pacman

查看帮助

1
2
$ pacman -h
$ pacman -S -h

切换源

1
2
3
4
5
6
# manjaro
# 1. 刷新
$ sudo pacman-mirrors -i -c China -m rank
# 选择合适的源
# 2. 更新
$ sudo pacman -Syy

或选择最近源。

1
$ sudo pacman-mirrors --geoip && sudo pacman -Syyu

参数

1
2
3
4
5
6
7
# -S
-S 安装
-S --needed --noconfirm
--needed: 跳过已经安装到最新版本的包
--noconfirm: 跳过确认

-R 卸载

查看安装的包

1
2
3
4
# 所有安装的包
$ pacman -Q
# 查询指定包
$ pacman -Q vim

搜索包

1
$ pacman -Ss vim

AUR

AUR(Arch User Repository),通常使用 AUR Helpers 安装 AUR 的包。

AUR Helpers

AUR helpers 可以帮助我们搜索、下载、编译 AUR 包,常见的 AUR helpers 有 yay、paru等。

Yay

1
2
3
4
5
sudo pacman -S --needed git base-devel
cd /tmp
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si

Paru

安装

1
2
3
4
$ sudo pacman -S --needed base-devel
$ git clone https://aur.archlinux.org/paru.git
$ cd paru
$ makepkg -si

使用示例

1
2
# 搜索
$ paru -Ss gcc7
1
2
3
4
5
6
7
8
9
10
paru <target> -- Interactively search and install <target>.
paru -- Alias for paru -Syu.
paru -S <target> -- Install a specific package.
paru -Sua -- Upgrade AUR packages.
paru -Qua -- Print available AUR updates.
paru -G <target> -- Download the PKGBUILD and related files of <target>.
paru -Gp <target> -- Print the PKGBUILD of <target>.
paru -Gc <target> -- Print the AUR comments of <target>.
paru --gendb -- Generate the devel database for tracking *-git packages. This is only needed when you initially start using paru.
paru -Bi . -- Build and install a PKGBUILD in the current directory.

其他

可以手动搜索包,然后使用 git clone,并使用命令 makepkg -s 编译,使用命令 makepkg -i 安装,或直接使用 makepkg -is 命令编译安装。也可以通过 pamac 命令使用 aur。

1
2
3
4
5
6
# 安装 pamac
$ pacman -S pamac-cli
# 搜索 aur 包
$ pamac search ttf-ms-fonts --aur
# 安装
$ pamac build ttf-ms-fonts

安装 AUR 包

pamac build pkgp

安装官方包

pamac install pkg

Hyprland

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
sudo pacman -S hyprland 
# yay -S hyprland-git

# tools
## mako 通知
## xdg-desktop-portal-hyprland 通讯
## dolphin 文件管理器
## sddm 桌面显示管理器
## pipewire、wireplumber 屏幕共享
## waybar 状态栏
## hyprpaper 设置壁纸
## brightnessctl 调整亮度
## playerctl 播放控制
## network-manager-applet 网络图形界面
## polkit-kde-agent 权限认证界面
## wl-clipboard 粘贴板
sudo pacman -S sddm dolphin mako pipewire wireplumber xdg-desktop-portal-hyprland waybar hyprpaper brightnessctl playerctl network-manager-applet polkit-kde-agent firefox wl-clipboard uwsm
yay -S cliphist wl-clip-persist eww

# start tools
sudo systemctl enable --now sddm.service

# fonts
sudo pacman -S ttf-dejavu ttf-liberation noto-fonts noto-fonts-cjk noto-fonts-emoji ttf-droid ttf-opensans ttf-fira-code ttf-font-awesome