Pacman使用

pacman 介绍

在使用pacman之前, 需要使用pacman-mirros命令修改镜像.

安装指令 S

1
2
3
4
5
6
7
pacman -S package_name  # S => Sync 安装
pacman -Sy package_name # y => refresh 获取最新的软件情况
pacman -Syy package_name # 强行获取最新的软件情况
pacman -Su   # u => update 更新软件
pacman -Syyu # 强行更新软件源并更新软件
pacman -Ss ^vim # s => search 搜索以vim开头的软件
pacman -Sc  #c => cached 删除安装包缓存n

查询安装情况 Q

1
2
3
4
5
6
pacman -Q # Q => query 查询package数据库,列出安装的宏包
pacman -Qe # e => explicit 自己安装的软件,排除系统安装软件
pacman -Qeq # q => quiet 不显示版本号
pacman -Qs keyword # s => search 搜索本地安装软件
pacman -Qdt # t => unrequired d => deps 显示不被需要的孤包
pacman -R $(pacman -Qdtq) => 卸载不被需要的孤包

删除指令 R

1
2
3
4
5
pacman -R package_name  # R => remove 卸载
pacman -Rs package_name # s =>`recursive` 同时卸载依赖
pacman -Rsu package_name # u => unused 
pacman -Rns package_name # n => nosave 删配置
pacman -R $(pacman -Qdtq) => 卸载不被需要的孤包

编辑pacman

1
2
3
4
5
6
7
8
- #color
+  color

+ # at the end of file 
+ # add mirror of china need create file  /etc/pacman.d/archlinuxcn
+ [archlinuxcn]
+ SigLevel = Optional TrustedOnly
+ Include = /etc/pacman.d/archlinuxcn

使用AUR

1
2
3
4
sudo pacman -S base-devel
git clone https://aur.archlinux.org/yay.git
cd yay && makepkg -si
yay --aururl "https://aur.tuna.tsinghua.edu.cn" --save

树莓派安装方法

如果树莓派上没编译通过, 可使用如下方法解决

  1. Go to releases page: here
  2. Download the aarch64 one into the RPi. Example: sudo pacman -S wget; wget https://github.com/Jguer/yay/releases/download/v10.2.0/yay_10.2.0_aarch64.tar.gz
  3. Extract the contents into a directory and remove the tar.gz: tar -xvzf yay_*_aarch64.tar.gz; rm yay_*_aarch64.tar.gz
  4. Move the directory to /opt or somewhere else: sudo mv yay_*_aarch64 /opt/yay_aarch64
  5. Symlink the yay executable in the moved directory to /usr/bin/yay: sudo ln -s /opt/yay_aarch64/yay /usr/bin/yay

SMB的使用

1
2
3
4
5
6
7
$ sudo pacman -S samba
$ sudo systemctl  enable smb
Created symlink /etc/systemd/system/multi-user.target.wants/smb.service → /usr/lib/sy
stemd/system/smb.service.
$.....#中间报错了 重启就好了..有点怪异...省略
$ sudo nvim /etc/samba/smb.conf
$ sudo smbpasswd -a cooper # 添加用户

不知怎么的问题就解决了; 如果有报错重启试一下

Samba - ArchWiki

updatedupdated2023-06-052023-06-05
Update https-ca.md