Trying to install a legacy pear package on a new version of Ubuntu is a bit of a chore as things are broken. For starters, using
$> sudo apt install php-pear
$> sudo pear install foo
results in errors such as
Notice: Trying to access array offset on value of type bool in PEAR/REST.php on line 187
and