6

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 again

I 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 nothing

I 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 and ghostscript and tried to remove gsfonts package (which additionally removed abiword, gnumeric,..) and then install all again.
But I found out that gsfonts is required by ghostscript and installed whenever ghostscript is installed (so ever before being able to install ghostscript-x package).

Now after installing libgs8 and ghostscript, when I try to install ghostscript-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

zetah
  • 9,871

4 Answers4

5

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
fossfreedom
  • 174,526
3

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

rahul286
  • 156
2

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 :)

zetah
  • 9,871
1

Try installing a newer version instead: https://launchpad.net/~dns/+archive/gnu

scottl
  • 2,588