Make sure you have install php-cli php-common php-mysql, before enabling required php extensions for Drupal on Ubuntu, Debian or Mint.

You don’t need add version of PHP in fron of all the extensions unless you have multiple versions of php installed on your system.

Just run the following commond, you can add all that I am missing here on the list.

sudo apt install php-opcache php-pdo php-calendar php-ctype php-exif php-ffi php-fileinfo php-ftp php-iconv php-phar php-posix php-readline php-shmop php-sockets php-sysvmsg php-sysvsem php-sysvshm php-tokenizer php-gd