Installation of software in linux

Source: Internet
Author: User
The source code is a text file that needs to be compiled by the compiler and converted into an executable file. during the compilation process, the source code is large and sometimes needs to be divided into several parts for compilation into the target file, then, compile each part into an executable file. the gcc compiler is Linux standard... information &

The source code is a text file that needs to be compiled by the compiler and converted into an executable file. during the compilation process, the source code is large and sometimes needs to be divided into several parts for compilation into the target file, then, compile each part into an executable file. the gcc compiler is a Linux standard compiler.
Compilation procedure: 1.gcc-c hello. c automatically generates a hello. o file, but does not generate a binary execution file.
2. the gcc-o hello. c parameter is followed by the name of the generated binary execution file.
Add a function to compile. 3. gcc sin. c-lm-L/lib-I/usr/include-lm indicates libm. so or libm..
-L the following path is the search directory of the function library, and-I is followed by the directory containing files in the source code.
There are two types of function libraries: Dynamic function libraries and static function libraries. the suffix of the dynamic function library is the. so file, and. a indicates the static function library. When using the dynamic function library for compilation, you cannot compile all the functions, but just give a pointer. if the function library is upgraded, you do not need to re-compile and generate executable files, the static function library needs to be re-compiled.
The function libraries in Linux are stored in the/lib and/usr/lib folders by default. Therefore, if they are not included in the libraries during compilation, they are connected to the two folders by default.
 
Steps for installing Tarball:
1. decompress the tarball file in the/usr/local/src directory; tar-zxvf specific tarball
2. view the installation documentation
3. run the. configure command to check the system environment and create a makefile file.
4. compile Make into an executable binary file and Make install the installer.
 
Use patch to update source code. First, use the new diff-Naur old File> oncomparion to compare the new and old files and generate a new and old comparison file to be patched. Then execute patch-p 0 in the old file directory. To increase the access speed of the database, you can call the database file into the memory. First, write the library directory to the Directory of the dynamic link library in/etc/ld. so. conf, and use the ldconfig command to call the dynamic library. The Ldd command can be used to view the function libraries used by the execution files.
We recommend that you place the installed suite on/usr/local and the source code on/usr/local/src. by default, man Searches for the help files in/usr/local/man. /Etc/man. the config file records the search path of man page. when the installed package is in a separate folder, the man page cannot be queried because it is not in a specific directory, therefore, you need to record the path in man. config.
Since RPM has a database to record kit-related information, all files of RPM-type kits are stored in the default directory of the system. RPM installs directly compiled executable files, so the system environment should be the same. The biggest problem with RPM is that it cannot automatically meet the dependency attribute requirements of the suite, the yum, apt, and urpmi services can be used to solve attribute-related problems. The RPM database is stored in the/var/lib/rpm file directory.
RPM:-ivh specific rpm Package. you can view the specific installation package process.
-Upgrade the Uvh RPM package.
-View the dependencies of the suite by using the qR code.
RPM uninstallation is top-down. The rpm-e package name is used to unmount the package.
The Man query result is outside the program, and the help query result is in the program. this is a parameter embedded in the program.
Put RPM files in the default folder (as shown below)

 

Directory

Description

/Etc

Some configuration files

/Usr/bin

Some executable files

/Usr/lib

Dynamic function libraries used by some programs

/Usr/share/doc

Basic software user manual and help document

/Usr/share/man

Some man page files

SRPM

Source RPM the difference between this type of file and RPM is that the installation package carries the Source code, while RPM is an executable binary file. Therefore, SRPM needs to be re-compiled into a binary file. The difference between SRPM and tarball is that SRPM contains dependency, but tarball does not.

SRPM Directory

 

Directory

Description

/Usr/src/redhat/spec

Stores the configuration file that compiles SRPM into RPM.

/Usr/src/redhat/build

Store things during compilation

/Usr/src/redhat/source

Store original files

/Usr/src/redhat/RPMS

Store compiled RPMS packages

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.