Complain to the people who do the packaging of LAMMPS for your Linux distribution that they need to update the package (and by preference to the most recent version) and wait for them to post an update.
There is a fourth option: update to Ubuntu 22.04LTS. That one seems to ship with the 29 Sep 2021 version. While that is not the latest, it is two years more recent that the one for Ubuntu 20.04LTS.
I have updated my LAMMPS version by building from source. Still getting the same error:
LAMMPS (23 Jun 2022)
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98)
using 1 OpenMP thread(s) per MPI task
ERROR: Unknown command: kim init Tersoff_LAMMPS_Tersoff_1988_C__MO_579868029681_003 metal (src/input.cpp:302)
Last command: kim init Tersoff_LAMMPS_Tersoff_1988_C__MO_579868029681_003 metal
Traceback (most recent call last):
It works for me. Did you compile LAMMPS with the Kim package enabled? What is the output of: lmp - h
Is the input still exactly the same as in your original post?
Hi @imomnipresent, to clarify @akohlmey remark: the KIM package is an external package that is not necessary to compile LAMMPS. You need to specifically add it (and install kim-api and models).
See sections 3.1, 3.2 and 3.7 of the Build Section from the manual that @akohlmey already posted. Section 3.7 has a dedicated section on how to add kim package.
From you output it seems that the kim command and pair_style are absent from your executable so I do not think it was compiled with the package.
The lmp -h output confirms, there are no additional packages included in your LAMMPS binary and thus also not the KIM package. You need to enable it (and first activate your kim-api installation so CMake can detect it) and then recompile LAMMPS. 3.7. Packages with extra build options — LAMMPS documentation
When you recompile, it is usually a good idea to add the “basic packages preset” to also install a few packages with the most commonly used features beyond the absolute minimum or the “most packages preset” with most packages that do not need extra setup or external libraries.