0530 Tenth session

Source: Internet
Author: User

I. Package management content


RPM Package Management


Yum


Compiling the installation


Note: The installation software must be an administrator to

Commands for installation


Ldconfig-p: View Native Library

-V: Generate cache

Configuration files used for installation


/etc/ld.so.conf


Cache files


/etc/cache


Two. RPM Package Management


rpm-i [Install-options] Package_file



RPM Database-----/var/lib/rpm


RPM--INITDB: Initialization, database implementation does not exist will create


RPM--rebuild: Re-create a database, regardless of whether the database exists or not



Install-options


--test: Not real install, just test

--nodeps: Ignore dependent direct installation

--replacepkgs|replacefiles: Reinstall, overwrite installation | Overwrite same file reinstall

--nosinature: Does not check the legitimacy of the source (checked by default)

--nodigest: Package integrity is not checked

NORPM Database-----Scripts: Do not execute script program

%pre: Pre-installation script-nopre: Do not execute

%post: Post-installation script-nopost: Do not execute

%preun: Pre-uninstall Script-nopreun: Do not execute

%postun: Post-Uninstall script-nopostun: Do not execute



Note: When reinstalling, only the binaries or directories are updated, but all the configuration files are not replaced.

The user settings you write are all preserved

If you want to reinstall the configuration file, you need to delete or move the configuration file, after making sure that there are no configuration files in the directory,

In the installation, that would be deemed not to match

Install a new configuration file





1.RPM Packet Query


rpm-q* pkgs


-Q: Check if the pkgs is installed

-QL: Check the information in the package, the list of files in the warranty

-QA: Production See all installed RPM packages

-QF: followed by/path/to/file to see which rpm package the file belongs to

-QPL: View a list of files for packages that are not installed (files that are generated when they are loaded)


--whatprovides Ability: Query which package provides this capability

--whatrequires Ability: The ability to be viewed depends on which package


Rpm2cpio Bag | Cpio-tv: Preview in-Package files

Rpm2cpio Package (full path) | Cpio-idv./program + path (e.g./usr/bin/tree)

(wildcard characters, such as-idv "*.conf") are supported to release the in-Package files


-QC: Configuration file

-QD: Help Documentation

--scripts: View your own scripts

-qi: Information, version author installation time, etc.

-QR: Query the capability that the specified package depends on

--provides: View the capability of the package provided by the query


2.RPM Package Inspection


RPM-V pkgs:rpm Package Inspection

-va: All packages are inspected

-K pkgs: Detection package source

S.M.5.D.L.V.G.T.P: Originally a----------, which one of the problems showed

such as---------D------


Note: You must import the secret key before you can verify


RPM--import/path/to/file: Import secret key

/etc/pki/rpm-gpg/rpm~


Delete secret key: Gpg-pubkey deleted (with RPM-E)


3. Installation

RPM-IVH pkgs

-V: Display procedure

-H: Make a progress bar with the # sign


4. Upgrade

Rpm-u pkgs

Upgrade Installation: Legacy program, upgrade

No legacy programs, installation


Rpm-f pkgs

Upgrade: Legacy program, upgrade

No legacy programs, stop



--oldpackage: Downgrade Installation

--force: Forced installation



Note: Do not upgrade the kernel, Linux is to support multi-core coexistence, want the new kernel please directly start a new installation on the line


5. Uninstall

RPM-E install-options pkgs

--nodeps: Ignore dependencies, Force unload

--noscripts: Do not run scripts to uninstall directly




Three. Yum


Yum's file server has three types of


Note: There must be repodata where you can be a repository for Yum, and conversely, there are repodata places.

You can use it as a repository for Yum.

/HTTP

ftp://

file:///(file after/have three root is because file represents the path of local files, need to add root directory/, simply write together)


Configuration file for Yun

/ETC/YUM.CONF: Providing configuration files for all libraries

