title: Arch Linux - apt-get update equivalent command?
body: <p>What is the command for Arch Linux to <strong>update</strong> the packages before installing a new package?</p>
  
  <p>For instance, I know that in Ubuntu, I do:</p>
  
  <pre><code>$ sudo apt-get update
  $ sudo apt-get &lt;pkg-name&gt;
  </code></pre>
  
  <p>What about in Arch?</p>
  
  <p>I came across a couple of version, but they don't seem agree with each others. I can't see the consistency there.</p>
  
  <p><a href="https://www.garron.me/en/go2linux/upgrade-update-arch-linux.html" rel="noreferrer">eg 1.</a> (it looks tedious to me): </p>
  
  <pre><code>$ sudo pacman -Syy
  $ sudo pacman -Su
  </code></pre>
  
  <p><a href="https://www.digitalocean.com/community/tutorials/how-to-use-arch-linux-package-management" rel="noreferrer">eg. 2</a>: </p>
  
  <pre><code>$ sudo pacman -Sy
  </code></pre>
  
  <p><a href="https://bbs.archlinux.org/viewtopic.php?id=76376" rel="noreferrer">eg. 3</a>:</p>
  
  <blockquote>
    <p>always use "-Sy" with a "u"  i.e. "pacman -Syu" then "pacman -S
    ", and never "pacman -Sy ".</p>
  </blockquote>
  
  <p>I am just confused!</p>
  
  <p>Any ideas?</p>