How should yarn
be upgraded to the latest version?
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update && sudo apt-get install yarn
Please note that the last command will upgrade yarn to latest version if package already installed.
For more info you can check the docs: yarn installation