/etc/yum.repos.d/*repo: Provides configuration for the point of the warehouse. The content below, install the following content OH configuration on the line


Yum's logs


/usr/log/yum.log


[Name Warehouse name]


BaseURL: The path of the warehouse, must have, http,ftp,file


ENABLED={1|0}: An optional item that says the warehouse is not enabled, the default is 1 enabled


GPGCHECK={1|0}: An optional item is not a packet inspection, the default is 1 check, but must have a secret key


Gpgkey: Imported Secret key


Enablegroup: Support package group is not supported, optional, default is support


Failovermethod={roundrobin|priority}: Optional, default is Roundrobin, meaning random selection


COST=1000,1000 is the default value, the higher the value, the lower the priority



With the above visible, a warehouse configuration at least as long as there are three rows on the line, a name line, a baseurl line, a gpgcheck line


Yum command format



Yum Options command PKGS1 PKGS2



Command part of 1.yum


Warehouse Enable disable


Yum-config-manager--enable "warehouse name"----Enable Warehouse

--disable "Warehouse name"----Disable Warehouse


Show Warehouse List


Yum Repolist [all|enabled|disabled]

All: List of all warehouses

Enabled: Enable Warehouse list

Disable: List of disabled warehouses


Show Packages


Yum list [all|available|installed|updates]

All: The entire package

Available: Available Packages

Installed: Installed packages

Updates: Upgradeable Packages


Install Reinstall


Yum installs PKGS1 PKGS2 (can be installed up to 5, 5 programs, but different terminals even

In a child shell, there can only be one Yum running at a time)


Yum Reinstall ~


Upgrade downgrade


Yum Update pkgs Upgrade program

Downgrade pkgs downgrade program


Check for upgrades


Yum Check-update


Unloading


Yum Remove pkgs1 pkgs2 ...


View package Information


Yum Info pkgs


View the developed features


Yum Provides|whatprovides feature1 Feature2


Clean up local cache


Yum Clean [Pkgs|metadata|expire_cache|rpmdb|plugins|all]


Building the cache


Yum Makecache


Search


Yum Search keyword


View the capability on which the package was developed


Yum deplist pkgs1 .....


View Yum Transaction History


Yum history: Handling of loading or upgrading with Yum


Yum History Info #: Details of the historical section #


Yum Historical Undo #: # # History do the opposite (such as the # number is installed, then uninstall here, #号是卸载, install here)



Installing and upgrading Local Packages


Yum Localinstall pkgs1 pkgs2 .....


Yum localupdate pkgs1 pkgs2 ....


Related commands for package groups


Yum grouplist Grp1 ...

Groupinstall

Groupupdate

Groupremmove


GroupInfo



Use CD as a repository for Yum


Basically no difference, just to mount the CD in advance, note that the command Mount disc will be restarted

Fail, do not want to be mounted each time can be written in the configuration file



The options section of 2.yum


Yum-y: Automatic answer Yes option for each question

--nogpgcheck: Do not check this


-Q: Silent mode


--disable= Warehouse Name: Temporarily (for this operation) disable this warehouse


--enable= Warehouse Name: Temporarily enable this warehouse


--noplugins: Disable all plugins


3.yum of the Available variables section


$releasever: Version number of the current OS

$arch: Platform number, i386.i486.i586.x86_64, etc.

$basearch: Base platform, only i386 and x86_64

$YUM 0-$YUM 9: Custom variables



4. Create a Yum repository


This is to build the warehouse that has the Repodata folder, not the warehouse configuration file, his path is

Is the path that is filled in the baseurl behind the configuration file


Createrepo dir






Four. Steps to compile and install


Many times, what we get is not a good RPM package, but some source code, this time

We need to compile and install ourselves.

Specific steps I divided three parts, the first part is the installation process, divided into three small steps; the second part is the inspection, inspection

The third part is the rehabilitation section, four small steps


Part I: Installation process


First step: Execute the Configure script in the resulting compressed package


Step Two: Make (enter the make command directly under the extracted directory, note that it must be in this directory)



Step three: Make install (also in the extracted directory)


Part II: Check


Just run it and see if it works.


Part III: Rehabilitation part


The first step: write the path of the binary program to the configuration file, or write a script to run


/etc/profile.d/name.sh content is the path where the program is added in the environment variable path


Step Two: Import the library file to


Create a/etc/ld.so.conf.d/name.conf directory

Copy the library files in the Lib directory under the directory of the program.


Step three: Import the header file


A. Soft connection mode

Create a new directory under/usr/include, and then use the header file directory of your program for the new directory

Set as a soft connection


B. Copy directly to/etc/include


Fourth step: Set up man help


Edit the/etc/man.config (CENTOS6) |mandb.conf (CENTOS7) file and add it inside

A manpath can



The above is all the steps to compile the installation, and then add the help after the installation of a compilation is completed













This article from "Blog Work First Edition" blog, declined reprint!

0530 Tenth session

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.