Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use CheckInstall in Linux to create a RPM or DEB package from source code

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces how to use CheckInstall in Linux to create a RPM or DEB package from the source code, the content is very detailed, interested friends can refer to, hope to be helpful to you.

If you have installed the linux program by running "make install" from its source code. It will be really troublesome to remove it completely unless the developer of the program provides the goal setting of uninstall in Makefile. Otherwise, you must compare the complete list of files on your system before and after installation, and then manually remove all files added during installation.

At this time, Checkinstall can be sent to use. Checkinstall tracks the path of all files created or modified by the install command line (e.g. "make install", "make install_modules", etc.) and creates a standard binary package that allows you to install or uninstall it using your distribution's standard package management system (such as Red Hat's yum or Debian's apt-get command). It is known to work well on Slackware, SuSe, Mandrake, and Gentoo, so please refer to its official documentation.

In this article, we focus only on Red Hat and Debian-based distributions and show how to create a RPM and DEB package using Checkinstall from source code

Install Checkinstall on linux

Install Checkinstall on Debian and its derivative distributions:

# aptitude install checkinstall

To install Checkinstall on the Red Hat distribution, you need to download a packaged Checkinstall rpm package (for example, found in http://rpm.pbone.net/), but it has been removed from the Repoforge library. This package is for Cent OS6, but it can also work in Cent OS7.

# wget ftp://ftp.pbone.net/mirror/ftp5.gwdg.de/pub/opensuse/repositories/home:/ikoinoba/CentOS_CentOS-6/x86_64/checkinstall-1.6.2-3.el6.1.x86_64.rpm# yum install checkinstall-1.6.2-3.el6.1.x86_64.rpm

Once checkinstall is installed, you can create a specific software package in the following format

# checkinstall

If there are no parameters, the default installation command "make install" will be used

Create a RPM or DEB package with Checkinstall

In this example, we will create a htop package, which is an linux interactive text mode process viewer (similar to top).

First, let's download the source code from the project's official website. As a good habit, we store the source code package under / usr/local/src and extract it.

# cd / usr/local/src# wget http://hisham.hm/htop/releases/1.0.3/htop-1.0.3.tar.gz# tar xzf htop-1.0.3.tar.gz# cd htop-1.0.3

Let's see what the htop installation command is so that we can invoke it with the Checkinstall command, as shown below, htop is installed with the "make install" command.

#. / configure# make install

Therefore, to create a htop installation package, we can call checkinstall without any parameters, which will create a package using the "make install" command. In the process, the checkinstall command will ask you a few questions.

In short, the following command creates a htop package:

#. / configure# checkinstall

"Should I create a default set of package docs? (will I create a package file with default settings?)", answer "Y":

You can enter a short description of the package and press enter twice:

Enter a number to modify any of the following values or ENTER to continue:

Then checkinstall will automatically create a .rpm or .deb package, depending on what your linux system is:

In CentOS7:

In Debian 7:

On how to use CheckInstall in Linux to create a RPM or DEB package from the source code to share here, I hope the above content can be of some help to you, you can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report