linux-Software Installation (i)

Source: Internet
Author: User
Tags gpg

Source Package
Script installation Package
Binary Package (Rpmpackage, system default package)
2, source package
The advantage of the source package is
1, open Source, if you have enough power, you can modify the source code
2, you are free to choose the functions you need
3, the software is compiled and installed, so it is more suitable for your own system, more stable and more efficient
4, easy to uninstall
the shortcomings of the source package
1, there are many steps in the installation process, especially when installing large software collections (such asLAMPenvironment), prone to spelling mistakes.
2, long compilation time, longer installation time than binary installation
3, because it is a compilation installation, the installation process when the novice error is difficult to solve

2. Binary Package

1) Classification

DPKG Package: It is a package management mechanism developed by Debian Linux, which can be managed by Debian Linux through the DPKG package . It is mainly used in Debian and unbuntu .

RPM Package: It is a package management system developed by RedHat company. Powerful, installation, upgrade, query and uninstall are very simple and convenient. Many Linux are currently using this package management method, including Fedora,CentOS,SuSE and so on. We are learning CentOS6.3, so we will learn the RPM package management system

2) features

RpmBenefits of the package
1, package management system is simple, with only a few commands can be implemented package installation, upgrade, query and uninstall
2, installation speed is much faster than the source package installation
RpmDisadvantages of the package:
1, compiled, no longer able to see the source code
2, function selection is not as flexible as the source package
3, Dependency
RpmPackage Management-rpmCommand Management
1,RpmPackage naming rules
http-2.2.15-15.e16.centos.1.i686.rpm
httpdPackage Name
2.2.15software version
15number of software releases
E16.centosSuitable forLinuxPlatform
i686the right hardware platform
RPM rpmPackage Extension
Package Full Name: Operation not installed package, package using package full name
Package Name: operation is already installed package, package use package name
2,RpmPackage Dependencies
Tree-dependent:A→B→C
Ring Dependent:A→B→C→A
Module Dependency: The module relies on the query Web site:
Www.rpmfing.net
package full Name and package name
Package Full Name: The package full name is used when the operating package is not installed. and pay attention to the path
Package Name:Use the package name when manipulating packages that have already been installed. is Search/var/lib/rpm/the database in
Rpminstallation

1. Package naming

httpd-2.2.15-15.e16.centos.1.i686.rpm
HTTPD Package Name

2.2.15 software version

number of software releases

E16 software Publisher. E16 is RedHat company release, suitable for rhel6.x(Red hatenterprise Linux) and centos6.x use

    i686   suitable hardware platform. rpm cpu performance, so the so-called i386 ( 386 above the computer can be installed), i586 ( 586 Span style= "font-family: ' The song Body '; More computers can be installed), i686 ii cpu are all Pentium ii above, So the software version of the majority), X86_64 ( 64 CPU can be installed) and Noarch (no hardware restrictions) etc. file name.

the extension of the rpm RPM package. We said that Linux files are not file types by extension, which means that the extensions in Linux do not have any meaning. But why is there another extension here? The reason is very simple, if I do not put the extension of rpm called "rpm", it is difficult for the administrator to know that this is a RPM package, of course, it will not be installed correctly. that is, if the RPM package does not use ". RPM" as the extension, the system can correctly identify the problem, it can be difficult for the administrator to identify what kind of software this is.

2. Installation

1) default installation location

/etc/ configuration file installation directory

/usr/bin/ executable Command installation directory

/usr/lib/ where the library of functions used by the program is saved

/usr/share/doc Basic Software User manual save location

/usr/share/man/ Help File save location

3. Installation command

RPM-IVH Package full name # Note must be the full name of the package. If the parking full name command takes care of the path, because the package is on the disc
Options:
-I (install) installation
-V (verbose) Show Details
-H (hash) Show Progress
--nodeps does not detect dependencies

--nodeps does not detect dependent installations. The software detects dependencies and determines whether the required underlying software is installed. If not installed the error will be. If I don't care about dependencies, a mandatory installation can be used to use this option. Note: Software that does not detect dependency installation is basically not available, so it is not recommended.

-replacefiles Replace file installation. If the package is installed, but some of the files in the package already exist, then the normal installation, the error "a file already exists" causing the software to fail to install, use this option can ignore this error, and overwrite the installation

--replacepkgs Replace package installation. If the package is already installed, this option can be used to repeat the package installation again.

