Search code examples
linuxubuntuarchlinuxpacman-package-manager

What is the 'apt-get update' equivalent command in Arch Linux?


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 this in a terminal window:

sudo apt-get update
sudo apt-get <package name>

What about in Arch Linux?

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

Example 1. (it looks tedious to me):

sudo pacman -Syy
sudo pacman -Su

Example 2:

sudo pacman -Sy

Example 3:

always use "-Sy" with a "u". I.e., "pacman -Syu" and then "pacman -S <package>", and never "pacman -Sy <package>".


Solution

  • 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>.