It must be compiled locally through GCC commands before use
In Linux systems, there are two most common ways to install software:
One is software source code, you need to compile it yourself. This software installation package is usually a gzip-compressed tar package (the suffix is ??.tar.gz).
The other is the executable program of the software, you just need to install it. This kind of software installation package is usually an RPM package (RedHat Linux Packet Manager, which is RedHat's software package manager), and the suffix is ??.rpm. Of course, there are also source codes packaged in RPM format and executable packages compressed with gzip. As long as you understand the following ideas, these two forms of installation packages are no problem.
Source code compilation and installation
The source code distribution of Linux software refers to the release form that provides the source code of all programs of the software. The user needs to compile it into executable binary code and execute it. Install. Its advantage is that the configuration is flexible, you can remove or retain certain functions/modules at will, and it is adaptable to a variety of hardware/operating system platforms and compilation environments; its disadvantage is that it is difficult and generally not suitable for beginners.
The source code packages of each software are generally available for download on the homepage of each software project, such as: etc.
1. Source code package in the form of *.src.rpm
Installation:
rpm -rebuild *.src.rpm
cd /usr/src/dist/ RPMS
rpm -ivh *.rpm
Uninstall:
rpm -e packgename
Instructions: rpm --rebuild *.src The .rpm command compiles the source code and generates a binary RPM package under /usr/src/dist/RPMS, and then installs the binary package. Packagename is as described previously.
2. Source code packages in the form of *.tar.gz/*.tgz/*.bz2
Software packages ending in tar.gz or tgz or tar.bz2 formats are generally released in source code form To install such software, you first need to decompress the software:
# tar zxvf filename.tar.gz
# tar xvfz filename.tgz
# tar xvf j filename.tar.bz2
After decompression, you can enter the decompressed directory:
# cd filename/
For this type of document, it is common The installation steps are: configuration, compilation and installation. The most troublesome one is configuration, because all configurations related to software installation are specified in this step: such as the software installation location, etc.
Configuration: ./configure
Compile: make
Installation: make install
Uninstall: make uninstall or delete manually
Note: It is recommended to read the instruction files (ReadMe and Install) after decompression to understand the installation requirements and change the compilation configuration if necessary. The source code of some software packages can be uninstalled using the make uninstall command after compilation and installation. If this function is not provided, the software must be uninstalled manually.
Since the software may install files scattered in multiple directories of the system, it is often difficult to delete them cleanly. Then you should configure it before compiling and specify the target path where the software will be installed: ./configure --prefix=directory name , so that you can use the "rm -rf software directory name" command to perform a clean and complete uninstall. Compared with other installation methods, it is the most difficult for users to compile and install by themselves. It is suitable for people who have some experience in using Linux and is generally not recommended for beginners.
Installation of RPM format software packages
RPM is a software package manager developed by RedHat. It can be used to easily install, upgrade, uninstall, and install RPM format software packages. Verification, query and other operations are easy to install, and files installed in multiple directories can be deleted when uninstalling. Therefore, it is recommended that beginners use RPM software packages as much as possible. Software packages often have specific command specifications, and their names are strings composed of "file name version number. rpm", such as apache-3.1.12-i386.rpm and apache-devel-3.1.12-i386.rpm. The package names are apache and apache-devel respectively. RPM packages for common Linux software that support RPM format can be found on the website rpmfind.net.
1. Installation
Command format:
rpm-i(or--install) options file1.rpm ... fileN.rpm
Parameters:
file1.rpm...fileN.rpm refers to the file name of the RPM package to be installed.
Detailed options:
-h (or-hash) outputs hash marks during installation; test only tests the installation and does not actually install it; --percent outputs it in the form of a percentage The progress of the installation; --excludeocs does not install documents in the package; --includedocs installs documents; --replacepkgs forces the reinstallation of already installed packages; --replacefiles replaces files belonging to other packages; --force ignores packages and documentation conflicts; --noscripts does not run pre-installation and post-installation scripts; -- prefix NEWPATH installs the software package to the path specified by NEWPATH; --ignorearch does not verify the structure of the software package; --ignoreos does not check the software The operating system the package runs on; --nodeps does not check dependencies; --ftpproxy HOST uses HOST as the FTP proxy; --ftpport PORT specifies the FTP port number as PORT.
Common options:
-v displays additional information; -vv displays debugging information; --root DIRECTORY allows RPM to use the path specified by DIRECTORY as the root directory, so that pre-installation programs and post-installation The installation program will be installed in this directory; --rcfile FILELIST sets the rpmrc file to FILELIST; --dbpath DIRECTORY sets the path of the RPM database to DIRECTORY.
2. Delete
Command format:
rpm -e(or--erase) options pkg1 ... pkgN
Parameters:
pkg1 ...pkgN: The package to be removed.
Detailed options:
--test only executes deleted tests; --noscripts does not run pre-installation and post-installation scripts; --nodeps does not check dependencies.
Common options:
-vv displays debugging information; --root DIRECTORY lets RPM use the path specified by DIRECTORY as the root directory, so that both pre-installation programs and post-installation programs will be installed here directory; --rcfile FILELIST sets the rpmrc document to FILELIST; --dbpath DIRECTORY sets the path where the RPM database is located to DIRECTORY.
3. Upgrade
Command format:
rpm -U(or--upgrade) options file1.rpm ... fileN.rpm
Parameters:
file1.rpm...fileN.rpm refers to the name of the software package.
Detailed options:
-h (or-hash) outputs hash marks during installation; --oldpackage allows an older version; --test only performs upgrade testing; --excludedocs does not install Files in the software package; --includedocs installation files; --replacepkgs forces the reinstallation of already installed software packages; --replacefiles replaces files belonging to other software packages; --force ignores conflicts between software packages and files; --percent Output the installation progress as a percentage; --noscripts does not run pre-installation and post-installation scripts; --prefix NEWPATH installs the software package to the path specified by NEWPATH; --ignorearch does not verify the structure of the software package; --ignoreos Does not check the operating system in which the software package is running; --nodeps does not check dependencies; --ftpproxy HOST uses HOST as the FTP proxy; --ftpport HOST specifies the FTP port number as HOST.
Common options:
-v displays additional information; -vv displays debugging information; --root DIRECTORY allows RPM to use the path specified by DIRECTORY as the root directory, so that pre-installation programs and post-installation The installation program will be installed in this directory; --rcfile FILELIST sets the rpmrc file to FILELIST; --dbpath DIRECTORY sets the path of the RPM database to DIRECTORY.
4. Query
Command format:
rpm -q(or--query) options
Parameters:
pkg1...pkgN: Query installed packages.
Detailed options:
-p PACKAGE_FILE queries the file of the software package; -f FILE queries which software package FILE belongs to; -a queries all installed software packages; --whatproVides CAPABILITY query Provides software packages with the CAPABILITY function; -g group queries the software packages belonging to the group group; --whatrequires CAPABILITY queries all software packages that require the CAPABILITY function.
Options:
-i displays summary information of the software package; -l displays the file list in the software package; -c displays the configuration file list; -d displays the file list; -s Display a list of documents in the software package and display the status of each file -; -scripts displays installation, uninstallation, and verification scripts; --queryformat (or --qf) displays query information in a user-specified manner; --dump displays each All verified information of the file; --proVides displays the functions provided by the software package; --requires(or-R) displays the functions required by the software package.
Common options:
-v displays additional information; -vv displays debugging information; --root DIRECTORY allows RPM to use the path specified by DIRECTORY as the root directory, so that pre-installation programs and post-installation The installation program will be installed in this directory; -rcfile FILELIST sets the rpmrc file to FILELIST; --dbpath DIRECTORY sets the path of the RPM database to DIRECTORY.
5. Verify installed software packages
Command format:
rpm -V (or--verify, or-y) options
Parameters:
pkg1...pkgN The name of the software package to be verified
Software package options:
-p PACKAGE_FILE verifies the software package to which PACKAGE_FILE belongs; -a verifies all software packages; -g group verifies all software packages belonging to the group group.
Detailed options:
--noscripts does not run the verification script; --nodeps does not verify dependencies; --nofiles does not verify document attributes.
Common options:
-v displays additional information; -vv displays debugging information; --root PATH allows RPM to use the path specified by PATH as the root directory, so that the preinstalled program and The post-installation program will be installed in this directory; --rcfile FILELIST sets the rpmrc file to FILELIST; --dbpath DIRECTORY sets the path where the RPM database is located to DIRECTORY.
6. Verify files in the software package
Syntax:
rpm -K(or--checksig) options file1.rpm...fileN.rpm
Parameters :
The file name of the file1.rpm...fileN.rpm software package; Checksig--detailed options; --nopgp does not verify the PGP signature.
Common options:
-v displays additional information; -vv displays debugging information; --rcfile FILELIST sets the rpmrc file to FILELIST.
7. Other RPM options
--rebuilddb rebuilds the RPM database; --initdb creates a new RPM database; --quiet reduces output as much as possible; --help displays the help file; --version displays the RPM of the current version.
If you don’t like to install or uninstall these software packages under the character interface, you can install a graphical interface software package management program based on X-Window, such as glint, xrpm and other graphical interfaces. Or use KDE's KPackage (click → and enter KPackage to start KPackage), etc., so that the installation, upgrade, uninstallation, verification and query of the software package can be easily completed by clicking the mouse, as shown in the figure.
It should be noted that the software in each RPM software package format is not necessarily independent. There are certain dependencies between each RPM software package. Deleting an RPM software package may cause other software to Cannot be used. Therefore, care should be taken when upgrading and deleting.