Linux Basics-Install and manage applications

Source: Internet
Author: User

(i) Application basics

The difference between a 1.Linux command and an application

Linux command: Execution files are small, placed in/bin and/sbin

Install the operating system together with a fixed format

Internal commands are integrated within the program by bash

Applications: Execution files are placed in directories such as/usr/bin,/usr/sbin, and/usr/local/bin,/usr/local/sbin, etc.

Separately installed outside the operating system, independent of the operating system

No fixed execution format, defined by the developer

Some applications provide executable files that can be run in the same format as Linux commands, also known as program commands

The composition of the 2.Linux application:

Ordinary executable program file, saved in/usr/bin, ordinary user can execute

Server programs, hypervisor files, saved in/usr/sbin, administrators can execute

Configuration file, saved in/etc

Log files, saved in/var/log

Reference documents, saved in/usr/share/doc/

Man Handbook, saved in/usr/share/man/

3. Package Type:

RPM Package: extension. RPM, can only be installed in the Linux operating system using the RPM mechanism, such as RHEL5, FEDORA9, SUSE10, etc. dependent, RPM command is required for installation

Deb package: the. deb extension can only be installed in Linux operating systems using the dpkg mechanism, such as Debian5.0, Ubuntu8.04, and so on. Using the DKPG command during installation

★ Source code Package: generally made into ". tar.gz" and ". tar.bz2", mostly packaged with the tar command, called "TarBall"

Software packages that provide setup: different extensions to tarball, which can be installed by simply running the installation files

Green Install-free package: Simply unzip or copy the downloaded files to a directory to use

(ii) use of RPM package management tools

1. Packages packaged using the RPM mechanism have a fixed naming format

"Software name-software version-number of releases." Hardware platform type, RPM "

2.rpm command

1. Query RPM Package Information

    • Querying the installed RPM package information

-Q to see if DHCP, wget is installed on the current system

[[email protected] ~]# rpm-q DHCP wget package DHCP was not installed wget-1.12-5.el6_6.1.x86_64

-QA shows the current system has installed all RPM package list, statistics number

[Email protected] conf]# Rpm-qa | Wc-l 743

-qi View details about the version of the wget package in the system

[Email protected] ~]# Rpm-qi wget

-QL View all directories, file locations for Wget package installation

[Email protected] ~]# RPM-QL wget/etc/wgetrc/usr/bin/wget/usr/share/doc/wget-1.12/usr/share/doc/wget-1.12/authors /usr/share/doc/wget-1.12/copying ...

-QC View the list of configuration files for the wget package installation

[Email protected] ~]# RPM-QC WGET/ETC/WGETRC

-QF See which package the VIM program files are installed in

[Email protected] ~]# Rpm-qf/usr/bin/vim filesystem-2.4.30-3.el6.x86_64

-QD viewing the documentation files for the wget package installation

[Email protected] ~]# RPM-QD wget/usr/share/doc/wget-1.12/authors/usr/share/doc/wget-1.12/copying/usr/share/doc/ Wget-1.12/mailing-list ...
    • Querying RPM package files is similar to querying installed packages

-qpi specifying the package details

-QPL View a list of all target directories and files that the package prepares to install

-QPC View the list of configuration files that the package prepares to install

-QPD View the list of document files that the package prepares to install

2. Install, upgrade, and uninstall RPM packages

-I install a new RPM package

-e Uninstalling the specified package

-U check and upgrade a package, if not installed, is equivalent to "-I"

-F checks for and updates an installation package, if it is not installed, discards

--force to force installation of an installation package

--nodeps Install upgrade uninstall, do not check dependencies, it is recommended to use during debugging

-H during installation upgrade, show progress with "#"

-V displays detailed information during installation

Uninstalling the Wget software for the current system

[Email protected] ~]# rpm-e wget

Installing wget Software

[Email protected] server]# RPM-IVH wget-1.10.2-7.e15.i386.rpm

To view and verify dependencies when uninstalling Vim-minimal packages

[Email protected] ~]# rpm-e vim-minimal error:failed dependencies:vim-minimal are needed by (installed) cvs-1.11.23 -16.el6.x86_64 Vim-minimal is needed by (installed) sudo-1.8.6p3-19.el6.x86_64 [[email protected] ~]# rpm-e Vim-minim Al-nodeps

3. Maintain the database: when the RPM database is damaged, the loading and unloading package is not normal.

--rebuilddb and--initdb Rebuilding the database

[Email protected] ~]# rpm--REBUILDDB

★ (c) Compile the installer from source code

Basic process: Unpack, configure, compile, install, start software

Example: Installing an nginx on a Linux system

    1. Unzip the source package Nginx-1.10.3.tar

[Email protected] ~]# TAR-ZVXF nginx-1.10.3.tar.gz

2. Enter the source code directory, configure the parameters, specify the installation directory

[[Email protected] ~]# CD Ngnix-1.10.3[[email protected] nginx-1.10.3]#[[email protected] nginx-1.10.3]#./configure-- Prefix=/usr/local/nginx

Configuration process takes a certain amount of time, error to find the reason online

3. Compiling and installing

[[email protected] nginx-1.10.3]# make && make install

4. Start Nginx

[Email protected] sbin]#/usr/local/nginx/sbin/nginx-c/usr/local/nginx/conf/nginx.conf

Test port

[Email protected] sbin]# NETSTAT-NTPL | grep 80

Linux Basics-Install and manage applications

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.