In Linux system operation, for some reasons, you want to create the installed package directly from the source code. The following small series will introduce you how to use the source code under Linux system. Create an RPM or DEB package so that you can uninstall the program more easily in the future. Let's take a look.
If you have already run the linux program from its source code “make install”. It would be really cumbersome to remove it completely, unless the developer of the program provided the target setting for uninstall in the Makefile. Otherwise you must compare the complete list of files in your system before and after installation, and then manually remove all files added during the installation process.
At this time, Checkinstall can be used. Checkinstall will track the path to all files created or modified by the install command line (for example: “make install”,“make install_modules” etc.) and create a standard binary package that allows you to manage with your distribution's standard package. The system installs or uninstalls it (for example, Red Hat's yum or Debian's apt-get command). It is also known to work well on Slackware, SuSe, Mandrake and Gentoo, please refer to its official documentation.
In this article, we focus only on Red Hat and Debian-based distributions and show how to create an RPM and DEB package from Source using Checkinstall
Installing Checkinstall on Linux
Installing Checkinstall on Debian and its derivatives:
# aptitude install checkinstall
To install Checkinstall on Red Hat's distribution, you need to download a packaged one. The Checkinstall rpm package (for example: found at http://rpm.pbone.net/), but it has been removed from the Repoforge library. This package is for Cent OS6, but it works in Cent OS7 as well.
# 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 it in the following format: A specific package
# checkinstall "install-command"
If there are no parameters, the default installation command “make install” will be used
Create an RPM with Checkinstall Or DEB package
In this example, we will create a htop package, which is a linux interactive text mode process viewer (like top).
First, let's download the source code from the project's official website. As a good habit, we store the source package under /usr/local/src and unzip 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 call it with the Checkinstall command, as shown below, htop is installed with the “make install” command .
# . /configure# make install
So, to create a htop installation package, we can call checkinstall without any parameters, which will create a package using the “make install” command. In this 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? (I will create a default setting package file?) & Rdquo ;, answer & ldquo; Y & rdquo ;:
You can enter a short description of a package, then press Enter twice:
enter a numeric value or to modify any of the following eNTER continued:
checkinstall will then automatically create a .rpm or .deb package, according to what your linux system is:
in CentOS7:
in Debian 7:
the above can be used to create checkinstall RPM or DEB source packet from the method described under the Linux system, the The method is only available for Red Hat and Debian-based distributions, and other versions can be used as a reference.
In Linux system, sometimes we need to check or view the list of installed internal medicine, but man
VLC is a versatile media player that supports multiple video formats. The biggest a
CentOS is one of the Linux distributions, has released multiple versions, then you know which versio
Our disk space often takes a long time to become full, or only a small amount affects the speed of t
The basic process of setting serial port properties in Linux system
How to install virtualization tools in Linux llibvirt
How to find the reset user name and password in the Uuntu system
Linux changes the capacity of VirtualBox disk
How CentOS 6 modifies disk quota limits
After the Linux boot, the terminal prompts -bash-2.05b$ What should I do?
Using Linux routing and forwarding function to share the Internet
How to quickly delete duplicate data rows in Linux files
Linux cal/ncal command operation example
How to use uniq command to delete text duplicate lines in Linux system
360 Security Guardian Basics Tutorial
How to manually block malicious websites? Ingeniously modify the hosts file
Win7 system computer disk does not show the current capacity how it happened
What should I do with the Win10 10074 preview keyboard input delay?
How to control their volume individually for each application
IP restrictions for directories in nginx
Win8.1 system how to delete the small icon with its own input method