I can't update package php-mcrypt

I can’t update php-mcrypt (New version 7.2+58+ubuntu16.04.1+deb.sury.org+1) Dovecot can’t be restarted because it is already running. How can I solve this? How can I install the package and avoid that dovecot shuts down when I try to update.

Setting up dovecot-core (1:2.2.22-1ubuntu2.6) …
Job for dovecot.service failed because the control process exited with error code. See “systemctl status dovecot.service” and “journalctl -xe” for details.
invoke-rc.d: initscript dovecot, action “start” failed.
● dovecot.service - Dovecot IMAP/POP3 email server
Loaded: loaded (/lib/systemd/system/dovecot.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sun 2018-02-04 08:12:24 CET; 79ms ago
Docs: man:dovecot(1)
http://wiki2.dovecot.org/
Process: 29494 ExecStart=/usr/sbin/dovecot (code=exited, status=89)
Main PID: 1341 (code=exited, status=0/SUCCESS)

Feb 04 08:12:24 vps344847 dovecot[29494]: Error: service(auth): Socket already exists: /var/run/dovecot/auth-userdb
Feb 04 08:12:24 vps344847 dovecot[29494]: Error: service(auth): Socket already exists: /var/run/dovecot/auth-master
Feb 04 08:12:24 vps344847 dovecot[29494]: Error: service(auth-worker): Socket already exists: /var/run/dovecot/auth-worker
Feb 04 08:12:24 vps344847 dovecot[29494]: Error: service(anvil): Socket already exists: /var/run/dovecot/anvil
Feb 04 08:12:24 vps344847 dovecot[29494]: Error: service(anvil): Socket already exists: /var/run/dovecot/anvil-auth-penalty
Feb 04 08:12:24 vps344847 dovecot[29494]: Fatal: Failed to start listeners
Feb 04 08:12:24 vps344847 systemd[1]: dovecot.service: Control process exited, code=exited status=89
Feb 04 08:12:24 vps344847 systemd[1]: Failed to start Dovecot IMAP/POP3 email server.
Feb 04 08:12:24 vps344847 systemd[1]: dovecot.service: Unit entered failed state.
Feb 04 08:12:24 vps344847 systemd[1]: dovecot.service: Failed with result ‘exit-code’.
dpkg: error processing package dovecot-core (–configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of dovecot-pop3d:
dovecot-pop3d depends on dovecot-core (= 1:2.2.22-1ubuntu2.6); however:
Package dovecot-core is not configured yet.

dpkg: error processing package dovecot-pop3d (–configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of dovecot-imapd:
dovecot-imapd depends on dovecot-core (= 1:2.2.22-1ubuntu2.6); however:
Package dovecot-core is not configured yet.

dpkg: error processing package dovecot-imapd (–configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
dovecot-core
dovecot-pop3d
dovecot-imapd
Reading package lists…
Building dependency tree…
Reading state information…
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
php-mcrypt : Depends: php7.2-mcrypt but it is not installable
E: Unable to correct problems, you have held broken packages.

From PHP 7.1.X mcrypt is deprecated so probably completely removed from 7.2 (and any future releases) in favor of OpenSSL. Last mcrypt update was before several years and as a project is dead, so the decision to remove it is justified. Anyone still using it are playing a russian roulette with their server because software without updates for almost 10 years cannot be classified as secure.

I don’t know if I use my crypt and I don’t really want to install it. My server auto updates and every day my dovecots refuses to restart automatically. It is frustrating that I have to manually kill all the dovecot processes and turn it back on.

I don’t know if I use my crypt and I don’t really want to install it

Then why are you trying to install? If there is some software with mcrypt as requirement then this would be good time to update that software or simply switch with something new and better maintained.