Arch Linux - apt-get update equivalent command?

最后都变了- 提交于 2019-12-20 20:14:07

问题


What is the command for Arch Linux to update the packages before installing a new package?

For instance, I know that in Ubuntu, I do:

$ sudo apt-get update
$ sudo apt-get <pkg-name>

What about in Arch?

I came across a couple of version, but they don't seem agree with each others. I can't see the consistency there.

eg 1. (it looks tedious to me):

$ sudo pacman -Syy
$ sudo pacman -Su

eg. 2:

$ sudo pacman -Sy

eg. 3:

always use "-Sy" with a "u" i.e. "pacman -Syu" then "pacman -S ", and never "pacman -Sy ".

I am just confused!

Any ideas?


回答1:


The equivalent of apt-get update in Arch Linux is pacman -Syy.

pacman -Syu is equivalent to apt-get update && apt-get upgrade.

Might as well make this complete if it stays...

pacman -S <package> is apt-get install <package>




回答2:


Note: I agree with @larsks' comment that the best source here is the Arch wiki.

For example, this wiki entry https://wiki.archlinux.org/index.php/Pacman/Rosetta covers the operations for pacman in depth for people who previously used ("coming from"): dnf (Red Hat/Fedora), apt (Debian/Ubuntu), zypper (SLES/openSUSE) or emerge (Gentoo).

From that document, apt update && apt upgrade is equivelent to pacman -Syu.



来源:https://stackoverflow.com/questions/43124985/arch-linux-apt-get-update-equivalent-command

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!