malu
malu

Reputation: 63

How do I completely remove (all versions of) pdftk server from Mac OS X?

I am having trouble with pdftk on my Mac OS X 10.11 and want to remove all traces of it from my system before attempting to make a new install with the newest package 2.02 (available here on StackOverflow) which I already installed.

I suspect there might be more than one version in my system.

When I try

pdftk --version

the system gives an error:

dyld: Symbol not found: __ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED1Ev
Referenced from: /usr/local/bin/pdftk
Expected in: /usr/local/bin/../lib/libstdc++.6.dylib
in /usr/local/bin/pdftk
Trace/BPT trap: 5

and when I run

export DYLD_LIBRARY_PATH=/opt/pdflabs/pdftk/lib:$DYLD_LIBRARY_PATH

and check for the version I get

pdftk 2.02 a Handy Tool for Manipulating PDF Documents
Copyright (c) 2003-13 Steward and Lee, LLC - Please Visit: www.pdftk.com
This is free software; see the source code for copying conditions. There is
NO warranty, not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

How do I remove them from the system?

EDIT: I actually tried the "version" option on both places, by going to each folder and typing

pdftk --version

I got the problem on the /usr/local folder, but the /opt folder printed the version. It seems I really do have two versions of pdftk on my computer and the default is the problematic one.

Upvotes: 6

Views: 6235

Answers (2)

inomdzhon
inomdzhon

Reputation: 58

I found pdftk_uninstall.sh script on /opt/pdflabs/pdftk/bin/ directory.

I copy-past script with -f flag for rm command

rm -f /usr/share/man/man1/pdftk.1;rm -f "/opt/pdflabs/pdftk/man/pdftk"*;rm -f /usr/local/bin/pdftk;rm -f "/opt/pdflabs/pdftk/bin/pdftk"*;rm -f "/opt/pdflabs/pdftk/license_gpl_pdftk/reference/"*;rmdir "/opt/pdflabs/pdftk/license_gpl_pdftk/reference";rm -f "/opt/pdflabs/pdftk/license_gpl_pdftk/third_party/"*;rmdir "/opt/pdflabs/pdftk/license_gpl_pdftk/third_party";rm -f "/opt/pdflabs/pdftk/license_gpl_pdftk/"*;rmdir "/opt/pdflabs/pdftk/license_gpl_pdftk";rm -f "/opt/pdflabs/pdftk/changelog.html" "/opt/pdflabs/pdftk/changelog.txt"

This help for me 🎉

Upvotes: 3

Basilio B. Fraguela
Basilio B. Fraguela

Reputation: 36

I do not know how to uninstall the default pdftk, but the pdftk binary in /opt/pdflabs/pdftk/bin/pdftk seems to use by default the correct libraries. So in the meantime you could just change your PATH (in .bashrc / .bash_profile) so that the pdftk you use by default if the good one with something like

export PATH=/opt/pdflabs/pdftk/bin:$PATH

In the /opt/pdflabs/pdftk/bin there is also a pdftk_uninstall.sh that will uninstall the /opt/pdflabs when necessary. I guess that will be when pdflabs releases an official updated pdftk that installs the good version in the default directories.

Upvotes: 2

Related Questions