Section1.2 Pacman

pacman

package manage difference with Fedora or Debian, see Rosetta

  • pacman
    • Help
    • Updating
    • Clean cache
    • Software install & remove
    • AUR
    • Install downloaded package
    • Query
    • Dependencies
    • Downgrade
    • Others

Help

#search for help
man pacman

#for specific command
pacman -Qh
pacman -Sh

Updating

#Synchronising changed package in repositories
sudo pacman -Sy

#Synchronising all even package not chaned:
sudo pacman -Syy

#Updating, without synchronising list:
sudo pacman -Su

Update, with synchronising list:

sudo pacman -Syu

sudo pacman -Syyu

Clean cache

#clear the cache of downloads that have already been installed
sudo pacman -Sc

#clear the cache completely
sudo pacman -Scc

#safeway
paccache -rvk3

Software install & remove

#Searching software:
sudo pacman -Ss Chromium

#Installing Software or a group:
sudo pacman -S Chromium
sudo pacman -S gnome

#Remove software without dependencies:
sudo pacman -R Chromium

#Remove software and dependencies(not used by others softwares):
sudo pacman -Rs Chromium

#dowload package without installing:
sudo pacman -Sw Chromium

#Remove software, dependencies(not used by other softwares), configuration files:
sudo pacman -Rns Chromium

#reinstall all packages
pacman -S $(pacman -Qqen)

#search installed packages in a group
pacman -Sg gnome

Ignore packages: gedit etc/pacman.conf

IgnorePkg=package_name

IgnoreGroup=gnome

pacmanConf.png

AUR

enable powerful AUR:

sudo pacman -S base-devel yaourt

install software from AUR:

yaourt visual-studio-code
yaourt pycharm
yaourt qtcreator

upgrading the packages from AUR:

yaourt -Syua

#use "yaourt" to download and rebuild the latest AUR packages from their source (regardless of PKGBUILD files):
yaourt -Syua --devel

#remove orphaned packages
yaourt -Qdt

#list installed packaegs from AUR
pacman -Qem

Install downloaded package

#install a downloaded pkg.tar.xz:
sudo pacman -U [/path/]package-name.pkg.tar.xz

#install via URL
pacman -U http://www.examplepackage/repo/examplepkg.tar.xz

Query

Get a list of installed packages: Name

pacman -Q

Search installed package:

pacman -Q|grep office

Query locally-installed packages for matching strings, basic information: Name & description

pacman -Qs creator

pacmanQuery01.png
#Query detailed information: deps, required by, etc
pacman -Qi qtcreator
pacman -Si qtcreator

#include backup information
pacman -Qii qtcreator

find out which package own the direcotroy

pacman -Qo /etc/pacman.d/

pacmanQuery02.png

Dependencies

#list all dependencies of a particular software package
pactree gedit
pactree -c gedit
pactree -s -c gedit

#list all Orphans
pacman -Qdt

Remove Orphan packages:

sudo pacman -Rns $(pacman -Qtdq)

Downgrade

first install downgrade, then downgrade firefox

sudo pacman -S downgrde

downgrade firefox

you can remove all packages for the latest 2 or 3 package versions

paccache -rvk2
##or
paccache -rvk3

Others

change updating channel(not recommended):

#Switch to Tesing Manjaro:
sudo pacman-mirrors -g -b testing

#Switch to Unstable Manjaro:
sudo pacman-mirrors -g -b unstable

#Switch to Stable Manjaro:
sudo pacman-mirrors -g -b stable

#then you should "sudo pacman -Syyu"

你可能感兴趣的:(Section1.2 Pacman)