Linux Software Management

Source: Internet
Author: User
Tags gpg

The core features of the Package Manager:

Packaged into a file: binaries, library files, configuration files, Help files.

Build database: Tracks each file that is installed.


Core features of package management:

1. Make the package.

2. Install, uninstall, upgrade, query, check.


Dependency Relationship:

A package installation requires support for other installed packages.


Rpm:

RPM Package Naming:

Main package:

Name-version-release. arch.rpm

Child Package:

Name-major. MINOR. release-release-arch.rpm


Major improvements to the main version number (MAJOR).

This version number (MINOR): A significant change in a child function

Release number: Fixed some bugs and tweaked a bit of functionality.


#rpm [OPTION] Package

Database stored in/var/lib/rpm

[OPTION]

-a displays all installed packages.

-I installation.

-e Uninstall.

-V verifies the installed package.

The result of the check is 8 characters.

. Through validation, no problem.

? Unable to execute.

S file size changes.

M mode changes, such as file type, permissions, and so on.

5 MD5 value changed.

D the device does not match the primary and secondary version number.

L Readlink does not match.

U Master Change

G genus Changes.

T Modify the change in time.


-K authentication Package.

DSA, GPG Verify the source legitimacy, that is, verify the signature.

SHA1, MD5 verify package integrity.

--nosignature only validates the source legitimacy.

--nodigest only validates integrity.

--import key to import the secret key file.

/etc/pli/rpm-gpg/


--REBUILDDB rebuild the database. Re-created regardless of whether the database exists.

The database is under/var/lib/rpm/.

--INITDB initializes the database. There is no building, there is no establishment.


-H--hash Prints 50 # numbers showing the progress of the installation, each of which represents 2% progress.

-V shows the detailed procedure.

-VV shows a more detailed procedure.

--nodeps ignores dependencies.

--replacepkgs Reinstall, replace the original installation.

--replacefiles Replace the file.

--oldpackages downgrade installation.

--force forcibly installed, to achieve re-install or downgrade. Equivalent to--replacepkgs +--replacefiles +--oldpackages.


-Q Queries whether the package is installed.

-QA displays all installed packages.

-qi Query the package for information.

-QL queries the list of files generated after the package is installed.

The-qf file query is created by the RPM package installation.

-QC the configuration file generated by the query package.

-QD the Help file generated by the query package.

-Q--scripts The script contained in the query package. Contains 4 types of scripts: pre-and post-installation, and before and after uninstallation.

-QPI queries for information about packages that are not installed.

-QPL queries the list of files generated by the packages that are not installed.



-UVH upgrade package. If there is an older version, then upgrade, if not, install the new version.

-FVH upgrade package. If there is an older version, then the upgrade, if not, exits.


For example:

#rpm-IVH httpd-xxxxx.rpm

#rpm-IVH--force httpd-xxxxx.rpm

#rpm-Q httpd-xxxx.rpm

#rpm-qa | grep "httpd*"

#rpm-qi httpd-xxxxx.rpm

#rpm-QL httpd-xxxx.rpm | More

#rpm-qf/etc/yum.conf

#rpm-UVH httpd-xxxx.rpm

#rpm-UVH--oldpackages httpd-old-xxxxx.rpm

#rpm-E--nodeps httpd-xxxx.rpm




Yum

Meta-data files in the Yum repository:

Primary.xml.gz

List of all RPM packages.

The dependency relationship.

A list of files generated per RMP installation.

Filelists.xml.gz

List of all the files for all RPM packages in the current warehouse.

Other.xml.gz

Additional information, RPM package modification log.

Repomd.xml

Contains the timestamp and checksum of the filelists.xml.gz other.xml.gz primary.xml.gz.

Comps*.xml

The grouping information for RPM packages.


Yum configuration file:

/etc/yum.conf


To create a yum repository:

1. Copy all RPM packages to the directory.

2. Use the Createrepo command to generate the warehouse.

3. If you need to set up a package group, you need to locate the Comps*.xml file within the source folder. Use the-G option to Comps*.xml Repo_dir.


#createrepo [OPTION] Repo_dir

-G FILE to create the group. Need to Comps*.xml file.





Define the repo file for Yum:

/etc/yum.repos.d/repo files are placed under this folder.

The format is as follows:


The name of the [Repo_name] REPO source.


Name=description describes the information.


Baseurl=repo_dir the location of the Yum Repository, which supports FTP, HTTP, file three ways.

ftp://

/HTTP

file:///


Enabled=0|1 whether this repo source is enabled, 0 means disabled, and 1 means enabled.


Gpgcheck=0|1 whether to use GPG authentication, 0 for disable, 1 for Enable, enable path to specify Gpgkey


Gpgkey=key_dir

ftp://

/HTTP

file:///



#yum [OPTION] COMMAND package ...

[Opiton]

-Y auto Answer yes.

--nogpgcheck disables GPG authentication.



COMMAND

List lists

All. Default.

Available all available. There are but not installed in the warehouse.

The Installde is already installed.

Updates available for upgrades.



Clean cleans up the cache.

Packages RPM Package.

Headers header information.

Meatdate metadata file.

Dbcache RPM Library Cache.

All.


Repolist lists repo source lists and brief information.

All repo source.

Enabled repo source. Default.

Disabled a disabled repo source.



Install.


Update upgrade.


Update_to upgrade to the specified version.


Remove|erase Uninstall.

If the package has a dependency relationship, all packages that have dependencies are unloaded.


Info displays information about the package. than Rpm-qi to be brief.


Provides|whatprovides to see which package installation The file or feature was generated from, equivalent to RPM-QF.


GroupInfo Gourpk_name Displays information about the specified package group.


Grouplist lists all the package groups.


Groupinstall Install the package group.


Groupremove removing package groups.


Groupupdate Upgrade package groups.


Reinstall re-install.


Downgrade downgrade package.


Localinstall Install the local package.



Make Project management tool

Makefile file

Defines the order in which the Make command (call gcc,g++, etc.) compiles the source program in these source program files.


Automake--Makefile.in-->makefile

Autoconf-Configure


3 steps to compile the installation:

Prerequisite: Development Environment required (compilation environment)

#yum Groupinstall "Development Tools" "Development libaries" ...


All operations are in the source package decompression files directory operation.


1.#./configure

Function:

1. Let the user select the compilation feature.

2. Check the compilation environment.


--help gets the script to use the format.

--PREFIX=INSDIR Specifies the software installation location.

--SYSCONFIGDIR=CONFDIR specifies the path to the configuration file.


2. #make


3. #make Install



Execute the program after compiling:

1. Modify the PATH environment variable in the/etc/profile. This enables you to identify the binary file path for this program. Log off and re-login to take effect.

#vim/etc/profile

Path= $PATH:D ir


or create a. sh file under the/etc/profile.d/directory. Define export path= $PAHT:D ir in the inside



2. Create the. conf file.

By default, the system searches the path of the vault only/lib and/usr/lib. To add an additional search path, create a file in/etc/ld.so.conf.d/with a. conf suffix. The binary file path to be added is then written to this file.


#vim/etc/ld.so.conf.d/swname.sh

BINDIR

#ldconfig [OPTION] to re-search the library file.

-V displays the procedure.


3. Header files

Default location:/usr/include

To add a header file search path, use the link to:

1, take each header file link.

Ln-s/usr/local/swname/include/*/usr/include/

2. Take the folder chain.

Ln-s/usr/local/swname/include/usr/include/swname


4.man file path:

The default path is defined in the Manpaht field in the/etc/man.conf configuration file.

#vim/etc/man.config

Manpath=dir

Or use the-M DIR to specify the software's man document location. You have to specify the path each time.

#man-M DIR COMMAND


This article is from "Small Private blog" blog, please be sure to keep this source http://ggvylf.blog.51cto.com/784661/1612478

Linux Software Management

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.