2

I am trying to create a symlink to be able to run a newer version of qpdf than the one installed in 18.04.

They provide a AppImage.

if I do:

/usr/local/bin$ sudo wget https://github.com/qpdf/qpdf/releases/download/release-qpdf-9.1.1/qpdf-9.1.1-x86_64.AppImage
/usr/local/bin$ sudo chmod a+x qpdf-9.1.1-x86_64.AppImage
/usr/local/bin$ ./qpdf-9.1.1-x86_64.AppImage --version
qpdf version 9.1.1
Run qpdf --copyright to see copyright and license information.

But when I try to do a symlink (so I can call it as qpdf anywhere):

/usr/local/bin$ sudo ln -s qpdf-9.1.1-x86_64.AppImage qpdf
/usr/local/bin$ ./qpdf --version

qpdf: an input file name is required

Usage: qpdf [options] infile outfile
For detailed help, run qpdf --help

And it doesn't show the version (or --help, etc).

How can I make it work?

I am new to Linux and maybe I am missing something obvious.

3 Answers 3

1

I've done it in the next way:

  • mkdir ~/appimage && cd ~/appimage
  • wget https://github.com/qpdf/qpdf/releases/download/release-qpdf-9.1.1/qpdf-9.1.1-x86_64.AppImage
  • chmod +x ~/appimage/qpdf-9.1.1-x86_64.AppImage

  • $ vim.tiny appimage/qpdf.sh

    #!/bin/bash
    cd /home/user/appimage/ && exec ./qpdf-9.1.1-x86_64.AppImage "$@"`
    
  • chmod +x ~/appimage/qpdf.sh

  • sudo ln -s /home/user/appimage/qpdf.sh /usr/local/bin/qpdf

As a result:

$ qpdf --version
qpdf version 9.1.1
Run qpdf --copyright to see copyright and license information.
1
  • I would advise against this because you essentially make an executable file in /usr/local/bin writable by a user other than root. However, you could create the symlink in ~/bin.
    – danzel
    Mar 3, 2020 at 17:43
0

You have to disable parameters:

./qpdf -- --version
0

This doesn't directly answer your question about symlinking, but here is another approach you can try.

Uninstall qpdf

apt remove qpdf

Make a custom desktop launcher for the AppImage

nano ~/.local/share/applications/qpdf.desktop

In ~/.local/share/applications/ create the launcher, customizing the "Exec" path here to match the location of your AppImage file.

[Desktop Entry]
Version=1.0
Name=qpdf
Exec=Path/To/Your/qpdf.AppImage
Terminal=false
X-MultipleArgs=false
Type=Application
StartupNotify=true

Add the qpdf command to .bashrc for CLI use

nano ~/.bashrc && source ~/.bashrc

Paste the following lines at the end of your existing ~/.bashrc file. As above, customize the path in this example to match the location of your AppImage file.

qpdf()
{
~/Path/To/Your/qpdf.AppImage
}
2
  • Creating the desktop launcher for the AppImage works, but not able to run it, am i missing anything? (I am able to run the AppImage through sh) Dec 15, 2020 at 19:13
  • 1
    @GajendraJena You may need to log out & log back in for the desktop launcher. Also double-check the path is correct. Is it still not working afterwards? Also, which AppImage are you using, qpdf or something else? Dec 16, 2020 at 21:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .