Ubuntu – Plex is not working properly in Ubuntu 15.04 and now I can’t even remove it

dpkgpackage-managementplexsoftware-center

$ sudo rm -f /etc/init.d/plexmediaserver &&
$ sudo dpkg --purge --force-all plexmediaserver
Failed to get D-Bus connection: Operation not permitted
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 plexmediaserver

Then I tried

sudo dpkg --configure -a 
sudo dpkg -r plexmediaserver

and I got this error

dpkg: error processing package plexmediaserver (--remove):
 package is in a very bad inconsistent state; you should
 reinstall it before attempting a removal
Errors were encountered while processing:
 plexmediaserver

In Ubuntu 14.04 plex worked perfectly for me, but after upgrading to Ubuntu 15.04 after installing plex, Software Center stopped working, as well as synaptic package manager

Synaptic is giving this error:

E: The package plexmediaserver needs to be reinstalled, but I can't find an archive for it.
E: Internal error opening cache (1). Please report.

How can I fix this?

Best Answer

To remove the plex error I followed this article Fix annoying "The package needs to be reinstalled but I can't find an archive for it" error in Linux Mint and Ubuntu.

sudo rm -f /etc/init.d/plexmediaserver &&
sudo dpkg --purge --force-all plexmediaserver
sudo apt-get purge plexmediaserver
sudo rm -rf /var/lib/plexmediaserver
sudo userdel plex
sudo rm /etc/init/plexmediaserver.conf
sudo rm /etc/default/plexmediaserver

After all the above steps I downloaded plex from Software Center. that vertion is so old. I then upgraded to this version:
plexmediaserver_0.9.11.7.803-87d0708_amd64
And this version is kind of working okay.

And now everything is working perfectly for me.

Related Question