CheckInstall-convenient Linux source code Installation Tool

Source: Internet
Author: User
Article Title: CheckInstall-convenient Linux source code Installation tool. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

Checkinstall is a program that can automatically generate the RPM/Debian or Slackware installation package from the source code of the tar.gz class. In this way, you can use the source code of almost all tar.gz classes to generate "clean" installation or uninstall packages.

  Introduction

This problem often occurs: only the source code of tar.gz is available (no rpm or Debian package is available ). In this way, you have to download back the source code, decompress it, And then manually compile it. So far, everything is normal. But what if you want to delete it?

The Makefile file contains only a few unload routines. Of course, you can install the program to a temporary folder, write down all the files generated or modified by the program, and delete them. However, if this program needs to be re-compiled frequently, it will be very painful and the workload will be quite large. The CheckInstall [1] Sánchez Díaz dán written by Felipe Eduardo is used to solve this problem.

To install a program configured by GNU Autoconf, follow these steps:

./configure && make && make install.

This configure script file is used to "Guess" a series of system-related variables that will be used in subsequent compilation processes. It will check whether the system variable value meets the compilation requirements, and then use these variables to generate Makefile in each folder in the package. In addition, the configure script will generate other files, they are:

* One or more makefiles (s) under each folder/subfolders)

* A script named config. status

* A text file config. log

* Another script named config. cache (optional)

* C header file (*. h) with special system definitions (optional)

After the configure script file runs successfully, you will enter make to compile the program and get the executable file you need. You may also use make check immediately after make to run the test. But this is only an optional step, because this requires the support of this package. If make is complete, you can use make install to install the program. Obviously, you need some relevant permissions to complete this step. After the program is installed, you can enter make clean in the source code folder to clear the generated executable files and target files. If you want to delete the file generated by configure, enter then typemake distclean. the last two steps are the same as make check (Optional). They are usually used by developers in the development and testing stages, it can also be used by general users to save hard disk space or keep the folder structure concise and clear. In addition, make distclean makes it possible to compile programs on different types of computers.

For more information about GNU Autoconf, see the online document [2. In addition to the basic introduction, you can learn more about GNU Build System by writing your own configure script, using M4 programming, and creating your own macros.

CheckInstall

As mentioned above, we use GNU Autoconf to compile the program using a series of commands as follows:

./configure && make && make install

Now it's time to change the method. You can use CheckInstall. it uses its own command checkinstall to replace make install. the other two commands are retained as before. Therefore, the command sequence is changed:

./configure && make && checkinstall

The command checkinstall not only runs make install by default, but also monitors all write operations during installation. Therefore, CheckInstall uses the program Installwatch [3] written by Pancrazio de Mauro. after make install is complete, CheckInstall generates an Slackware-, Debian-, or RPM-installation package, and then installs the program according to the default configuration of the software package, the generated installation package is left in the current directory (or the standard installation package storage directory. You can modify the PAK_DIR variable to save the directory. The installation package generated in this way is installed on other machines without re-Compiling-of course, the dependency between software packages must be considered.

[1] [2] [3] Next page

Related Article

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.