"adb: unknown command pair" on Ubuntu
The adb package in the Ubuntu 22.04 repository is version 28 and has no pair command. The adb in Google's platform-tools has it, so download platform-tools and pair the phone from there.
Download the Linux package from the SDK Platform Tools page, then:
unzip platform-tools-latest-linux.zip -d ~
~/platform-tools/adb version
~/platform-tools/adb pair <ip>:<port>
The phone shows the address, the port and the pairing code in its wireless debugging settings.
How to tell this is your case:
$ adb pair
adb: unknown command pair
$ adb version
Android Debug Bridge version 1.0.41
Version 28.0.2-debian
apt upgrade will not change it: on Ubuntu 22.04 the installed version of the adb package is the same one the repository has to offer.
What to do with the paired phone is in the tip on Chrome DevTools over Wi-Fi adb.
checked: Ubuntu 22.04, apt adb 28.0.2-debian, platform-tools 37.0.1