新聞中心
Pacman 是一個軟件包管理器,作為ArchLinux發(fā)行版的一部分。簡單來說,就是和apt-get之于Ubuntu一樣,pacman就是Arch的apt-get。要想輕松玩轉(zhuǎn)Arch,學(xué)會pacman是必需的,下面為大家詳細(xì)講解一下Pacman命令使用方法。

堅守“ 做人真誠 · 做事靠譜 · 口碑至上 · 高效敬業(yè) ”的價值觀,專業(yè)網(wǎng)站建設(shè)服務(wù)10余年為成都成都會所設(shè)計小微創(chuàng)業(yè)公司專業(yè)提供成都企業(yè)網(wǎng)站建設(shè)營銷網(wǎng)站建設(shè)商城網(wǎng)站建設(shè)手機網(wǎng)站建設(shè)小程序網(wǎng)站建設(shè)網(wǎng)站改版,從內(nèi)容策劃、視覺設(shè)計、底層架構(gòu)、網(wǎng)頁布局、功能開發(fā)迭代于一體的高端網(wǎng)站建設(shè)服務(wù)。
環(huán)境
Archlinux 2020.04
使用pacman安裝程序包
可以使用pacman同時安裝一個或者多個程序包
root@archlinux> pacman -S --noconfirm apache
-S:安裝應(yīng)用程序。 --noconfirm:安裝時自動確認(rèn)安裝。
刪除程序包
刪除程序包,但不刪除依賴包:
root@archlinux> pacman -R --noconfirm apache
刪除程序包,并且刪除依賴包:
root@archlinux> pacman -Rs apache –noconfirm
升級 包
Pacman提供了一種更新Arch Linux的簡單方法。您只需使用一個命令即可更新所有已安裝的程序包。這可能需要一段時間,具體取決于系統(tǒng)的更新程度。
使用-Syu選項,可以更新所有已經(jīng)安裝的軟件包。
root@archlinux> pacman -Syu
搜索程序包
搜索本地已經(jīng)安裝的程序包,使用-Q選項:
# 列出所有的程序包
root@archlinux> pacman -Q
acl 2.2.53-2
archlinux-keyring 20200422-1
argon2 20190702-2
attr 2.4.48-2
audit 2.8.5-6
base 2-2
bash 5.0.016-1
bash-completion 2.10-1
bzip2 1.0.8-3
ca-certificates 20181109-3
…
…
# 搜索指定名稱的程序包
root@archlinux> pacman -Qs openssh ~
local/openssh 8.2p1-3
Premier connectivity tool for remote login with the SSH protocol
查詢網(wǎng)絡(luò)源里面是否有某個安裝包,可以使用-Ss選項:
root@archlinux> pacman -Ss Gnome-Desktop /usr/bin
extra/gnome-desktop 1:3.36.2-1
Library with common API for various GNOME modules
查詢某個文件屬于哪個安裝包:
root@archlinux> pacman -F /usr/bin/vim ~
usr/bin/vim is owned by extra/gvim 8.2.0510-2
usr/bin/vim is owned by extra/vim 8.2.0510-2
root@archlinux> pacman -F /usr/bin/ifconfig ~
usr/bin/ifconfig is owned by core/net-tools 1.60.20181103git-2
查詢某個程序包包含哪些文件,可以使用-Ql選項:
archlinux# pacman -Ql net-tools
net-tools /usr/
net-tools /usr/bin/
net-tools /usr/bin/arp
net-tools /usr/bin/ifconfig
net-tools /usr/bin/ipmaddr
net-tools /usr/bin/iptunnel
net-tools /usr/bin/mii-tool
net-tools /usr/bin/nameif
net-tools /usr/bin/netstat
net-tools /usr/bin/plipconfig
net-tools /usr/bin/rarp
net-tools /usr/bin/route
net-tools /usr/bin/slattach
…
查看該程序包所依賴的程序包,可以使用pactree查看。需要安裝pacman-contrib程序包,使用pactree以目錄樹的形式顯示依賴包的名稱:
archlinux# pactree net-tools
net-tools
└─glibc
├─linux-api-headers provides linux-api-headers>=4.10
├─tzdata
└─filesystem
└─iana-etc
Arch Linux中的Pacman命令如何使用Arch Linux中的Pacman命令如何使用
名稱欄目:ArchLinux中使用Pacman命令
標(biāo)題來源:http://m.5511xx.com/article/dhdohjh.html


咨詢
建站咨詢
