Skip to content

Instantly share code, notes, and snippets.

@biserz
Last active November 13, 2023 12:34
Show Gist options
  • Save biserz/f52c8dc42124569331d9214f885c9f8c to your computer and use it in GitHub Desktop.
Save biserz/f52c8dc42124569331d9214f885c9f8c to your computer and use it in GitHub Desktop.
commands:
# Install GNU Java Compiler
01_install_libgcj:
command: yum -y install libgcj
ignoreErrors: true
# Install PDFtk
02_wget_pdftk:
command: wget https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/pdftk-2.02-1.x86_64.rpm
ignoreErrors: true
03_install_pdftk:
command: rpm -ivh pdftk-2.02-1.x86_64.rpm
ignoreErrors: true
# Install PDFJam
04_install_tetex_latex:
command: yum -y install tetex-latex
ignoreErrors: true
05_wget_pdfjam:
command: sudo wget http://dl.fedoraproject.org/pub/epel/6/i386/Packages/p/pdfjam-2.08-1.el6.noarch.rpm
ignoreErrors: true
06_install_pdfjam:
command: rpm -ivh pdfjam-2.08-1.el6.noarch.rpm
ignoreErrors: true
@ankitsam
Copy link

Not working.

sudo yum install libgcj
Loaded plugins: priorities, update-motd, upgrade-helper
5420 packages excluded due to repository priority protections
Package libgcj-4.1.2-55.el5.x86_64 is obsoleted by libgcc72-7.2.1-2.59.amzn1.x86_64 which is already installed
Nothing to do
sudo rpm -ivh pdftk-2.02-1.x86_64.rpm
error: Failed dependencies:
        libgcj is needed by pdftk-2.02-1.x86_64
        libgcj.so.7rh()(64bit) is needed by pdftk-2.02-1.x86_64

@ebongso
Copy link

ebongso commented Oct 19, 2018

Hello. I am getting the same error as @ankitsam. I haven't found a resolution. I was wondering if you have.

@bermann
Copy link

bermann commented Nov 16, 2018

@ankitsam @ebongso were you able to resolve this problem?

@vicpada
Copy link

vicpada commented Jan 14, 2019

This seems to have worked for me:

commands:
  # Install GNU Java Compiler
  01_install_libgcj:
    command: yum -y --setopt=obsoletes=0 install libgcj
    ignoreErrors: true

  # Install PDFtk
  02_wget_pdftk:
    command: wget https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/pdftk-2.02-1.x86_64.rpm
    ignoreErrors: true
    test: test ! -f .pdftk
  03_install_pdftk:
    command: rpm -ivh pdftk-2.02-1.x86_64.rpm
    test: test ! -f .pdftk

  # Install PDFJam
  04_install_tetex_latex:
    command: yum -y install tetex-latex
    ignoreErrors: true

  05_wget_pdfjam:
    command: sudo wget http://dl.fedoraproject.org/pub/epel/6/i386/Packages/p/pdfjam-2.08-1.el6.noarch.rpm
    test: test ! -f .pdftk

  06_install_pdfjam:
    command: rpm -ivh pdfjam-2.08-1.el6.noarch.rpm
    test: test ! -f .pdftk

  07_install_pdftk:
    command: touch .pdftk

@nsacerdote
Copy link

I needed to modified the version from @vicpada, not sure if it is dangerous (see remove libgcc72). I also removed the PDFJam thing that I think I don't need:

commands:
  00_remove_libgcc72:
    command: yum -y remove libgcc72
    ignoreErrors: true
    test: test ! -f .pdftk

  # Install GNU Java Compiler
  01_install_libgcj:
    command: yum -y --setopt=obsoletes=0 install libgcj
    ignoreErrors: true
    test: test ! -f .pdftk

  # Install PDFtk
  02_wget_pdftk:
    command: wget https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/pdftk-2.02-1.x86_64.rpm
    ignoreErrors: true
    test: test ! -f .pdftk
  03_install_pdftk:
    command: rpm -ivh pdftk-2.02-1.x86_64.rpm
    ignoreErrors: true
    test: test ! -f .pdftk

  04_flag_install_pdftk:
    command: touch .pdftk

@dimitrovmaksim
Copy link

I followed this article https://www.linuxglobal.com/pdftk-works-on-centos-7/ and built pdftk package including the missing libs. So now there's no need to install libgcj

@dimitrovmaksim
Copy link

dimitrovmaksim commented Dec 8, 2020

Repace with this:

  # Install PDFtk
  01_wget_pdftk:
    command: sudo wget https://hone-compiled-packages.s3.eu-central-1.amazonaws.com/pdftk-pdfw-2.02-1.x86_64.rpm
    ignoreErrors: true
  02_install_pdftk:
    command: rpm -ivh pdftk-pdfw-2.02-1.x86_64.rpm
    ignoreErrors: true

  # Install PDFJam
  04_install_tetex_latex:
    command: yum -y install tetex-latex
    ignoreErrors: true
  05_wget_pdfjam:
    command: sudo wget https://hone-compiled-packages.s3.eu-central-1.amazonaws.com/pdfjam-2.08-1.el6.noarch.rpm
    ignoreErrors: true
  06_install_pdfjam:
    command: rpm -ivh pdfjam-2.08-1.el6.noarch.rpm
    ignoreErrors: true

Tested on AWS Linux with Ruby 2.6.6 and AWS Linux 2 with Ruby 2.6.6

Also the 01_el5_yum.config is obsolete now and can be removed

@juliancorrea
Copy link

This last config posted by @dimitrovmaksim works perfectly for me on Amazon Linux 2

@hjardines
Copy link

Well, this is not working for ARM instances :(

[ec2-user@ip-172-31-16-4 ~]$ sudo rpm -ivh pdftk-pdfw-2.02-1.x86_64.rpm
Verifying... ################################# [100%]
Preparing... ################################# [100%]
package pdftk-pdfw-2.02-1.x86_64 is intended for a different architecture
[ec2-user@ip-172-31-16-4 ~]$

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment