15

Ok, here is one thing that puzzles me... I'm trying to build a package from source, and then use checkinstall to generate a .deb package. Note that I want to just create the .deb package, but I do NOT want to install it.

So, here's an example - I'm on Ubuntu 11.04, and first I install it's feh package from the default repositories; which has a version number apparently being 1.3.4.dfsg.1-3

Then I'm trying to build feh from source; got make to pass, and can run the new feh from the command line; splendid.

Now finally, to create a deb package, I use the following command line:

sudo checkinstall -D -y \
  --install=no \
  --fstrans=no \
  --reset-uids=yes \
  --pkgname=feh \
  --pkgversion=2.7 \
  --pkgrelease="tar.bz2" \
  --arch=i386 \
  --pkglicense=GPL \
  --maintainer="Debian PhotoTools Maintainers <[email protected]>" \
  --pakdir=../.. \
  --requires=libc6,libice6,libsm6,libx11-6,libxaw7,libxext6,libxmu6,libxt6,dpkg,install-info

OK, notice that I've used --install=no there? Even man checkinstall says:

--install Toggle installation of the created package.

Well, this is what this checkinstall command replies:

checkinstall 1.6.2, Copyright 2009 Felipe Eduardo Sanchez Diaz Duran
           This software is released under the GNU GPL.

/usr/bin/checkinstall: eval: line 598: syntax error near unexpected token `newline'
/usr/bin/checkinstall: eval: line 598: `echo Debian PhotoTools Maintainers <[email protected]>'

The package documentation directory ./doc-pak does not exist. 
Should I create a default set of package docs?  [y]: y

Preparing package documentation...OK

*****************************************
**** Debian package creation selected ***
*****************************************

This package will be built according to these values: 

0 -  Maintainer: [ root@mypc ]
1 -  Summary: [ Package created with checkinstall 1.6.2 ]
2 -  Name:    [ feh ]
3 -  Version: [ 2.7 ]
4 -  Release: [ tar.bz2 ]
5 -  License: [ GPL ]
6 -  Group:   [ checkinstall ]
7 -  Architecture: [ i386 ]
8 -  Source location: [ feh-2.7 ]
9 -  Alternate source location: [  ]
10 - Requires: [ libc6,libice6,libsm6,libx11-6,libxaw7,libxext6,libxmu6,libxt6,dpkg,install-info ]
11 - Provides: [ feh ]
12 - Conflicts: [  ]
13 - Replaces: [  ]

Enter a number to change any of them or press ENTER to continue: 

Installing with make install...

========================= Installation results ===========================
installing manuals to /usr/local/share/man
installing docs to /usr/local/share/doc/feh
installing executables to /usr/local/bin
installing fonts to /usr/local/share/feh/fonts
installing images to /usr/local/share/feh/images
installing examples to /usr/local/share/doc/feh/examples

======================== Installation successful ==========================

NOOOOOOOOOOOOOOOOO!!!!!!!!!!

I did NOT want the damn package to INSTALL -- THAT IS WHY I USED --install=no FOR CRYIN OUT LOUD!!!

And then, apparently in an attempt to be sarcastic, the log continues:

Copying documentation directory...
./
./TODO
./AUTHORS
./COPYING
./ChangeLog
./README

Copying files to the temporary directory...OK

Stripping ELF binaries and libraries...OK

Compressing man pages...OK

Building file list...OK

Building Debian package...OK

NOTE: The package will not be installed

You must be kidding with this "NOTE: The package will not be installed", right, Mr. checkinstall? Sure you are; after this is done, note what I get:

$ apt-cache show feh | grep Version
Version: 1.10-1

$ feh --version
feh version 2.7
Compile-time switches: curl xinerama 

$ which feh
/usr/local/bin/feh

Not sure where that 1.10-1 came from (it should have been at least 1.3.4, as per above?) - but its damn obvious that the 2.7 DID get installed, IN SPITE of my instruction NOT to install...

Surely, I can try to remove afterwards:

$ sudo dpkg -r feh
(Reading database ... 202193 files and directories currently installed.)
Removing feh ...
$ sudo dpkg --purge feh
(Reading database ... 202163 files and directories currently installed.)
Removing feh ...
Purging configuration files for feh ...
$ feh --version
feh version 2.7
Compile-time switches: curl xinerama 
$ which feh
/usr/local/bin/feh

