$ pacman -V

  .--.                   Pacman v5.1.3 - libalpm v11.0.3
 / _.-' .-.  .-.  .-.    Copyright (C) 2006-2018 Pacman Development Team
 \  '-. '-'  '-'  '-'    Copyright (C) 2002-2006 Judd Vinet
                         This program may be freely redistributed under
                         the terms of the GNU General Public License.

Update mirrorlist

$ sudo pacman-mirrors -f5

Use only Speed top 10

$ sudo pacman-mirrors --fasttrack 10

Use only Japan Server

$ sudo pacman-mirrors --country Japan

::INFO Downloading mirrors from
::INFO User generated mirror list
::INFO Custom mirror file saved: /var/lib/pacman-mirrors/custom-mirrors.json
::INFO Using default mirror file
::INFO Querying mirrors - This may take some time
  0.091 Japan          :
::INFO Writing mirror list
::Japan           :
::INFO Mirror list generated and saved to: /etc/pacman.d/mirrorlist

$ cat /etc/pacman.d/mirrorlist

## Manjaro Linux default mirrorlist
## Generated on 2020-05-12 22:09
## Please use 'pacman-mirrors -f [NUMBER] [NUMBER]' to modify mirrorlist
## (Use 0 for all mirrors)

## Country : Japan
Server =$repo/$arch

Install package

$ sudo -S $pkg

(Dangerous) Upgrade database

NOTE: by this cmd is not bad, but this leads directly to partial updates. Arch doesn't keep old libs around like most distros such as Ubuntu, so partial updates is not allowed.

$ sudo pacman -Sy

Upgrade database forcibly

$ sudo pacman -Syy

Upgrade database and packages

$ sudo pacman -Syu

Upgrade database and upgrade/downgrade package

$ sudo pacman -Syuu

Upgrade database and packages forcibly


  • -Syyu = -Syy + -Syu
  • if you update your /etc/pacman.d/mirrorlist, you need to execute this cmd
$ sudo pacman -Syyu

Updagrade packages including AUR repository

$ yay -Syu

Remove Package with unused dependencies

$ sudo pacman -Rs $pkg

How to fix “unable to lock database” error

$ sudo rm /var/lib/pacman/db.lck cannot open shared object file: No Such file ...

sudo ln -sf /usr/lib/ /usr/lib/

Trouble Shooting