Is there any solution to rollback command I did in Linux?

I made a huge mistake when I ran the command. I’m using SLES15 SP5, created in AWS.

sudo zypper install pam
# sudo zypper install pam
Building repository 'openSUSE-Leap-15.5-OSS' cache .........................................................................................................................[done]
Loading repository data...
Reading installed packages...
Resolving package dependencies...

The following package is going to be upgraded:
  pam

The following NEW package is going to be installed:
  system-user-root

The following 2 packages have no support information from their vendor:
  pam system-user-root

1 package to upgrade, 1 new.
Overall download size: 0 B. Already cached: 446.6 KiB. After the operation, additional 8.9 KiB will be used.
Continue? [y/n/v/...? shows all options] (y):
In cache system-user-root-20190513-3.3.1.noarch.rpm                                                                                                           (1/2),   9.0 KiB
In cache pam-1.3.0-150000.6.61.1.x86_64.rpm                                                                                                                   (2/2), 437.6 KiB

Checking for file conflicts: ..............................................................................................................................................[error]
Detected 2 file conflicts:

File /sbin/unix2_chkpwd
  from install of
     pam-1.3.0-150000.6.61.1.x86_64 (openSUSE-Leap-15.5-OSS)
  conflicts with file from package
     pam-modules-12.1-25.4.5.x86_64 (@System)

File /usr/share/man/man8/unix2_chkpwd.8.gz
  from install of
     pam-1.3.0-150000.6.61.1.x86_64 (openSUSE-Leap-15.5-OSS)
  conflicts with file from package
     pam-modules-12.1-25.4.5.x86_64 (@System)

File conflicts happen when two packages attempt to install files with the same name but different contents. If you continue, conflicting files will be replaced losing the previous content.
Continue? [yes/no] (no): yes

(1/2) Installing: system-user-root-20190513-3.3.1.noarch ...................................................................................................................[done]
warning: /etc/pam.d/common-account created as /etc/pam.d/common-account.rpmnew
warning: /etc/pam.d/common-auth created as /etc/pam.d/common-auth.rpmnew
warning: /etc/pam.d/common-password created as /etc/pam.d/common-password.rpmnew
warning: /etc/pam.d/common-session created as /etc/pam.d/common-session.rpmnew
warning: /etc/securetty created as /etc/securetty.rpmnew
warning: /etc/security/limits.conf created as /etc/security/limits.conf.rpmnew
(2/2) Installing: pam-1.3.0-150000.6.61.1.x86_64 ...........................................................................................................................[done]
There are running programs which still use files and libraries deleted or updated by recent upgrades. They should be restarted to benefit from the latest updates. Run 'zypper ps -s' to list these programs.

I made a huge mistake when I ran the command. I’m using SLES15 SP5.

sudo zypper install pam
# sudo zypper install pam
Building repository 'openSUSE-Leap-15.5-OSS' cache .........................................................................................................................[done]
Loading repository data...
Reading installed packages...
Resolving package dependencies...

The following package is going to be upgraded:
  pam

The following NEW package is going to be installed:
  system-user-root

The following 2 packages have no support information from their vendor:
  pam system-user-root

1 package to upgrade, 1 new.
Overall download size: 0 B. Already cached: 446.6 KiB. After the operation, additional 8.9 KiB will be used.
Continue? [y/n/v/...? shows all options] (y):
In cache system-user-root-20190513-3.3.1.noarch.rpm                                                                                                           (1/2),   9.0 KiB
In cache pam-1.3.0-150000.6.61.1.x86_64.rpm                                                                                                                   (2/2), 437.6 KiB

Checking for file conflicts: ..............................................................................................................................................[error]
Detected 2 file conflicts:

File /sbin/unix2_chkpwd
  from install of
     pam-1.3.0-150000.6.61.1.x86_64 (openSUSE-Leap-15.5-OSS)
  conflicts with file from package
     pam-modules-12.1-25.4.5.x86_64 (@System)

File /usr/share/man/man8/unix2_chkpwd.8.gz
  from install of
     pam-1.3.0-150000.6.61.1.x86_64 (openSUSE-Leap-15.5-OSS)
  conflicts with file from package
     pam-modules-12.1-25.4.5.x86_64 (@System)

File conflicts happen when two packages attempt to install files with the same name but different contents. If you continue, conflicting files will be replaced losing the previous content.
Continue? [yes/no] (no): yes

(1/2) Installing: system-user-root-20190513-3.3.1.noarch ...................................................................................................................[done]
warning: /etc/pam.d/common-account created as /etc/pam.d/common-account.rpmnew
warning: /etc/pam.d/common-auth created as /etc/pam.d/common-auth.rpmnew
warning: /etc/pam.d/common-password created as /etc/pam.d/common-password.rpmnew
warning: /etc/pam.d/common-session created as /etc/pam.d/common-session.rpmnew
warning: /etc/securetty created as /etc/securetty.rpmnew
warning: /etc/security/limits.conf created as /etc/security/limits.conf.rpmnew
(2/2) Installing: pam-1.3.0-150000.6.61.1.x86_64 ...........................................................................................................................[done]
There are running programs which still use files and libraries deleted or updated by recent upgrades. They should be restarted to benefit from the latest updates. Run 'zypper ps -s' to list these programs.

Run code snippet

Expand snippet

After that, every time I run a command for example su - or sudo zypper install. I received an error:

su: cannot open session: Module is unknown
sudo: PAM account management error: Module is unknown

I cannot login my root account too when I duplicate my PuTTY session. It is access denied.

Is your SLES15 server subscribed to some openSUSE repositories? That will definitely cause trouble.