The following steps apply for an Arch Linux and Arch Linux based distributions such as Manjaro etc
- sudo pacman -S – -needed base-devel git rustup ninja libxcrypt-compat (downloads and installs the necessary packages that are used to compile Anki. Newer versions use ninja instead of bazel.
- mkdir ~/ankidev (makes a directory where the source tree will be downloaded and the output files will be saved)
- git clone https://github.com/ankitects/anki.git ~/ankidev (this command copies locally the git repo to the local system)
- cd ~/ankidev
- ./tools/runopt (this command runs an optimized version so it could take longer) or ./run (compilation might be quicker but the program runs slower)
Compiling from the source code will give you the opportunity to test newer changes instead of waiting for a beta version or a stable one. A stable version can take months to be released. Additionally, running from the main branch gives you the ability to report bugs and even propose new features to the developers.
In order to pull new changes use the following command:
cd ~/ankidev && git pull
Then you can recompile to try what has changed.
In case of a bug that you want to reverse back to previous commits you can see the changelog using: git log
If for example the newer commit is troublesome and you want to revert back to a commit with the hash 77a45365cb64284dd4a8cd2535d6cbdc2676472c
then execute: git checkout 77a45365cb64284dd4a8cd2535d6cbdc2676472c
Say for example that the developers fix the bug and you want to get back to the main branch. Then use:
git checkout main




