Installing on Ubuntu

I’m having trouble installing Anki 2.1.38 on my desktop computer, which runs Ubuntu 20.04.1 LTS (64 bit) with Gnome 3.36.8.

This computer had Anki 2.1.35 until now. That version is now gone.

After following the instructions on the Linux download page at https://apps.ankiweb.net/, including running the command “sudo apt install libxcb-xinerama0” , the terminal said that Anki was installed and to type “anki” to run it. After doing so, the terminal said that the command “anki” was not found. I can’t find it in the Ubuntu Software Center either.

The terminal also said that I could install Anki by running apt. That did install Anki, but when started, it just says, “Anki was unable to open your collection file.” The complete error is below.

What should I do? Since you recommend installing it from your website instead of apt, I would like to follow that advice.

P.S. In case it helps, here’s that error message from the Anki that I got from apt:
Anki was unable to open your collection file. If problems persist after restarting your computer, please use the Open Backup button in the profile manager.

Debug info:
Traceback (most recent call last):
File “/usr/share/anki/aqt/main.py”, line 341, in loadCollection
return self._loadCollection()
File “/usr/share/anki/aqt/main.py”, line 366, in _loadCollection
self.col = Collection(cpath, log=True)
File “/usr/share/anki/anki/storage.py”, line 40, in Collection
col = _Collection(db, server, log)
File “/usr/share/anki/anki/collection.py”, line 68, in init
self.load()
File “/usr/share/anki/anki/collection.py”, line 144, in load
self.conf = json.loads(self.conf)
File “/usr/lib/python3.8/json/init.py”, line 357, in loads
return _default_decoder.decode(s)
File “/usr/lib/python3.8/json/decoder.py”, line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File “/usr/lib/python3.8/json/decoder.py”, line 355, in raw_decode
raise JSONDecodeError(“Expecting value”, s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Please try running uninstall.sh then install.sh again.