When I’m trying to uninstall phpmyadmin by typing:
sudo apt-get remove phpmyadmin*
I get this:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'phpmyadmin' for glob 'phpmyadmin*'
The following packages were automatically installed and are no longer required:
dbconfig-common dbconfig-mysql javascript-common libjs-jquery libjs-sphinxdoc libjs-underscore libmcrypt4
linux-headers-4.4.0-57 linux-headers-4.4.0-57-generic linux-image-4.4.0-57-generic php-gd php-mcrypt
php-phpseclib php-tcpdf php7.0-gd php7.0-mcrypt
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
phpmyadmin
0 upgraded, 0 newly installed, 1 to remove and 54 not upgraded.
1 not fully installed or removed.
After this operation, 25.0 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 124123 files and directories currently installed.)
Removing phpmyadmin (4:4.5.4.1-2ubuntu2) ...
/var/lib/dpkg/info/phpmyadmin.prerm: 44: /etc/dbconfig-common/phpmyadmin.conf: Syntax error: "(" unexpected
dpkg: error processing package phpmyadmin (--remove):
subprocess installed pre-removal script returned error exit status 2
/var/lib/dpkg/info/phpmyadmin.config: 44: /etc/dbconfig-common/phpmyadmin.conf: Syntax error: "(" unexpected
dpkg: error while cleaning up:
subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing:
phpmyadmin
E: Sub-process /usr/bin/dpkg returned an error code (1)
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
@rramirezm
Have you tried running without the glob (i.e. using the asterisk)?
or simply purging the package:
If neither of those work, you may want to run:
… and then try running them again. The above will attempt to resolve any dependencies that may otherwise exist.
You can also run:
… to remove the packages listed in the output since they are no longer in use/needed.
If nothing seems to be working, we can remove the
dpkg
files manually:… then run:
sudo mv /var/lib/dpkg/info/phpmyadmin.* /tmp/ sudo dpkg --remove --force-remove-reinstreq phpmyadmin sudo apt remove phpmyadmin sudo apt autoremove sudo apt autoclean
thanks me later!!!
So whenever anyone wants to remove phpmyadmin and apache just first of all stop all running services using below commands… stop apache2
sudo systemctl stop apache2.service
prevent apache2 to start at boot
sudo systemctl disable apache2.service
After running
sudo dpkg --configure -a
it prompted:It looks like I’ll have to deploy another droplet
@rramirezm
We can run the following command to see if any additional information is provided:
If that doesn’t produce anything that’s helpful, I would setup a second Droplet for testing.
Once logged in to SSH on the new Droplet, copy and paste the following multi-line command and let it run its course.
Once the above command has completed and MySQL is installed, please run:
… and setup your
root
password (if you didn’t already – not all MySQL packages prompt you to set aroot
password during setup, so the above command allows you to do that).Once MySQL is setup, install NGINX. You can do this one of two ways – use the NGINX package that is provided by Ubuntu or add NGINX’s PPA.
I prefer NGINX’s PPA since it’s actually maintained by them, so to install the PPA, we’d run:
… and then to install NGINX:
At this point we should have MySQL and NGINX installed. We can now install phpMyAdmin by using:
When prompted to choose a web server, don’t choose one (i.e. don’t hit space bar to select a web server – if you do, it’ll install that web server during the process and since you’re using NGINX, we don’t want that). Instead, hit tab and let it run its course. When you hit tab, both of the boxes should be empty, just to confirm.
You’ll then be prompted to setup phpMyAdmin. The first question it’ll ask is:
Tab over to
yes
, hit enter – then choose a password and confirm it on the next two prompts. This should complete the setup and phpMyAdmin will be located in:So you then need to setup a server block that will allow you to access it, but since the installation of phpMyAdmin didn’t install PHP-FPM, we should go ahead and install that since NGINX will need it to handle PHP requests:
From there, if you need help setting up your server blocks, just let me know. The above, however, should help to get you running up to the server block portion.