Matlab has 1 month trial for educational account. When reactivating the trial after expiration on linux, it shows cannot activate for now due to some privilege issue.

To fix, go to where your acitvation file is located from terminal and run it.

$ cd /usr/local/MATLAB/R2022b/bin
$ sudo ./activate_matlab.sh

Login and input a username for activation, the matlab is ready to use after completion.

Referred from here.