... but not even dpkg --purge works (apt-get remove wouldn't work to begin with, since it's a manually installed .deb package). And besides dpkg -r not giving a version (so I'm not really sure what it is that should have been removed) - it in fact did NOT remove the bloody executable ?!

But can anyone explain what is going here - and how to get checkinstall to only generate a .deb, and NOT install it at the same time? Bonus question - how to remove ALL files, including executables in /usr/local/bin/, that got installed in this way - since apparently dpkg -r doesn't work?

4
  • I'm puzzled. Why do you want to install from source, if you have a binary package? Commented Dec 5, 2013 at 11:43
  • and how did you fix the error about --maintainer ? Commented Feb 22, 2015 at 15:56
  • 1
    I took a look at the checkinstall sources RE: the --maintainer error. The issue is the the result of unquoted < and > symbols. So the easy answer is: don't use symbols. The more problematic answer is that there is a serious problem with checkinstall. The entire source is littered with eval echo $1... It should actually be eval "echo '$1'". I guess I'll try to get in touch with the author or something.
    – Six
    Commented Mar 4, 2015 at 20:02
  • @Six found a workaround, double escape the symbols: askubuntu.com/a/1192581/46437 Commented Apr 2 at 18:34

5 Answers 5

13

Right; I think I finally understood what is happening - key line I missed is:

Installing with make install...

This means that the make install of the 2.7 source package was run - probably in order to "see" where those files will eventually end up, so as to write those locations in the new .deb? But in any case, the new 2.7 .deb indeed didn't get installed - and that is why it couldn't be removed with dpkg -r, and the executable was still lingering even after dpkg -r.

So to remove this installation after running checkinstall, one should actually call make uninstall from the feh source folder:

$ make uninstall
rm -f /usr/local/share/man/man1/feh.1 /usr/local/share/man/man1/feh-cam.1
rm -f /usr/local/share/man/man1/gen-cam-menu.1
rm -rf /usr/local/share/doc/feh
rm: cannot remove `/usr/local/share/doc/feh/TODO': Permission denied
rm: cannot remove `/usr/local/share/doc/feh/examples/keys': Permission denied
rm: cannot remove `/usr/local/share/doc/feh/examples/themes': Permission denied
rm: cannot remove `/usr/local/share/doc/feh/examples/buttons': Permission denied
rm: cannot remove `/usr/local/share/doc/feh/AUTHORS': Permission denied
rm: cannot remove `/usr/local/share/doc/feh/ChangeLog': Permission denied
rm: cannot remove `/usr/local/share/doc/feh/README': Permission denied
make: *** [uninstall] Error 1

$ sudo make uninstall
rm -f /usr/local/share/man/man1/feh.1 /usr/local/share/man/man1/feh-cam.1
rm -f /usr/local/share/man/man1/gen-cam-menu.1
rm -rf /usr/local/share/doc/feh
rm -f /usr/local/bin/feh /usr/local/bin/feh-cam /usr/local/bin/gen-cam-menu
rm -rf /usr/local/share/feh/fonts
rm -rf /usr/local/share/feh/images

... and then finally I can try the newly created package:

$ sudo dpkg -i feh_2.7-tar.bz2_i386.deb 
Selecting previously deselected package feh.
(Reading database ... 202165 files and directories currently installed.)
Unpacking feh (from feh_2.7-tar.bz2_i386.deb) ...
Setting up feh (2.7-tar.bz2) ...
Processing triggers for man-db ...

$ feh --version
feh version 2.7
Compile-time switches: curl xinerama 

$ sudo dpkg --purge feh
(Reading database ... 202198 files and directories currently installed.)
Removing feh ...
dpkg: warning: while removing feh, directory '/usr/local/share/doc' not empty so not removed.
Processing triggers for man-db ...

$ feh --version
bash: /usr/local/bin/feh: No such file or directory

# or in new terminal 
$ feh --version
The program 'feh' is currently not installed.  You can install it by typing:
sudo apt-get install feh

Oh well.... hope I understood correctly how the process goes now, though..

6

One should change fstrans to yes to ensure checkinstall will not touch the real filetree

--fstrans=yes
1
  • 1
    I used this switch in combination with --install=no and the files were installed but dpkg was not updated. Commented Dec 22, 2016 at 22:40
5

You can install "twice":

  1. Via the package which you created. You can switch it off by --install=no

  2. Via the make. You can switch it off by simply typing make (without install)

Examples:

  • No installation at all:

    sudo checkinstall --install=no make

  • An installation via make:

    sudo checkinstall --install=no make install

2
  • I think this is the best answer.
    – jgomo3
    Commented May 7, 2016 at 19:07
  • 1
    "sudo checkinstall --install=no --fstrans=yes make" worked for me. I mixed this answer with this one: unix.stackexchange.com/a/170170/156284
    – hrmncd
    Commented Feb 15, 2017 at 13:09
-1

You should try to use:

sudo checkinstall --install=no make -n install
-1

Use: sudo checkinstall -D make -n install

2
  • Please explain your answer.
    – vonbrand
    Commented Jan 25, 2014 at 18:19
  • 1
    make -n install does stop make from actually installing the files, but checkinstall doesn't properly interpret the results. You end up with a deb file not containing all of the files you need. So, this doesn't work. Commented Jun 6, 2014 at 18:11

You must log in to answer this question.

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