Same here for Ubuntu 20.04.6 LTS and PHP 7.4.33
dpkg-maintscript-helper: error: file '/usr/share/phpmyadmin/themes/bootstrap/jquery/images' not owned by package 'phpmyadmin:all'
dpkg-maintscript-helper: error: file '/usr/share/phpmyadmin/themes/bootstrap/jquery/images/ui-bg_glass_55_fbf9ee_1x400.png' not owned by package 'phpmyadmin:all'
dpkg-maintscript-helper: error: file '/usr/share/phpmyadmin/themes/bootstrap/jquery/images/ui-bg_highlight-soft_75_cccccc_1x100.png' not owned by package 'phpmyadmin:all'
dpkg-maintscript-helper: error: file '/usr/share/phpmyadmin/themes/bootstrap/jquery/images/ui-bg_glass_75_dadada_1x400.png' not owned by package 'phpmyadmin:all'
dpkg-maintscript-helper: error: file '/usr/share/phpmyadmin/themes/bootstrap/jquery/images/ui-bg_glass_75_e6e6e6_1x400.png' not owned by package 'phpmyadmin:all'
dpkg-maintscript-helper: error: file '/usr/share/phpmyadmin/themes/bootstrap/jquery/images/ui-icons_2e83ff_256x240.png' not owned by package 'phpmyadmin:all'
dpkg-maintscript-helper: error: file '/usr/share/phpmyadmin/themes/bootstrap/jquery/images/ui-bg_glass_65_ffffff_1x400.png' not owned by package 'phpmyadmin:all'
dpkg-maintscript-helper: error: file '/usr/share/phpmyadmin/themes/bootstrap/jquery/images/ui-icons_cd0a0a_256x240.png' not owned by package 'phpmyadmin:all'
dpkg-maintscript-helper: error: file '/usr/share/phpmyadmin/themes/bootstrap/jquery/images/ui-icons_222222_256x240.png' not owned by package 'phpmyadmin:all'
dpkg-maintscript-helper: error: file '/usr/share/phpmyadmin/themes/bootstrap/jquery/images/ui-bg_glass_95_fef1ec_1x400.png' not owned by package 'phpmyadmin:all'
dpkg-maintscript-helper: error: file '/usr/share/phpmyadmin/themes/bootstrap/jquery/images/ui-icons_888888_256x240.png' not owned by package 'phpmyadmin:all'
dpkg-maintscript-helper: error: file '/usr/share/phpmyadmin/themes/bootstrap/jquery/images/ui-icons_454545_256x240.png' not owned by package 'phpmyadmin:all'
dpkg-maintscript-helper: error: directory '/usr/share/phpmyadmin/themes/bootstrap/jquery/images' contains files not owned by package phpmyadmin:all, cannot switch to symlink
dpkg: error processing archive /var/cache/apt/archives/phpmyadmin_4%3a5.2.1+dfsg-1+focal2_all.deb (--unpack):
new phpmyadmin package pre-installation script subprocess returned error exit status 1
Determining localhost credentials from /etc/mysql/debian.cnf: succeeded.
dbconfig-common: flushing administrative password
Errors were encountered while processing:
/var/cache/apt/archives/phpmyadmin_4%3a5.2.1+dfsg-1+focal2_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
Got the upgrade working by doing the following:
apt purge --remove phpmyadmin
and
apt install phpmyadmin -y
Specify whether you want to connect to an existing SQL instance by specifying the password for the DB user, or whether you want to create a new instance.