The issue is precisely as described in the output of the maintainer script:
you are using pam_tally or pam_tally2 in your configuration The pam_tally and pam_tally2 modules have been removed from PAM. You are using one of these modules in your PAM configuration in /etc/pam.d. You must remove the uses of these modules before PAM can be upgraded; including these modules in your PAM configuration after the upgrade will stop users from being able to log into the system. It is recommended to always use do-release-upgrade or update-manager to upgrade between releases. The release-upgrader presents this message before you start the upgrade, rather than it happening unavoidably partway through the upgrade leaving the package database in a state that may be difficult to recover from. ** Changed in: pam (Ubuntu) Status: New => Invalid -- You received this bug notification because you are a member of Ubuntu Touch seeded packages, which is subscribed to pam in Ubuntu. https://bugs.launchpad.net/bugs/2021362 Title: package libpam-modules 1.3.1-5ubuntu4.6 failed to install/upgrade: new libpam-modules:amd64 package pre-installation script subprocess returned error exit status 2 Status in pam package in Ubuntu: Invalid Bug description: System upgrade using live upgrade. Detailed bug report attached. ProblemType: Package DistroRelease: Ubuntu 20.04 Package: libpam-modules 1.3.1-5ubuntu4.6 ProcVersionSignature: Ubuntu 5.4.0-1102.110+fips1-aws-fips 5.4.233 Uname: Linux 5.4.0-1102-aws-fips x86_64 ApportVersion: 2.20.11-0ubuntu27.26 Architecture: amd64 CasperMD5CheckResult: skip Date: Fri May 26 22:06:56 2023 Ec2AMI: ami-08d4ac5b634553e16 Ec2AMIManifest: (unknown) Ec2AvailabilityZone: us-east-1c Ec2InstanceType: t3.large Ec2Kernel: unavailable Ec2Ramdisk: unavailable ErrorMessage: new libpam-modules:amd64 package pre-installation script subprocess returned error exit status 2 Python3Details: /usr/bin/python3.8, Python 3.8.10, python3-minimal, 3.8.2-0ubuntu2 PythonDetails: /usr/bin/python3.8, Python 3.8.10, python-is-python3, 3.8.2-4 RelatedPackageVersions: dpkg 1.19.7ubuntu3.2 apt 2.0.9 SourcePackage: pam Title: package libpam-modules 1.3.1-5ubuntu4.6 failed to install/upgrade: new libpam-modules:amd64 package pre-installation script subprocess returned error exit status 2 UpgradeStatus: Upgraded to focal on 2023-05-27 (0 days ago) mtime.conffile..etc.security.limits.conf: 2023-05-26T21:06:16.816903 To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/pam/+bug/2021362/+subscriptions -- Mailing list: https://launchpad.net/~touch-packages Post to : touch-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~touch-packages More help : https://help.launchpad.net/ListHelp