21

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?

4

2 回答 2

51

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>

于 2017-03-30T20:18:01.723 回答
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.

于 2019-09-02T11:28:28.937 回答