实验环境:
第一步提高下载和数据库连接速度:
评估你自己的镜像源下载速度:
[mrrobot@mrrobot-pc ~]$ sudo pacman-mirrors --fasttrack 5 && sudo pacman -Syyu
.: INFO Writing mirror list
China : https://mirrors.shu.edu.cn/manjaro/stable
Japan : http://ftp.tsukuba.wide.ad.jp/Linux/manjaro/stable
United_States : https://mirror.clarkson.edu/manjaro/stable
Germany : https://mirror.philpot.de/manjaro/stable
Spain : http://ftp.caliu.cat/manjaro/stable
.: INFO Mirror list generated and saved to: /etc/pacman.d/mirrorlist
第二部开始同步数据库下
执行更新命令:
sudo pacman -Syyu
或者也可以这样做(可以省去第一步):
pacman-optimize && sync
第三步同步更新:
pacman -Sy
或者是强制更新,这在你改变完一系列依赖后特别有用:
pacman -Syy
第三步开始更新系统:
pacman -Su #不建议使用这会导致局部更新
pacman -Syu #建议这样做,因为这样会先同步数据再更新
懒癌发作:::::::
Update & ignore a package It should not be necessary to use exclusion of packages. Such an exclusion might be the cause of the infamous partial updates.
IgnorePkg=package_name
Update & ignore a package group
IgnoreGroup=package_group
IgnoreGroup=gnome
IgnoreGroup=kde
Install a package
pacman -Syu package_name
pacman -Syu testing/package_name
Install packages as a group
pacman -Syu gnome pacman -Syu kde
Download a package without installation
pacman -Sw package_name
Install a downloaded or a local package
pacman -U /package_path/package_name.pkg.tar.xz
pacman -U http://www.examplepackage/repo/examplepkg.tar.xz
Reinstall all packages
pacman -Syu $(pacman -Qqen)
To search which packages has been installed in a group
pacman -Sg gnome pacman -Sg kde
Get a full package list with versions. This will create a file called pacman.laptop in your home folder.
pacman -Q > ~/pacman.laptop
Remove a package
pacman -R package_name
Remove a package with dependencies that are not being used by other packages
pacman -Rs package_name
Remove a package with all dependencies. Attention: The -c flag can remove needed dependencies, too. Only for advanced users.
pacman -Rsc package_name
pacman -Rn package_name
Forcefully remove a dependency without removing any other package. Attention: Only for advanced users.
pacman -Rdd package_name
See Maintaining /var/cache/pacman/pkg for System Safety for an in depth view on this topic.
Cleaning the cache
pacman -Sc
pacman -Scc
paccache -rvk3
Cleaning orphan packages from the system. Also read Orphan Package Removal for further information.
pacman -Rsn $(pacman -Qdtq)
If you get this error, don't worry: it means you don't have orphaned packages to remove!
error: no targets specified (use -h for help)
Provides a description of searched for package & associated packages
pacman -Ss package_name
Provides a description of previously installed package
pacman -Qs package_name
Provides detailed summary of a package
pacman -Si package_name
pacman -Qi package_name
pacman -Qii package_name
Get a list of installed packages
pacman -Q
Find out which package owns a file
pacman -Qo /file_path
List all orphan packages with no dependencies
pacman -Qdt
List all installed packages from the AUR
pacman -Qem
View package dependencies. Use one of the following commands:
pactree package_name
pactree -c package_name
pactree -s -c package_name
Following is info on three popular options for using the AUR, for a detailed list of their commands please look at their man pages:
Yaourt comes pre-installed with Manjaro so you normally won't have to install it. If you have removed it, this is how you install it again:
pacman -Syu base-devel yaourt
yaourt -Syua
yaourt -Syua --devel
You can use all Pacman commands mentioned on this Wiki page with Yaourt, too. One command is different:
yaourt -Qdt
yaourt -S packer
packer -S package_name
packer -Syu