How to install older version of GhostScript?
Solution 1
As an alternative solution - you could compile the older version of ghostscript.
download and extract the tar file
Download the tar file from launchpad.
setup the build environment
sudo apt-get build-dep ghostscript-x
compile and install ghostscript
cd [ghostscript folder location]
sh autogen.sh
make
sudo make install
binaries
All the binaries are installed in /usr/local/bin
Thus if you run gs -v
:
GPL Ghostscript 8.71 (2010-02-10) Copyright (C) 2010 Artifex Software, Inc. All rights reserved.
If you want to run ghostscript
you can reassign the current symbolic link:
sudo rm /usr/bin/ghostscript
sudo ln -s /usr/local/bin/gs /usr/bin/ghostscript
Solution 2
Here is solution tried & tested on Ubuntu 12.04 LTS....
Download sources from http://downloads.ghostscript.com/public/
wget http://downloads.ghostscript.com/public/ghostscript-8.71.tar.gz
Uncompress downloaded source code & change to directory.
tar xvf ghostscript-8.71.tar.gz
cd ghostscript-8.71
Configure it (I used all defaults)
./configure
Start compilation with
make
If you encounter following error:
./base/gp_unix.c:148:2: warning: implicit declaration of function ‘gettimeofday’ [-Wimplicit-function-declaration] make: * [obj/gp_unix.o] Error 1
Compile using
make XCFLAGS=-DHAVE_SYS_TIME_H=1
Finally install compiled binaries using
make install
At this point you will ghostscript will be installed at /usr/local/bin/gs
Solution 3
I also asked this question on Debian forums: link, and with the help by member damgaard I've been able to downgrade GhostScript without too much trouble
Here is overview of this more general scheme which I believe can be used in similar situation, compiled from damgaard's posts:
After removing offending package (GS 9.01) search for last Ubuntu version supporting desired package (GS 8.71) - that is Ubuntu 10.10, so it's repositories are added to helper file: /etc/apt/sources.list.d/maverick.list
Investigating which packages are affected by this downgrade idea, we can get this list:
ghostscript ghostscript-cups ghostscript-doc ghostscript-x libgs8 evince evince-common libevdocument3 libevview3 libspectre1
on which we run this one-liner (as sudo):
for a in ghostscript ghostscript-cups ghostscript-doc ghostscript-x libgs8 evince evince-common libevdocument3 libevview3 libspectre1; do echo -e "Package: $a\nPin: release a=maverick\nPin-Priority: 700" > /etc/apt/preferences.d/ps_downgrade_policies_$a; done
which creates following files in /etc/apt/preferences.d/
folder:
ps_downgrade_policies_evince
ps_downgrade_policies_evince-common
ps_downgrade_policies_ghostscript
ps_downgrade_policies_ghostscript-cups
ps_downgrade_policies_ghostscript-doc
ps_downgrade_policies_ghostscript-x
ps_downgrade_policies_libevdocument3
ps_downgrade_policies_libevview3
ps_downgrade_policies_libgs8
ps_downgrade_policies_libspectre1
with this example content:
Package: package-name-here
Pin: release a=maverick
Pin-Priority: 1000
Then run:
sudo apt-get update
sudo apt-get dist-upgrade
Thanks damgaard :)
Solution 4
Try installing a newer version instead: https://launchpad.net/~dns/+archive/gnu
Related videos on Youtube
zetah
Updated on September 18, 2022Comments
-
zetah over 1 year
This is second time I get segmentation fault error when I try to run GhostScript on any PDF file with pdfwrite
First time it was my previous Ubuntu 11.04 distro, which afterwards I completely remove (not because of gs), format my drive etc, and then install 11.04 againI don't know what could be the problem. I work with GS a lot, and now all of a sudden I start getting this errors on any file, like something went wrong with this package or some of it's dependencies.
I searched Synaptic history if there maybe some recent update could cause GS crippling but there was nothingI reported problems in the past (at least two times) on GS Launchpad branch, but no one even replied, and as a matter of fact no one ever replied to me on Launchpad for any report I issue, so I thought to remove completely ghostscript and install some other version.
At first I thought to add Debian stable repository, and install better tested version, but it turned out that perhaps that's not very good idea - adding Debian repository in Ubuntu.As I can't "force" Synaptic to some previous GS version (as there is only one it seems - problematic one) I don't know how to approach this problem and wanted to ask how to install previous version, 8.71 preferably, because that's the last version in Debian stable.
Update:
I removed GS 9.01 (and bunch of other packages on the way) and followed Boris' advice, as I didn't know what else can I do.
I installed:
libgs8_8.71~dfsg2-9_i386.deb ghostscript_8.71~dfsg2-9_i386.deb
and tested GS interpreter and all was working fine.
Now I wanted to put back all those packages removed by GS 9.01 removal, and I needed to first install
ghostscript-x
:ghostscript-x_8.71~dfsg2-9_i386.deb
This is where problem begins:
Error:
Breaks existing package 'gsfonts' that conflict: 'gs'.
But the '/home/zetah/gs/ghostscript-x_8.71~dfsg2-9_i386.deb' provides it via: 'gs,gs-afpl,gs-esp,gs-gpl'I didn't want to brake things so I removed just installed
libgs8
andghostscript
and tried to removegsfonts
package (which additionally removed abiword, gnumeric,..) and then install all again.
But I found out thatgsfonts
is required byghostscript
and installed wheneverghostscript
is installed (so ever before being able to installghostscript-x
package).Now after installing
libgs8
andghostscript
, when I try to installghostscript-x
I get:Error:
Breaks existing package 'ghostscript' that conflict: 'gs'.
But the '/home/zetah/gs/ghostscript-x_8.71~dfsg2-9_i386.deb' provides it via: 'gs,gs-afpl,gs-esp,gs-gpl'It's exactly the same if I try with Ubuntu 10.10 ghostscript 8.71 packages from Launchpad
-
Admin over 12 yearsHave you tried simply downloading the GhostScript package from debian repository, and installing with dpkg? It is at ftp.debian.org/debian/pool/main/g/ghostscript There might be a better way.
-
Admin over 12 yearsI thought of it, but wouldn't that mess with some Ubuntu packages as there are many packages depending on GS, libgs etc?
-
Admin over 12 yearsPossibly. But it might better than being stuck with a broken package. Unless things go horribly wrong, you should be able to go back. Hopefully, someone more knowledgeable than myself will come along, and answer your question.
-
-
zetah over 12 yearsI didn't try this, but I expect it to work as explained. Seems like a working alternative in similar scenarios not just ghostscript.
-
zetah over 12 yearsThis is good idea, only that I already solved this problem. I used that PPA to update
gnumeric
(latest version has conditional formatting) and missed to search for solution to myghostscript
problem. Too late... -
rahul286 over 11 yearsThe answer above mine answer has remaining parts. Is it fine to copy major part from it OR from the link I posted?
-
jokerdino over 11 yearsYour answer should standalone without people having to click on the link to know what to do. If you are referring from other sources, please reference it properly.
-
rahul286 over 11 years@jokerdino my pleasure :-)