ubuntu已装上好几天了,还是装不了自己想要用的tar.gz包
现在就是想骂人了!!!
发现心慕已久的ubuntu不适合编程用,配置IDE就让人烦!!
安装还非得用apt命令的方式,不人性化!!!
现在十分想安tar.gz的包,请大家给个招!!
sudo apt-get install Checkinstall安不了,请问大家的是怎么弄的????
ubuntu上怎么用tar.gz和rpm包!!
-
- 帖子: 8
- 注册时间: 2006-12-06 13:36
-
- 帖子: 140
- 注册时间: 2006-10-15 12:59
- 联系:
-
- 帖子: 8
- 注册时间: 2006-12-06 13:36
-
- 帖子: 8
- 注册时间: 2006-12-06 13:36
checkinstall使用详解
一. 简介
checkinstall现在的最新版本是1.6.0beta2,稳定版本是1.5.3,可以到http://asic-linux.com.mx/~izto/checkinstall/download.php下载pkg包。
下载下来的文件为checkinstall-1.5.3-i386-1.tgz,请用installpkg 安装。
Checkinstall 是一个能从 tar.gz类的源代码自动生成RPM/Debian或Slackware安装包的程序。这样使你能用几乎所有的 tar.gz 类的源代码生成“干净”的安装或者卸载包。
经常出现这样的问题:你很想试用的程序只有 tar.gz的源代码可用(没人提供 rpm 或者 Debian包)。这样,你只好下载回源代码,解压,然后手动编译。到目前为止,一切正常。然而,当你想删掉它的时候呢?
Makefile文件只包括了很少情况下的卸载例程。当然,你可以把程序安装到临时文件夹,然后记下所有由程序生成或修改的文件,最后删除他们。但是如果这个程序要经常重新编译,那样做是非常痛苦的,工作量也是相当大的。 Felipe Eduardo所写的 CheckInstall [1] Sánchez Díaz Durán 就是用来解决这个问题的。
一般说来,我们编译安 装一个由GNU Autoconf配置的程序是采用如下的步骤: ./configure && make && make install.
这个 configure 脚本文件是用来“猜”出一系列系统相关的变量,这些变量是在后面的编译过程要用到的。它将检查系统变量值是否满足编译要求,然后使用这些变量在程序包内每个文件夹下生成 Makefile 。此外,configure 脚本还会生成其他文件,他们是:
* 每个文件夹/子文件夹下的一个或多个Makefile(s)
* 一个名叫config.status的脚本
* 一个文本文件config.log
* 另一个名叫config.cache的脚本(可选的)
* 带有系统特殊定义的C头文件(*.h)(可选项)
configure脚本文件成功运行之后, 你会输入make来编译程序,得到你需要的可执行文件。你也可能在make之后马上使用make check来运行测试。但是这只是可选的步骤,因为这需要这个程序包的支持。如果 make成功的完成了,你可以使用make install来安装这个程序了——很明显,完成这步你需要一些相关权限。程序安装好了,你可以在源代码的文件夹下输入make clean来清除这些生成的可执行文件和目标文件。如果你还想删除由configure生成的文件,那么输入 then typemake distclean。后两步同make check一样(是可选的),它们通常是开发者在开发和测试阶段所使用,也可以被一般使用者用来节省硬盘空间或者保持文件夹的结构简洁明快。另外make distclean使得我们在不同类型的电脑上编译程序成为可能。 在基本介绍之外,你可以通过写你自己的configure脚本、用M4编程和创建自己的宏等方式来学习更多有关GNU Build System的知识。
现在该是换一种方式的时候了,你可以使用CheckInstall。它采用自己的指令checkinstall来代替make install。其他两个指令保留下来跟以前一样,因此,现在这个指令序列使用 CheckInstall变成了: ./configure && make && checkinstall
指令checkinstall不仅默认运行了make install,而且还监测所有安装过程中的写操作。为此,CheckInstall使用了Pancrazio de Mauro 所写的程序Installwatch [3]。在make install成功完成之后,CheckInstall会产生一个Slackware-, Debian- 或RPM- 安装包,然后按照软件包的默认配置安装程序,并在当前目录(或标准安装包存储目录)留下一个生成的安装包。而外,你可以通过修改变量PAK_DIR来修改保存这个目录。这样生成的安装包安装到其他机器上而无须重新编译——当然,还得考虑软件包的相互依赖性。
CheckInstall并不只是使用make install,它还可以与其他安装指令相协调。例如,如果安装指令为setup.sh,那么安装指令序列变成:
./configure && make && checkinstall setup.sh
我们还可以让CheckInstall带着很多参数运行。如下命令会显示所有可用的子参数,这些子参数大致分为:安装选项(Install options), 脚本处理选项(Scripting options), 信息显示选项(Info display options),安装包选项(Package tuning options),清除选项(Cleanup options)和关于CheckInstall(About CheckInstall)等。
checkinstall -h 如果CheckInstall带着这些参数运行,他会使用这些参数值来代替配置文件checkinstallrc中相应的值。
CheckInstall也有自己的局限之处。它不能处理静态连接的程序,因为这样Installwatch就不能监测到安装过程中修改过文件了。总体说来,有两类连接库:动态的和静态的。这些连接库通过include-指令整合到程序中。静态连接过的程序已经包含了所有需要的库文件,运行时也就不需要再将这些库载入内存中。这种程序与安装在系统中的连接库无关,因为所谓的连接器(Linker)已经在编译时把这些库内置到可执行程序里了。
二 . 配置
你可以通过修改文件/usr/lib/local/checkinstall/checkinstallrcCheckInstall的默认配置。
尽管CheckInstall每次运行都会询问生成何种类型安装包,明智的办法还是手工修改/设置INSTYPE变量。看看变量 INSTALL、PAK_DIR和RPM_FLAGS或者DPKG_FLAGS也是值得推荐的。最后两个变量允许你定义一些可选的安装标志,通过修改 PAK_DIR你可以指定安装包的存储目录。而INSTALL让你决定是只生成安装包呢还是一起将这个包马上安装。
$ cat /usr/lib/local/checkinstall/checkinstallrc
####################################################################
# CheckInstall configuration file #
########################################
####################################################################
# These are default settings for CheckInstall, modify them as you #
# need. Remember that command line switches will override them. #
####################################################################
# Debug level
# 0: No debug
# 1: Keep all temp files except the package's files
# 2: Keep the package's files too
DEBUG=0
# Location of the "installwatch" program
INSTALLWATCH_PREFIX="/usr/local"
INSTALLWATCH= ${INSTALLWATCH_PREFIX}/bin/installwatch
# Location of the makepkg program. "makepak" is the default, and is
# included with checkinstall. If you want to use Slackware's native "makepkg"
# then set this to "makepkg"
MAKEPKG=/sbin/makepkg
# makepkg optional flags. These are recommended if running a newer Slackware
# version: "-l y -c n"
MAKEPKG_FLAGS="-l y -c n"
# Is MAKEPKG running interactively? If so, you might want
# to see what it's doing:
SHOW_MAKEPKG=0
# Where will we keep our temp files?
BASE_TMP_DIR=/var/tmp ## Don't set this to /tmp or / !!
# Where to place the installed document files
DOC_DIR=""
# Default architecture type (Leave it empty to allow auto-guessing)
ARCHITECTURE=""
# Default package type. Leave it empty to enable asking everytime
# S : Slackware
# R : RPM
# D : Debian
INSTYPE="R"
# Storage directory for newly created packages
# By default they will be stored at the default
# location defined for the package type
PAK_DIR=""
# RPM optional flags
RPM_FLAGS=" --force --nodeps --replacepkgs "
# dpkg optional flags
DPKG_FLAGS=""
## These are boolean. Set them to 1 or 0
# Interactively show the results of the install command (i.e. "make install")?
# This is useful for interactive installation commands
SHOW_INSTALL=1
# Show Slackware package installation script while it runs? Again, useful if
# it's an interactive script
SHOW_SLACK_INSTALL=0
# Automatic deletion of "doc-pak" upon termination?
DEL_DOCPAK=1
# Automatic deletion of the spec file?
DEL_SPEC=1
# Automatic deletion of "description-pak"?
DEL_DESC=1
# Automatically strip all ELF binaries?
STRIP_ELF=1
# Automatically strip all ELF shared libraries?
# Note: this setting will automatically be set to "0" if STRIP_ELF=0
STRIP_SO_ELF=1
# Automatically search for shared libraries and add them to /etc/ld.so.conf?
# This is experimental and could mess up your dynamic
三 . 实例
下面以zhcon为例,说明制作的过程。
tar zxvf zhcon-0.2.3.tar
cd zhcon-0.2.3
./configure
make
上面这几步同从源代码编译安装一样,如果不用checkinstall制作slackware软件包,下一步该是make install了。我们要用checkinstall,所以用执行checkinstall代替。
在运行checkinstall之前,要在当前目录下创建一个对这个软件包的描述文件description-pak,但这个文件不是必须的。
cat > description-pak
zhcon-0.2.3
Zhcon is a fast Linux Console Chinese System which supports
framebuffer device.It can display Chinese, Japanese or Korean
double byte characters.Supported language encodings include:
GB2312, GBK, BIG5, JIS and KSC.
另外还可以在当前目录下创建4个特殊的脚本文件preinstall-pak, postinstall-pak, preremove-pak和postremove-pak。
preinstall-pak在被安装之前执行,postinstall-pak在被安装之后执行,preremove-pak在被删除之前执行,postremove-pak在被删除之后执行。同样,这4个脚本文件不是必须的。
如果要制作的软件有一些特殊的要求,比如创建一个特殊的用户或者组,这4个脚本就有作用了。
然后在当前目录下创建一个doc-pak的目录,这个目录是用来存放软件的相关文档的。比如说README, INSTALL, COPYING, Changelog, TODO, CREDITS等文件。这些文件在安装软件包时将被拷到/usr/doc/”软件包名称“目录下。如果你现在不创建,在生成软件包时将提醒你是否创建这个目录和拷贝相关文件,如果你再选择否,那么制作的软件包将没有文档。
下面开始用checkinstall创建软件包了,在执行之前确保你是root用户。执行checkinstall。
checkinstall
如果开始你没有创建doc-pak目录,此时将会提示你是否创建。
The package documentation directory ./doc-pak does not exist.
Should I create a default set of package docs? [y]:
按y自动创建和拷贝,按n取消。
下面checkinstall将创建安装软件包,checkinstall默认安装命令是 make install,你得根据你的软件安装说明具体而定,有些软件的安装命令不是make install,而是其他,你则换成
checkinstall make modules_install
checkinstall install.sh
checkinstall setup
等形式。这样,我们也可以把一些以二进制包发布的软件用checkinstall创建为slackware的软件包,只要再checkinstall后面加上安装指令作为参数即可。
下一步checkinstall将会询问创建什么软件包,
Please choose the packaging method you want to use.
Slackware , RPM [R] or Debian [D]?
选择s创建slackware的pkg软件包,选r创建redhat的rpm软件包,选d创建debian的deb软件包。我们选择s继续。
This package will be built according to these values:
1 - Summary: [ zhcon-0.2.3 ]
2 - Name: [ zhcon ]
3 - Version: [ 0.2.3 ]
4 - Release: [ 1 ]
5 - License: [ GPL ]
6 - Group: [ Applications/System ]
7 - Architecture: [ i386 ]
8 - Source location: [ zhcon-0.2.3 ]
9 - Alternate source location: [ ]
Enter a number to change any of them or press ENTER to continue:
checkinstall给出一个菜单让你选择修改软件包的一些属性,想修改就按对应的数字键,否则回车继续。我们按7修改软件包的系统平台,
Enter the architecture type:
>> i686
This package will be built according to these values:
1 - Summary: [ zhcon-0.2.3 ]
2 - Name: [ zhcon ]
3 - Version: [ 0.2.3 ]
4 - Release: [ 1 ]
5 - License: [ GPL ]
6 - Group: [ Applications/System ]
7 - Architecture: [ i686 ]
8 - Source location: [ zhcon-0.2.3 ]
9 - Alternate source location: [ ]
Enter a number to change any of them or press ENTER to continue:
然后回车继续,checkinstall将会在当前目录生成制作好的pkg软件包并安装它。
我们的软件包创建到此成功结束。
checkinstall现在的最新版本是1.6.0beta2,稳定版本是1.5.3,可以到http://asic-linux.com.mx/~izto/checkinstall/download.php下载pkg包。
下载下来的文件为checkinstall-1.5.3-i386-1.tgz,请用installpkg 安装。
Checkinstall 是一个能从 tar.gz类的源代码自动生成RPM/Debian或Slackware安装包的程序。这样使你能用几乎所有的 tar.gz 类的源代码生成“干净”的安装或者卸载包。
经常出现这样的问题:你很想试用的程序只有 tar.gz的源代码可用(没人提供 rpm 或者 Debian包)。这样,你只好下载回源代码,解压,然后手动编译。到目前为止,一切正常。然而,当你想删掉它的时候呢?
Makefile文件只包括了很少情况下的卸载例程。当然,你可以把程序安装到临时文件夹,然后记下所有由程序生成或修改的文件,最后删除他们。但是如果这个程序要经常重新编译,那样做是非常痛苦的,工作量也是相当大的。 Felipe Eduardo所写的 CheckInstall [1] Sánchez Díaz Durán 就是用来解决这个问题的。
一般说来,我们编译安 装一个由GNU Autoconf配置的程序是采用如下的步骤: ./configure && make && make install.
这个 configure 脚本文件是用来“猜”出一系列系统相关的变量,这些变量是在后面的编译过程要用到的。它将检查系统变量值是否满足编译要求,然后使用这些变量在程序包内每个文件夹下生成 Makefile 。此外,configure 脚本还会生成其他文件,他们是:
* 每个文件夹/子文件夹下的一个或多个Makefile(s)
* 一个名叫config.status的脚本
* 一个文本文件config.log
* 另一个名叫config.cache的脚本(可选的)
* 带有系统特殊定义的C头文件(*.h)(可选项)
configure脚本文件成功运行之后, 你会输入make来编译程序,得到你需要的可执行文件。你也可能在make之后马上使用make check来运行测试。但是这只是可选的步骤,因为这需要这个程序包的支持。如果 make成功的完成了,你可以使用make install来安装这个程序了——很明显,完成这步你需要一些相关权限。程序安装好了,你可以在源代码的文件夹下输入make clean来清除这些生成的可执行文件和目标文件。如果你还想删除由configure生成的文件,那么输入 then typemake distclean。后两步同make check一样(是可选的),它们通常是开发者在开发和测试阶段所使用,也可以被一般使用者用来节省硬盘空间或者保持文件夹的结构简洁明快。另外make distclean使得我们在不同类型的电脑上编译程序成为可能。 在基本介绍之外,你可以通过写你自己的configure脚本、用M4编程和创建自己的宏等方式来学习更多有关GNU Build System的知识。
现在该是换一种方式的时候了,你可以使用CheckInstall。它采用自己的指令checkinstall来代替make install。其他两个指令保留下来跟以前一样,因此,现在这个指令序列使用 CheckInstall变成了: ./configure && make && checkinstall
指令checkinstall不仅默认运行了make install,而且还监测所有安装过程中的写操作。为此,CheckInstall使用了Pancrazio de Mauro 所写的程序Installwatch [3]。在make install成功完成之后,CheckInstall会产生一个Slackware-, Debian- 或RPM- 安装包,然后按照软件包的默认配置安装程序,并在当前目录(或标准安装包存储目录)留下一个生成的安装包。而外,你可以通过修改变量PAK_DIR来修改保存这个目录。这样生成的安装包安装到其他机器上而无须重新编译——当然,还得考虑软件包的相互依赖性。
CheckInstall并不只是使用make install,它还可以与其他安装指令相协调。例如,如果安装指令为setup.sh,那么安装指令序列变成:
./configure && make && checkinstall setup.sh
我们还可以让CheckInstall带着很多参数运行。如下命令会显示所有可用的子参数,这些子参数大致分为:安装选项(Install options), 脚本处理选项(Scripting options), 信息显示选项(Info display options),安装包选项(Package tuning options),清除选项(Cleanup options)和关于CheckInstall(About CheckInstall)等。
checkinstall -h 如果CheckInstall带着这些参数运行,他会使用这些参数值来代替配置文件checkinstallrc中相应的值。
CheckInstall也有自己的局限之处。它不能处理静态连接的程序,因为这样Installwatch就不能监测到安装过程中修改过文件了。总体说来,有两类连接库:动态的和静态的。这些连接库通过include-指令整合到程序中。静态连接过的程序已经包含了所有需要的库文件,运行时也就不需要再将这些库载入内存中。这种程序与安装在系统中的连接库无关,因为所谓的连接器(Linker)已经在编译时把这些库内置到可执行程序里了。
二 . 配置
你可以通过修改文件/usr/lib/local/checkinstall/checkinstallrcCheckInstall的默认配置。
尽管CheckInstall每次运行都会询问生成何种类型安装包,明智的办法还是手工修改/设置INSTYPE变量。看看变量 INSTALL、PAK_DIR和RPM_FLAGS或者DPKG_FLAGS也是值得推荐的。最后两个变量允许你定义一些可选的安装标志,通过修改 PAK_DIR你可以指定安装包的存储目录。而INSTALL让你决定是只生成安装包呢还是一起将这个包马上安装。
$ cat /usr/lib/local/checkinstall/checkinstallrc
####################################################################
# CheckInstall configuration file #
########################################
####################################################################
# These are default settings for CheckInstall, modify them as you #
# need. Remember that command line switches will override them. #
####################################################################
# Debug level
# 0: No debug
# 1: Keep all temp files except the package's files
# 2: Keep the package's files too
DEBUG=0
# Location of the "installwatch" program
INSTALLWATCH_PREFIX="/usr/local"
INSTALLWATCH= ${INSTALLWATCH_PREFIX}/bin/installwatch
# Location of the makepkg program. "makepak" is the default, and is
# included with checkinstall. If you want to use Slackware's native "makepkg"
# then set this to "makepkg"
MAKEPKG=/sbin/makepkg
# makepkg optional flags. These are recommended if running a newer Slackware
# version: "-l y -c n"
MAKEPKG_FLAGS="-l y -c n"
# Is MAKEPKG running interactively? If so, you might want
# to see what it's doing:
SHOW_MAKEPKG=0
# Where will we keep our temp files?
BASE_TMP_DIR=/var/tmp ## Don't set this to /tmp or / !!
# Where to place the installed document files
DOC_DIR=""
# Default architecture type (Leave it empty to allow auto-guessing)
ARCHITECTURE=""
# Default package type. Leave it empty to enable asking everytime
# S : Slackware
# R : RPM
# D : Debian
INSTYPE="R"
# Storage directory for newly created packages
# By default they will be stored at the default
# location defined for the package type
PAK_DIR=""
# RPM optional flags
RPM_FLAGS=" --force --nodeps --replacepkgs "
# dpkg optional flags
DPKG_FLAGS=""
## These are boolean. Set them to 1 or 0
# Interactively show the results of the install command (i.e. "make install")?
# This is useful for interactive installation commands
SHOW_INSTALL=1
# Show Slackware package installation script while it runs? Again, useful if
# it's an interactive script
SHOW_SLACK_INSTALL=0
# Automatic deletion of "doc-pak" upon termination?
DEL_DOCPAK=1
# Automatic deletion of the spec file?
DEL_SPEC=1
# Automatic deletion of "description-pak"?
DEL_DESC=1
# Automatically strip all ELF binaries?
STRIP_ELF=1
# Automatically strip all ELF shared libraries?
# Note: this setting will automatically be set to "0" if STRIP_ELF=0
STRIP_SO_ELF=1
# Automatically search for shared libraries and add them to /etc/ld.so.conf?
# This is experimental and could mess up your dynamic
三 . 实例
下面以zhcon为例,说明制作的过程。
tar zxvf zhcon-0.2.3.tar
cd zhcon-0.2.3
./configure
make
上面这几步同从源代码编译安装一样,如果不用checkinstall制作slackware软件包,下一步该是make install了。我们要用checkinstall,所以用执行checkinstall代替。
在运行checkinstall之前,要在当前目录下创建一个对这个软件包的描述文件description-pak,但这个文件不是必须的。
cat > description-pak
zhcon-0.2.3
Zhcon is a fast Linux Console Chinese System which supports
framebuffer device.It can display Chinese, Japanese or Korean
double byte characters.Supported language encodings include:
GB2312, GBK, BIG5, JIS and KSC.
另外还可以在当前目录下创建4个特殊的脚本文件preinstall-pak, postinstall-pak, preremove-pak和postremove-pak。
preinstall-pak在被安装之前执行,postinstall-pak在被安装之后执行,preremove-pak在被删除之前执行,postremove-pak在被删除之后执行。同样,这4个脚本文件不是必须的。
如果要制作的软件有一些特殊的要求,比如创建一个特殊的用户或者组,这4个脚本就有作用了。
然后在当前目录下创建一个doc-pak的目录,这个目录是用来存放软件的相关文档的。比如说README, INSTALL, COPYING, Changelog, TODO, CREDITS等文件。这些文件在安装软件包时将被拷到/usr/doc/”软件包名称“目录下。如果你现在不创建,在生成软件包时将提醒你是否创建这个目录和拷贝相关文件,如果你再选择否,那么制作的软件包将没有文档。
下面开始用checkinstall创建软件包了,在执行之前确保你是root用户。执行checkinstall。
checkinstall
如果开始你没有创建doc-pak目录,此时将会提示你是否创建。
The package documentation directory ./doc-pak does not exist.
Should I create a default set of package docs? [y]:
按y自动创建和拷贝,按n取消。
下面checkinstall将创建安装软件包,checkinstall默认安装命令是 make install,你得根据你的软件安装说明具体而定,有些软件的安装命令不是make install,而是其他,你则换成
checkinstall make modules_install
checkinstall install.sh
checkinstall setup
等形式。这样,我们也可以把一些以二进制包发布的软件用checkinstall创建为slackware的软件包,只要再checkinstall后面加上安装指令作为参数即可。
下一步checkinstall将会询问创建什么软件包,
Please choose the packaging method you want to use.
Slackware , RPM [R] or Debian [D]?
选择s创建slackware的pkg软件包,选r创建redhat的rpm软件包,选d创建debian的deb软件包。我们选择s继续。
This package will be built according to these values:
1 - Summary: [ zhcon-0.2.3 ]
2 - Name: [ zhcon ]
3 - Version: [ 0.2.3 ]
4 - Release: [ 1 ]
5 - License: [ GPL ]
6 - Group: [ Applications/System ]
7 - Architecture: [ i386 ]
8 - Source location: [ zhcon-0.2.3 ]
9 - Alternate source location: [ ]
Enter a number to change any of them or press ENTER to continue:
checkinstall给出一个菜单让你选择修改软件包的一些属性,想修改就按对应的数字键,否则回车继续。我们按7修改软件包的系统平台,
Enter the architecture type:
>> i686
This package will be built according to these values:
1 - Summary: [ zhcon-0.2.3 ]
2 - Name: [ zhcon ]
3 - Version: [ 0.2.3 ]
4 - Release: [ 1 ]
5 - License: [ GPL ]
6 - Group: [ Applications/System ]
7 - Architecture: [ i686 ]
8 - Source location: [ zhcon-0.2.3 ]
9 - Alternate source location: [ ]
Enter a number to change any of them or press ENTER to continue:
然后回车继续,checkinstall将会在当前目录生成制作好的pkg软件包并安装它。
我们的软件包创建到此成功结束。
-
- 帖子: 31
- 注册时间: 2006-12-09 1:11
- freeflying
- 帖子: 521
- 注册时间: 2005-03-26 9:38
-
- 帖子: 14
- 注册时间: 2007-05-30 18:26
- nihui
- 帖子: 1746
- 注册时间: 2006-10-21 12:03
- 来自: Shanghai
- 联系:
- BigSnake.NET
- 帖子: 12522
- 注册时间: 2006-07-02 11:16
- 来自: 廣州
- 联系: