Is this AskUbuntu post related to your issue? If so you can follow this advice:
Install JPEG Encoding Library
Following the information provided by user Samir Sabri in this AskUbuntu post, you will need to add the JPEG library.
I fixed the problem by installing from source the jpeg encoding library available at
http://www.ijg.org/files/jpegsrc.v8c.tar.gz. (Latest JPEG Library can be found here.)
tar xvfz jpegsrc-v9c.tar.gz
./configure --enable-shared --prefix=$CONFIGURE_PREFIX
sudo make install
Then I re-installed ImageMagick from source:
tar xvfz ImageMagick-[yourImagemagickVersion].tar.gz
./configure --prefix=/usr/local \
--disable-static --with-modules \
sudo make install
Substitute your options if necessary. You should be able to now use
imagemagick to identify, encode, and decode jpeg files.
Uninstall and Reinstall
If the above post is not related or does not work the best course of action would be to uninstall
imagemagick and install it again.
You can uninstall a package that you installed from source following the advice in this post by user Javier Rivera.
cd into the directory of the source package and run:
You may need root(sudo) permissions if that is how you built the package initially.
As user Javier Rivera points out, this will only work if the developer(s) of the source package have made uninstall scripts/rules. If they did not you will need to run
make -n install to figure out the install steps and attempt to gracefully undo them.
You may also attempt to uninstall the package via
dpkg by following the advice outlined in this post.
dpkg -r --force-depends foo
Will uninstall package
foo while maintaining the packages that depend on
foo. However this will create an unstable system. It would be advised to run
apt-get -f install to help sort this out and pay attention to the output.
Looking at your
apt-cache policy output you should be able to install a version of
imagemagick from your repositories.
I recommend that you try to only install packages via your package manager. This makes it easier to manage your system and should work to avoid situations like this.
Please comment if you have any questions or issues with this answer. I highly suggest you read through each link I have provided thoroughly before attempting the commands. I appreciate feedback to correct any misconceptions and to improve my posts. I can update my answer as needed.
Best of Luck!