Installation of linux programs and use of rpm and yum

Source: Internet
Author: User

Installation of software in linux

In linux, software is installed in two ways: one is to directly download the source code package and install it after compilation; the other is to directly obtain the rpm package for installation.

 

Any software installation method has the following four features:

1. All have configuration files. You can set the configuration file to change the running characteristics of the program at startup;

2. All programs have binary entities;

3. All built-in library files, called by a total of Program subjects;

4. The help files are provided to describe how to use the program.

 

Software installation path:

In addition to downloading the source code to compile and install software, you can customize the installation path. The rpm package is installed according to the preset installation path of the software. There are mainly the following types:

1./: system root directory. The files installed here are usually the programs that need to be called when the OS is running;

2./usr: the software under this directory generally provides basic services.

3./usr/local: third-party software installed by the user.

 

System related:

I. configuration file path:/etc

Ii. Binary File Path:/bin,/sbin

Iii: library file path:/lib

Functions and services provided by the system:

I: configuration file path:/etc

Ii: binary file path:/usr/bin,/usr/sbin

Iii: library file:/usr/lib

Third-party software:

I: configuration file path/usr/local/etc,/usr/local/APP/etc

Ii: binary file path:/usr/local/bin,/usr/local/sbin

Iii: library file:/usr/local/lib

 

Description files are stored in:/usr/share/man and/usr/local/share/man.

 

The following describes how to install software on linux:

 

Binary Package Installation

[Root @ server155 axel-2.4] #./configure

The strip option is enabled. This shoshould not be a problem usually, but on some

Systems it breaks stuff.

 

Configuration done:

Internationalization enabled.

Debugging disabled.

Binary stripping enabled

[Root @ server155 axel-2.4] # make

[Root @ server155 axel-2.4] # make install

A total of three commands are used to install the binary program.

 

Use RPM to install the software package:

Rpm is the package manager provided by redhat.

Common functions:

Query rpm-q

-Qa: Query all packages installed on the local machine

-Q PACKAGENAME

Query the version of the installed software package

Eg: rpm-qa # displays software packages installed on the local machine

Rpm-qa | grep "xxx" queries the software package named xxx

-Ql PACKAGENAME

List the files generated by this installation package

-Qc PACKAGENAME

List the configuration files generated by the installation package.

-Qd PACKAGENAME

List the documents generated by this installation package

-Qf FILENAME

View the files generated by those installation packages

-Qi PACKAGENAME

View software package information

 

Install rpm-ivh PACKAGENAME

-I. Install the corresponding software package.

-Display the installation read entries in the text-to-text box.

-- Nodeps ignore dependency Installation

 

Uninstall rpm-e PACKAGENAME

Uninstall Software Package

-- Nodeps ignore dependency uninstallation

 

Upgrade rpm-Uvh PACKAGENAME directly after installation; otherwise, install the new version directly.

-Fvl PACKAGENAME: only upgrades installed software

 

Verify rpm-v packagename to check whether the installed files have been modified.

 

Note: The rpm installation query is based on the database generated by rpm. The reconstruction of the database usually uses rpm-rebuilddb.

And rpm-initdb. The former is directly rebuilt and the latter is created only when the current database is not detected. The rpm will generate a log file during installation,/root/install. the installation records are recorded in the log file.

 

Install with the yum software Installer:

Yum is the abbreviation of Yellowdog Updater Modified. It is an installation based on its own software library.

It can query the link in the software library to obtain the software package to be installed from the remote server or the specified local file library. It can be seen that the configuration of the soft armor database is a very important part in the use of yum.

Configuration of the yum library file:

Set the yum software library through the files in the/etc/yum. repos. d directory and ended with. repo.

 

The specific format of the configuration file:

[Repository name]

Name = string # indicates the Function

Baseurl = {ftp: // | http: // | file: //} link to the software library

Gpgcheck = {0 | 1} # Check whether the software package has been downloaded

 

Eg:

[Base]

Name = Instructor Server Repository

Base url = ftp://instructor.example.com/pub/Server

Gpgcheck = 0

 

Common functions of yum:

Install yum install PROGRAMNAME1 PROGRAMNAME2 PROGRAMNAME3...

 

Upgrade the software package yum update PROGRAMNAME

 

Query package installation status

Yum list {installed | available | PROGRAMNAME | all}

Installed query of installed software packages

Available

Query installed software packages by project name

All displays all installed and uninstalled software packages.

 

Uninstall yum remove PROGRAMNAME

 

Clear Software List Cache

Yum clean all

# Synchronize the query information from the software library to the local cache. This command is used to clear

 

View the software packages associated with the file

Yum provides FILENAME

# The absolute path of the file must be provided for FILENAME.

Eg:

 

[Root @ server28 myscript] # yum provides/boot/grub

Loaded plugins: rhnplugin

This system is not registered with RHN.

RHN support will be disabled.

Importing additional filelist information

Grub-0.97-13.5.i386: GRUB-the Grand uniied Boot Loader.

Repo: base

Matched from:

Filename:/boot/grub

 

Grub-0.97-13.5.i386: GRUB-the Grand uniied Boot Loader.

Repo: installed

Matched from:

Other: Provides-match:/boot/grub

 

View the software package information:

Yum info PROGRAMNAME

Eg:

 

[Root @ server28 myscript] # yum info grub

Loaded plugins: rhnplugin

This system is not registered with RHN.

RHN support will be disabled.

Installed Packages

Name: grub

Arch: i386

Version: 0.97

Release: 13.5

Size: 1.0 M

Repo: installed

Summary: GRUB-the Grand uniied Boot Loader.

URL: http://www.gnu.org/software/grub/

License: GPL

Description: GRUB (Grand uniied Boot Loader) is an experimental boot loader

: Capable of booting into most free operating systems-Linux, FreeBSD,

: NetBSD, GNU Mach, and others as well as most extends cial operating

: Systems.

 

Use a local package file for installation:

Absolute path of the yun localinstall package

 

Install the package: yum groupinstall GROUPPROGRAMNAME

 

Component package query: yum grouplist GROUPPROGRAMNAME

Delete package: yum groupremove GROUPPROGRAMNAME

 

Component package information query: yum groupinfo GROUPPROGRAMNAME

 

This article is from "Welcome Amigo !" Blog

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.