--force Force installation. Reinstall whether it is installed or not. is the synthesis of-replacefiles and -replacepkgs .

--test test the installation. Will not be physically installed, just check for dependencies.

--prefix Specifies the installation path. Specify the installation path for the installation software instead of the default installation path. Note: If the installation path is specified and the software is not installed in the system default path, the system will not find these installed software and requires manual configuration to be recognized. So rpm We generally use the default installation path.

service startup

Service name start|stop|restart|status

Parameters:

Start Startup service

Stop stop service

Restart Restart Service status

RPM Package Upgrade
RPM-UVH Package Full name
Options:
-U(upgrade) upgrade installation, if not installed, the system is installed directly. If an older version is installed, upgrade to the latest version (upgrade)

RPM-FVH Package Full name

Options:

-F(uppercase) Upgrade installation if not installed. Older versions must be installed to upgrade (freshen)
Uninstall

RPM-E Package Name

--nodeps does not check for dependencies

Enquiry

Rpm-q Package Name # query is installed

Options:-QQuery (Query)
Syntax:#rpm-qa | grep httpd #Show All Installations
Rpm-qaPackage Name#query Whether packages are installed
#rpm-qa #Querying Package Details
#query for all installedRpmPackage
Options:-AAll (All)
Rpm-qa |grep httpdShow all installation packages
#rpm-qiPackage Name
Options:-I.Querying software information (Information)
-Qquery does not install package information (Package)
Rpm-qiPackage Namequerying the package for information
file installation location in query package
#rpm-QLPackage Name
Options:-LList (List)
-Pquery does not install package information (Package)
Rpm-qipPackage Full Namequery for information that does not have a package installed
-I. Information
Rpm-qlPackage NameQuery the installation location of files in a package
Rpm-qlpPackage Full Namequery for packages that are not installed, plan to install locations
-l List
Rpm-qfSystem file namequery which package the system files belong to

RPM-QF Package name query package since said package

ROM-QRP Package Full name query does not have a dependency on packages installed
RPM Command Management - checksum file extraction rpm Package Check

Validation

1) basic commands
Rpm-va

option: -va Check all packages that have been installed on this machine

RPM-VF System file name

option: -vf Check if a system file has been modified

#rpm -V installed package name
option:-v verifies the files in the specified RPM package (verify)

Verify that the contents of the8information is as follows:
Swhether the file size changes
MThe type of file or the permissions of the file (Rwx) is changed
5fileMD5whether the checksum changes (as if the contents of the file have changed)
Din the device. Whether the code changes
Lwhether the file path changes
Uwhether the properties of the file (owner) Change
Gwhether the genus Group of the file has changed
Twhether the modification time of the file changed
File Type
Cconfiguration file (Config file)
DGeneral Documents (Documentation)
G"Ghost" file (Ghost File), seldom seen, isHithe file should not be taken by thisRpmPackage contains
LAuthorization File (License file)
Rdescription File (Read Me)

Digital Certificates

the verification method can only be used for the installed RPM Package to verify the files, but if the RPM package itself is passive, then the checksum will not solve the problem. We will have to verify the digital certificate.

Digital certificates look like the following features:

First, you must find the original no public key file, and then install

Re-install RPM Package is to extract the certificate information from the RPM package, and then verify with the native certificate installed on the machine

If the validation passes, this allows the installation and does not allow installation and alerting if the validation does not pass

1) digital certificate location

So where is the digital certificate? in fact , Centos6.3 's first CD-ROM, of course, it will be placed in the system by default.

[Email protected] ~]# ll/mnt/cdrom/rpm-gpg-key-centos-6

-r--r--r--. 2 root root 1706 month 2013/mnt/cdrom/rpm-gpg-key-centos-6

# digital certificate location on disc

[Email protected] ~]# ll/etc/pki/rpm-gpg/rpm-gpg-key-centos-6

-rw-r--r--. 1 root root 1706 month 2013/etc/pki/rpm-gpg/rpm-gpg-key-centos-6

# Digital certificate location in the system

2) digital certificate Import

[Email protected] ~]# rpm--import/etc/pki/rpm-gpg/rpm-gpg-key-centos-6

option: --import Import digital certificate

How do we check the digital certificates installed in the system? The command is as follows:

[Email protected] ~]# Rpm-qa | Grepgpg-pubkey

Gpg-pubkey-c105b9de-4e0fd3a3


This article from "Wu Dick" blog, declined reprint!

linux-Software Installation (i)

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.