Install and manage software in Linux

Source: Internet
Author: User

Install and manage software in Linux
1 Introduction to four software installation methods in Linux

For software installation in Windows, you only need to double-click the installation program or decompress the software to the specified directory (green version) using a tool such as winrar.
In Linux, there are four methods for installing software: source code installation, RPM installation, yum installation, and binary software installation, you can select an appropriate software installation method based on different network environments.

2. Source Code Installation

Because the Linux operating system is open-source, most of the software installed on the system is open-source software, such as JDK, Tomcat, Memcached, Redis, MongoDB .... They all provide source code download and installation methods. The advantage of source code installation is that you can customize the software functions and select the installation path for convenient management. To uninstall the software, you only need to delete the corresponding installation directory, without the so-called registry in Windows.
The source code installation software usually requires downloading and decompressing the source code, analyzing and installing the platform environment (configure), and compiling and installing the software (make, make install. The steps below are described in detail!

Download and decompress the source code: the source code of the software in Linux is generally written in C/C ++, and the source code package is available for download on the software official website, the source code package is usually in the format of * .tar.gz(take the latest nginxas example, nginx-1.9.12.tar.gz). If your Linux system cannot be connected to the Internet, you need to upload the package to Linux Through SecureCRT and unzip the package, you can download the source code package to the Linux system by running the wget command.

Analysis Platform Installation environment: when installing software in a Linux system, it is affected by the environment of the operating system. For example, when installing or running some software, you must call the library file of the operating system, if the library file does not exist, the software will fail to run. The configure file is used for environment testing of software installation. If you are prompted that some installation packages are missing, you need to install them until the test passes. In addition, when performing configure analysis software requirements, you can also add software installation paths and required modules after./configure to customize software features.

Compile and install software: in Linux, make is a frequently used compilation command, the makefile file is used to describe the dependencies between various source programs, so that the make tool can automatically complete compilation. After compilation, the corresponding executable files are generated in the current directory and sub-directories, and the final software installation phase begins. On the command line, enter the make install command to start software installation, the installation process first creates a directory. If no installation directory is specified, the installation program will create an installation directory under the/usr/local directory by default, then copy the corresponding files and executable programs from the source code directory to the installation directory, and the installation is complete! Click "Install MySQ L5.6" in the source code !!!

3 RPM Installation Method

RPM is the abbreviation of Red Hat Package Manage. It is intended to be the Red Hat Package Manager, similar to the "Add/uninstall" file in Windows, in addition, the RPM file contains other files that run executable files.

The RPM package management method has the following advantages: the installation is simple and convenient. Because the software has been compiled and packaged, the installation process is only a process of verifying the environment and solving pressure, in addition, the RPM tool records the software installation information for the software installed in RPM mode to facilitate future software queries, upgrades, and uninstallation.
The disadvantage of RPM package management is that it depends heavily on the operating system environment. It requires that the installation environment of the RPM package be consistent with that of the RPM package. It also needs to satisfy the dependency between the software package and the system during installation. You can refer to CentOS6.7 RPM to install JDK 8

Common commands used by rpm tools

[[Email protected] jdk] # rpm-ivh jdk-8u73-linux-x64.rpm # Install the specified rpm installation package (here JDK8 is installed ), the RPM installation package needs to be downloaded in advance and uploaded to the server [[[email protected] jdk] # rpm-qf/bin/bash # query which rpm Software Package bash-4.1.2-33.el6.x86_64 a file in the operating system belongs [[email protected] jdk] # rpm-qp jdk-8u73-linux-x64.rpm # query ". the package name jdk1.8.0 _ 73-1.8.0_73-fcs.x86_64 [[email protected] jdk] # rpm-e jdk1.8.0 _ plugin # Delete the specified package

There is a headache when talking about rpm software installation. It is not demonstrated, when RPM is installed, if other system components of the software are not installed, the RPM installation will fail, and the advantages of yum will be shown.

4 yum Installation Method

Yum is a common tool for installing and upgrading software in Linux systems. It can be used with the Internet to conveniently install and automatically upgrade the software, for example, if you enter yum update to automatically upgrade the system, and install or update the software using yum, the RPM software package on the specified remote Internet host is actually downloaded using the yum command, then perform automatic upgrade and installation, and resolve the dependencies between various software.

[[Email protected] jdk] # rpm-qa | grep yum # Check whether yum has been installed on the current system. If no prompt is displayed, the yum-metadata-parser-1.1.2-16.el6.x86_64yum-plugin-fastestmirror-1.1.30-30.el6.noarchyum-utils-1.1.30-30.el6.noarchyum-3.2.29-69.el6.centos.noarchyum-plugin-security-1.1.30-30.el6.noarch is not installed.

Basic usage of yum

[[Email protected] jdk] # yum install-y rpm name # install the rpm package [[email protected] jdk] # yum check-update # check the updatable rpm package [[email protected] jdk] # yum remove-y rpm name # uninstall the rpm package [[email protected] jdk] # yum update # update all rpm packages [[email protected] jdk] # yum info # view all rpm package information that can be installed or updated in the resource library
5. Install binary software

In Linux, the software in binary format indicates that the software has been compiled on various platforms, and then compressed and packaged. During installation, you only need to extract or execute the installation executable file. The two-step software package includes the following package Types: rpm, targ.gz, and bz2. For software packages in this format, installation is actually the process of decompression. You can use the corresponding decompression command to decompress the packages in different formats.

Take apache's apache-tomcat-8.0.32.tar.gz as an example.

[[Email protected] guanglei] # cd soft/[[email protected] soft] # rz plugin upload to the soft directory [[email protected] jdk] # cp/home/guanglei/soft /apache-tomcat-8.0.32.tar.gz/usr/local/jdk/# copy the file [[[email protected] jdk] # chmod u + x apache-tomcat-8.0.32.tar.gz # Add executable permissions [[email protected] jdk] # tar- zxvf apache-tomcat-8.0.32.tar.gz # unzip the file [[email protected] bin] # sh/usr/local/jdk/apache-tomcat-8.0.32/bin/startup. sh # Call the script to start Tomcat [[email protected] bin] # ps-ef | grep java # view process information root 22302 1 89 00:00:04 pts/0/usr/java/jdk1.8.0 _ 73/bin/java-Djava. util. logging. config. file =/usr/local/jdk/apache-tomcat-8.0.32/conf/logging. properties-Djava. util. logging. manager = org. apache. juli. classLoaderLogManager-Djava. endorsed. dirs =/usr/local/jdk/apache-tomcat-8.0.32/endorsed-classpath/usr/local/jdk/apache-tomcat-8.0.32/bin/bootstrap. jar:/usr/local/jdk/apache-tomcat-8.0.32/bin/tomcat-juli.jar-Dcatalina. base =/usr/local/jdk/apache-tomcat-8.0.32-Dcatalina. home =/usr/local/jdk/apache-tomcat-8.0.32-Djava. io. tmpdir =/usr/local/jdk/apache-tomcat-8.0.32/temp org. apache. catalina. startup. bootstrap startroot 22331 2914 0 00:00:00 pts/0 grep java [[email protected] bin] # kill-9 22302 # Shut down the Tomcat Process

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.