Linux Source Installation Tool Checkinstall__linux

Source: Internet
Author: User

Checkinstall is a program that automatically generates Rpm/debian or Slackware installation packages from source code of the Tar.gz class. With Checkinstall, you can generate a "clean" installation or uninstall package with almost all the source code for the Tar.gz class.
Introduction

It is often the case that a program that wants to be tested has only the source code (such as tar.gz) available, and no one offers RPM or Debian packages. You have to download the source code, unzip, and then manually compile. So far, everything is fine. However, when you want to delete it.

The Makefile file includes only a few instances of uninstall routines. Of course, you can install the program to the temporary folder, and then write down all the files generated or modified by the program, and then delete them. But if the program is going to be recompiled often, it's very painful and quite a lot of work. The Checkinstall written by Felipe Eduardo is used to solve this problem.


using the GNU autoconf installer

Generally, we compile and install a program that is configured by the GNU autoconf using the following steps:

./configure && make && make install

This configure script file is used to "guess" a series of system-related variables that are used in the subsequent compile process. It checks whether the system variable values meet the compilation requirements, and then uses these variables to generate Makefile in each folder within the package. In addition, the Configure script generates additional files: one or more Makefile (s) in each folder/subfolder, a script named Config.status, a text file Config.log

Once the Configure script file runs successfully, you will enter make to compile the program to get the executable you need. If make is completed successfully, you can use make install to install the program. installing programs with Checkinstall

In the last section we used the GNU autoconf to compile the program, now it's time to do it in a different way. You can use the Checkinstall tool. It uses its own instruction Checkinstall instead of make install. The other two instructions remain the same as before, so now this sequence of instructions uses Checkinstall to become:

./configure && Make && Checkinstall

Directive Checkinstall not only runs the make install by default, but it also monitors write operations during all installations. To this end, Checkinstall used the program Installwatch written by Pancrazio de Mauro. After make install is successfully completed, Checkinstall produces a slackware-,debian-or rpm-installation package and then installs the program according to the package's default configuration and leaves a generated installation package in the current directory (or standard installation package storage directory). You can modify the save directory by modifying the variable Pak_dir.

Checkinstall is not just using make install, it can also be compatible with other installation instructions. For example, if the installation instruction is setup.sh, then the sequence of installation instructions becomes:

./configure && make && checkinstall setup.sh

We can also let Checkinstall run with a lot of parameters. Figure 1. Run the command "Checkinstall–h" to display all available child parameters

 

These sub parameters are roughly divided into: installation options (Install options) script processing options (scripting options) information display options (info display options) installation package options (Package tuning options) Clear selection Item (Cleanup options) about Checkinstall (about Checkinstall).

If Checkinstall runs with these parameters, it uses these parameter values instead of the corresponding values in the configuration file CHECKINSTALLRC.

Checkinstall also has its own limitations. It cannot handle statically connected programs because the Installwatch cannot monitor changes to the file during installation. Generally speaking, there are two types of connection libraries: dynamic and static. These connection libraries are integrated into the program through the include directives. Statically connected programs already contain all of the required library files, and the runtime does not need to load these libraries into memory. This program is independent of the connection libraries installed in the system, because the so-called connectors (Linker) have built these libraries into executable programs at compile time.

Back to the top of the page Checkinstall installation

We can download a variety of precompiled installation packages or the appropriate source packages on the Checkinstall home page. The entire process of installing the latest source code checkinstall-1.6.1.tgz is shown below. This will be installed on Checkinstall, Installwatch and Makepak, where Makepak is a modified version of Makepkg. If you are interested in the new version of the improvements, see release Notes and Changelog. Listing 1. RPM installation package for generating Checkinstall

# tar Xzf checkinstall-1.6.1.tgz
# cd checkinstall-1.6.1
checkinstall-1.6.1# make
checkinstall-1.6.1# Make install
checkinstall-1.6.1# checkinstall
Figure 2. To run the command "Checkinstall" to generate the RPM package diagram process Figure 2.1. Process one Figure 2.2. Process two Figure 2.3. Process three

checkinstall-1.6.1 's RPM package has been generated and we use RPM to install it. Listing 2. Installing Checkinstall with the generated RPM package

checkinstall-1.6.1# cd/usr/src/redhat/rpms/i386/
i386# rpm-i checkinstall-1.6.1.rpm

checkinstall-1.6.1 installation completed. Using the Package Manager's query statement, you can check that the files in the installation package are fully documented in the library, and you can also view some additional information about the installation of the Baotou section. Figure 3. Check the Checkinstall RPM package

Back to the top of the page checkinstall configuration

You can change the Checkinstall default configuration by modifying the configuration file/USR/LOCAL/LIB/CHECKINSTALL/CHECKINSTALLRC.

The notable variables of the file are Instype,install and Pak_dir.

The Instype variable determines what type of installation package is generated. Figure 4. View variable Instype

The Pak_dir variable determines the storage directory where the package is installed. Figure 5. View variable Pak_dir

The INSTALL variable determines whether to build only the installation package or to install the package immediately. (Checkinstall tracks the path of all files created or modified by the Install command line (for example, "Make install", "Make Install_modules", and so on) and establishes a standard binary package. Allows you to install or uninstall it with your release's standard package management system

0-Only build the installation package

1-Not only build the installation package, but also install the package immediately Figure 6. View variable INSTALL

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.