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

sda*_*aau 14 debian checkinstall

好的,这是让我感到困惑的一件事......我正在尝试从源代码构建一个包,然后使用它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
Run Code Online (Sandbox Code Playgroud)

好的,注意到我在--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 ==========================
Run Code Online (Sandbox Code Playgroud)

NOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO

我不想安装那个该死的包——这就是为什么我用它来--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
Run Code Online (Sandbox Code Playgroud)

你一定是在开玩笑“注意:不会安装软件包”,对吧,先生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
Run Code Online (Sandbox Code Playgroud)

不确定那1.10-1是从哪里来的(它至少应该是,1.3.4如上所述?) - 但很明显 2.7 确实被安装了,尽管我没有安装指令......

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

$ 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
Run Code Online (Sandbox Code Playgroud)

......但甚至没有dpkg --purge工作(apt-get remove不会工作开始说起,因为它是一个手动安装的.deb软件包)。而且除了dpkg -r没有提供版本(所以我不确定应该删除的是什么) - 它实际上并没有删除该死的可执行文件?!

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

sda*_*aau 13

对; 我想我终于明白发生了什么 - 我错过的关键是:

Installing with make install...
Run Code Online (Sandbox Code Playgroud)

这意味着make install运行了 2.7 源包的 - 可能是为了“查看”这些文件最终会在哪里结束,以便将这些位置写入新的 .deb 中?但无论如何,新的 2.7 .deb 确实没有安装 - 这就是为什么它不能用 删除dpkg -r,并且可执行文件即使在.deb之后仍然存在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
Run Code Online (Sandbox Code Playgroud)

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

$ 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
Run Code Online (Sandbox Code Playgroud)

哦,好吧……但希望我现在正确理解了这个过程是如何进行的……


小智 6

应该将fstrans更改为yes以确保 checkinstall 不会触及真正的文件树

--fstrans=yes
Run Code Online (Sandbox Code Playgroud)


mus*_*ach 5

您可以安装“两次”:

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

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

例子:

  • 根本不需要安装:

    sudo checkinstall --install=no make

  • 通过 make 安装:

    sudo checkinstall --install=no make install