I’m posting this by way of passing a solution on to others.
I recently did a distro upgrade to NCP as described in https://ownyourbits.com/2019/08/05/nextcloudpi-gets-a-backup-ui-moves-to-nc16-0-3-buster-php7-3-and-more/ Everything seemed to go okay and I proceeded on to upgrade NC to 16.0. The upgrade wouldn’t work and threw the error:
sudo: Account or password is expired, reset your password and try again
sudo: no tty present and no askpass program specified
sudo: unable to change expired password: Authentication token manipulation error
I wasn’t sure what password needed to be changed. I tried the NCP web admin password, then the pi user password (which is also the credential used for SSH), and then the NC admin password – all with no luck on fixing the problem.
Finally I remembered that there is also a password for root. To change that one you need to switch to su in the SSH terminal. (see https://www.wikihow.com/Change-the-Root-Password-in-Linux if you don’t know what I’m talking about.)
After that the NC upgrade proceeded fine and everything seems to be working okay.