If you install Yarn using apt, you can remove it by running sudo apt remove yarn. Meanwhile, enter sudo npm uninstall -g yarn if you configured it via the NPM package manager.