This is happening because you didn't use apt-get to install Yarn. You first have to uninstall it using the same package manager that you had used during your installation.
For example, if you have used brew:
brew uninstall yarn
If you have used npm:
npm uninstall -g yarn