Debian checkinstall忽略install = no; 如何构建它,但不能自动安装软件包?


14

好的,这是让我感到困惑的一件事...我试图从源代码构建一个程序包,然后使用它checkinstall来生成.deb程序包。请注意,我只想创建.deb软件包,但不想安装它。

因此,这是一个示例-我在Ubuntu 11.04上,首先我feh从默认存储库安装了该软件包;它的版本号显然是1.3.4.dfsg.1-3

然后我试图feh 从源头建立; 必须make通过,并且可以从命令行运行新代码feh;灿烂。

现在最后,要创建一个deb包,我使用以下命令行:

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 <pkg-phototools-devel@lists.alioth.debian.org>" \
  --pakdir=../.. \
  --requires=libc6,libice6,libsm6,libx11-6,libxaw7,libxext6,libxmu6,libxt6,dpkg,install-info

好吧,注意我曾经在--install=no那儿使用过吗?甚至man checkinstall说:

--install切换安装已创建的软件包。

嗯,这是该checkinstall命令的答复:

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 <pkg-phototools-devel@lists.alioth.debian.org>'

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 !!!!!!!!!!

我不希望该死的软件包安装-这就是为什么我要--install=no大声哭泣!!!

然后,显然是为了讽刺,日志继续:

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

您一定是在跟这个“ 注意:该软件包将不会安装 ”,对吧checkinstall?当然可以;完成此操作后,请注意我得到的:

$ 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

不知道它是1.10-1从哪里来的(至少应该1.3.4按照上面所述?)-但是该死的很明显是安装了2.7 DID,尽管我的指令没有安装...

当然,我可以尝试在之后删除:

$ 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

...但什至不起作用dpkg --purgeapt-get remove由于它是手动安装的.deb软件包,因此一开始就不起作用)。而且除了dpkg -r不提供版本之外(所以我不确定是否应该删除该版本)-实际上,它没有删除该死的可执行文件吗?

但是,任何人都可以解释是怎么回事这里-以及如何checkinstall产生一个.deb文件,并在同一时间去安装它?额外的问题-如何删除以这种方式安装的所有文件,包括中的可执行文件/usr/local/bin/-显然dpkg -r不起作用?


我很困惑 如果您有二进制软件包,为什么要从源代码安装?
Faheem Mitha 2013年

以及如何解决--maintainer的错误?
水瓶座力量

我看了一下checkinstall源RE:--maintainer错误。问题是未加<和>符号的结果。因此,简单的答案是:不要使用符号。更有问题的答案是checkinstall存在严重问题。整个来源杂乱无章eval echo $1...实际上应该是eval "echo '$1'"。我想我会尽量与作者联系。
2015年

Answers:


13

对; 我想我终于了解了正在发生的事情-我错过的关键是:

Installing with make install...

这意味着make install2.7源程序包的-已运行-可能是为了“查看”那些文件最终将在何处结束,以便将这些位置写入新的.deb?但是无论如何,新的2.7 .deb确实没有安装-这就是为什么无法将其删除的原因dpkg -r,并且甚至在之后该可执行文件仍然存在dpkg -r

因此,要在运行后删除此安装checkinstall,实际上应该make uninstallfeh源文件夹中调用:

$ 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

...然后最后我可以尝试新创建的包:

$ 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

哦,好吧……希望我能正确理解现在的流程。



4

您可以安装“两次”:

  1. 通过您创建的包。您可以通过以下方式将其关闭--install=no

  2. 通过制造。您只需输入即可make(不带install)将其关闭

例子:

  • 完全无需安装:

    sudo checkinstall --install=no make

  • 通过make安装:

    sudo checkinstall --install=no make install


我认为这是最好的答案。
jgomo3

1
“ sudo checkinstall --install = no --fstrans = yes make”对我有用。我将此答案与此答案混合:unix.stackexchange.com/a/170170/156284
Teo

-1

您应该尝试使用:

sudo checkinstall --install=no make -n install

-1

使用:sudo checkinstall -D make -n install


请解释您的答案。
vonbrand 2014年

1
make -n install确实停止make安装文件,但是checkinstall没有正确解释结果。您最终得到的deb文件不包含所需的所有文件。因此,这不起作用。
Tim Tisdall 2014年
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.