I just built the most recent version of pdftk by make -f Makefile.Debian, and I got an executable pdftk in my local directory. (http://www.pdflabs.com/tools/pdftk-server/)

I have an older version of pdftk under /usr/bin/, installed from binary and the software center of my Ubuntu.

Is it a good practice just to replace the executable?

  • How about the old manpage?
  • Will the OS have the information of the new executable, when I query for that by dpkg -l?

I would encourage you to not replace any executables that are part of a package that was installed using APT or dpkg. It's better to keep this file in the directory /usr/local/bin, IMO, given it's custom software that you've built yourself.

Also I'd take a look at that "Makefile", Makefile.Debian to see if it includes a make install target. That target, will often already be setup to install the binaries that were built into a directory such as /usr/local, typically.

NOTE: The targeting of this directory is often configurable when you run the ./configure step, which "customizes" the targeted install directories.

Other questions

How about the old manpage?

Using the install target will often times install man pages and other build artifacts into corresponding directories under /usr/local too.

Will the OS have the information of the new executable, when I query for that by dpkg -l?

No, installing files manually would cause the packages to be negated, and so and further management of the package using the package management software will no longer be able to track these modified files.

  • I found that in the makefile, make install just does /usr/bin/install pdftk /usr/local/bin. The command pdftk points to the new /usr/local/bin/pdftk rather the old /usr/bin/pdftk. Is it because '/usr/local/bin` is searched before /usr/bin? The manpage and the dpkg -l pdftk are still not changed, i.e. still about the old executable. – StackExchange for All Jul 9 '14 at 19:42
  • @Tim - yeah your $PATH env. var. has /usr/local/bin occurring before /usr/bin so when it encounters pdftk in /usr/local/bin it uses that first. – slm Jul 9 '14 at 20:11
  • @Tim - dpkg -l pdftk doesn't actively search the filesystem so it's oblivious to the changes your make install made. This is kind of one of the dirty secrets of package management. It's a very loose coupling b/w what it views is installed on the system vs. what's actually installed on the HDD. – slm Jul 9 '14 at 20:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.