好吧,这是让我困惑的一件事......我正在尝试从源代码构建一个包,然后用于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 <[email protected]>" \
--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 <[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 ==========================
不啊啊啊啊啊啊!!!!!!!!!
我不想安装这个该死的软件包——这就是我--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 确实被安装了,尽管我指示不要安装......
当然,我可以尝试稍后删除:
$ 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 --purge
(apt-get remove
一开始就不起作用,因为它是手动安装的 .deb 包)。除了dpkg -r
没有给出版本(所以我不太确定应该删除的是什么)之外 - 事实上它并没有删除该该死的可执行文件?!
但谁能解释一下这里发生了什么以及如何checkinstall
到达仅有的生成 .deb,而不同时安装它?额外问题 - 如何删除所有文件,包括中的可执行文件/usr/local/bin/
,以这种方式安装 - 因为显然dpkg -r
不起作用?
答案1
正确的;我想我终于明白发生了什么 - 我错过的关键是:
Installing with make install...
这意味着make install
2.7 源包的 已运行 - 可能是为了“查看”这些文件最终将在哪里结束,以便将这些位置写入新的 .deb 中?但无论如何,新的 2.7 .deb 确实没有安装 - 这就是为什么它无法用 删除dpkg -r
,并且即使在 .deb 之后可执行文件仍然存在dpkg -r
。
因此,要在运行后删除此安装checkinstall
,实际上应该make uninstall
从feh
源文件夹中调用:
$ 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
哦,好吧……但希望我正确理解了现在的过程是如何进行的……
答案2
一个人应该改变飞速传输到是的确保 checkinstall 不会触及真正的文件树
--fstrans=yes
答案3
您可以安装“两次”:
通过您创建的包。您可以通过以下方式将其关闭
--install=no
通过品牌。您只需键入
make
(不带install
)即可将其关闭
例子:
根本没有安装:
sudo checkinstall --install=no make
通过 make 安装:
sudo checkinstall --install=no make install
答案4
使用: sudo checkinstall -D make -n install