Linux yum Package Manager

Source: Internet
Author: User

 

Linux yum Package Manager

Linux commands

Common executable program file,/usr/bin

  • Server program, administrative program file,/usr/sbin

  • Configuration file,/etc

  • Log File,/var/log

  • For more information about the application, see/usr/share/doc.

  • Man manual of the execution file and configuration file,/usr/share/man

Ii. Package encapsulation type
  • RPM software package: the extension is ". rpm". You need to use the rpm command in linux.

  • DEB software package: the extension is ". deb". Only the DPKG mechanism can be used for installation in the linux operating system. To install DEB software, you must use the dkpg command in the linux system.

  • Source code package: A. .tar.gz.pdf and ".tar.bz2"

  • Software packages that provide installation programs: the extensions are different, and most of them are in the TarBall format.

  • Green installation-Free Software Package: it directly contains compiled execution program files without special installation.

Iii. RPM package management tools
The RPM package name format, "software name-software version-release times. hardware platform type. rpm"
Role of rpm commands
Query and verify RPM software package information
Install, upgrade, and uninstall the rpm Software Package
Maintenance of rpm database information and other comprehensive management operations
"-Q" for rpm query and without the option can be used to query whether the software package with a known name has been installed successfully.
-Qa: displays the list of all software installed in RPM mode in the current system.
-Qi: view the name, version, license agreement, usage description, and other details of the specified software package.
-Ql: displays the list of all directories and files installed by the specified software package in the current system.
-Qf: check which package installs the specified file or directory. -- file)
-Qc: displays the list of configuration files installed by the specified software package in the current system.
-Qd: displays the docfiles that the specified software package has installed on the current system.

For example, a list of all RPM packages installed in the current system is displayed, and the number of software packages is counted.
[Root @ localhost ~] # Rpm-qa | wc-l
Query uninstalled RPM packages
-Qpi: view the name and version of a specified software package.
-Qpl: view the list of all target directories and files to be installed.
-Qpc: view the list of configuration files to be installed for the software package.
-Qpd: view the list of documents to be installed for the software package.
Install, upgrade, and uninstall the RPM Software Package
-I: install a new RPM package in the current system.
-E: uninstall the software package with the specified name.
-U: checks a software package in the upgrade system. If the software package is not installed, it is equivalent to-I
-F: Check and update a software package in the system. If the software package is not installed, discard the installation.
-- Force: force a software package to be installed. It is used to replace or replace the new version with the old version.
-- Nodeps: The dependency is ignored when a software package is upgraded, installed, or uninstalled.
-H: the installation progress is displayed as # during installation.
-V: displays detailed information during software installation.
Maintain the RPM Database
-- Rebuilddb
-- Initdb
4. Compile the installer from the source code
The first development environment is free software. The gcc compiler is the best choice.

Basic Process
Unpack, tar
-- Prefix =/usr/local/aa can be used for configuration and configure to specify where to install
Compile and make
Install and make install

There will be dependency in the RPM installation package. Later, the great gods on the Internet used the yum command to process the dependency.

The RPM package can be automatically downloaded and installed from the specified server, and the dependency relationship can be automatically processed. All dependent software packages can be installed at one time without tedious download and installation.

 

 

1. Mount the installation disc to a fixed directory in the system.
2. Install the yum program.
3. modify the configuration file vi/etc/yum. repos. d/XXX. repo of the yum program.
[Test]
Name = Red Hat Enterprise Linux $ releasever-$ basearch-Source
Baseurl = file: // mnt
Enabled = 1
Gpgcheck = 0
# Gpgkey = file: // etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release


4. execute various commands
Yum clean all // used to clear the cache of the yum Repository
Yum list // used to list available software packages in the current Repository
Yum install XXX // used to install the required software package
Yum erase XXX // used to uninstall the specified Software Package

Yum grouplist // lists the program groups installed on the system and the available program groups in the current repository.
Yum groupinstall "XXX" // used to install the specified program group
Yum groupremove "XXX" // used to delete a specified program group

 

 


The following describes how to use yum.

650) this. width = 650; "style =" float: none "title =" 1.png" src = "http://www.bkjia.com/uploads/allimg/131227/1QZ0D39-0.png"/>

650) this. width = 650; "style =" float: none "title =" 2.png" src = "http://www.bkjia.com/uploads/allimg/131227/1QZ05457-1.png"/>

650) this. width = 650; "style =" float: none "title =" 3.png" src = "http://www.bkjia.com/uploads/allimg/131227/1QZ05317-2.png"/>

650) this. width = 650; "style =" float: none "title =" 4.png" src = "http://www.bkjia.com/uploads/allimg/131227/1QZ04209-3.png"/>

[Root @ localhost ~] # Yum list results

650) this. width = 650; "style =" float: none "title =" 5.png" src = "http://www.bkjia.com/uploads/allimg/131227/1QZ05041-4.png"/>

 

 

Appendix: small exercises

1. Create a test directory under the tmp directory, and create a directory a below. All the files in the usr/share directory are in the l (not number 1) copy all files starting with "a" to the directory.

650) this. width = 650; "style =" float: none "title =" 7.png" src = "http://www.bkjia.com/uploads/allimg/131227/1QZ06393-5.png"/>

2. Create a soft link for directory a under the root directory.

650) this. width = 650; "style =" float: none "title =" 8.png" src = "http://www.bkjia.com/uploads/allimg/131227/1QZ01255-6.png"/>

3. Copy all files with the switch in the/usr/share directory, excluding Directories) to the/tmp a directory, and compress the directory using bz2 technology.

[Root @ localhost ~] # Cp-rf 'Find/usr/share/-name "a *" '/tmp/

[Root @ localhost ~] # Tar cjvf a.tar. bz/tmp/

650) this. width = 650; "style =" float: none "title =" 9.png" src = "http://www.bkjia.com/uploads/allimg/131227/1QZ06396-7.png"/>

4. Import the result of mount -- help to a file.
Mount -- help | col-B> help.txt

650) this. width = 650; "style =" float: none "title =" 10.png" src = "http://www.bkjia.com/uploads/allimg/131227/1QZ02207-8.png"/>

5. Write lines 10th to 15 of the file to another file, write lines 1st to lines 8th to another file, and combine the two files into a new file.

650) this. width = 650; "style =" float: none "title =" 11.png" src = "http://www.bkjia.com/uploads/allimg/131227/1QZ01464-9.png"/>

650) this. width = 650; "style =" float: none "title =" 12.png" src = "http://www.bkjia.com/uploads/allimg/131227/1QZ0JL-10.png"/>

650) this. width = 650; "style =" float: none "title =" 13.png" src = "http://www.bkjia.com/uploads/allimg/131227/1QZ01234-11.png"/>

650) this. width = 650; "style =" float: none "title =" 14.png" src = "http://www.bkjia.com/uploads/allimg/131227/1QZ030N-12.png"/>

650) this. width = 650; "style =" float: none "title =" 15.png" src = "http://www.bkjia.com/uploads/allimg/131227/1QZ03594-13.png"/>

650) this. width = 650; "style =" float: none "title =" 16.png" src = "http://www.bkjia.com/uploads/allimg/131227/1QZ01218-14.png"/>

650) this. width = 650; "style =" float: none "title =" 17.png" src = "http://www.bkjia.com/uploads/allimg/131227/1QZ0IG-15.png"/>

650) this. width = 650; "style =" float: none "title =" 18.png" src = "http://www.bkjia.com/uploads/allimg/131227/1QZ02X9-16.png"/>

 

6. change all the mount entries in the new file generated above to MOUNT.

650) this. width = 650; "style =" float: none "title =" 19.png" src = "http://www.bkjia.com/uploads/allimg/131227/1QZ02b3-17.png"/>

 

650) this. width = 650; "style =" float: none "title =" Your png" src = "http://www.bkjia.com/uploads/allimg/131227/1QZ031A-18.png"/>

7. Add a # in front of each row in the mount -- help file #.

650) this. width = 650; "style =" float: none "title =" 21.png" src = "http://www.bkjia.com/uploads/allimg/131227/1QZ051G-19.png"/>

650) this. width = 650; "style =" float: none "title =" 22.png" src = "http://www.bkjia.com/uploads/allimg/131227/1QZ05T9-20.png"/>

8. Delete the first and second rows before the second row.

: 4, 9 s /#//

650) this. width = 650; "style =" float: none "title =" 23.png" src = "http://www.bkjia.com/uploads/allimg/131227/1QZ021W-21.png"/>

9. query which software package the fidsk command belongs to and list the files installed in the software package? What files are there?

650) this. width = 650; "style =" float: none "title =" 24.png" src = "http://www.bkjia.com/uploads/allimg/131227/1QZ0G53-22.png"/>

10. Install the VIM command and use VIM to open the file directly when executing the vi command.

650) this. width = 650; "style =" float: none "title =" 25.png" src = "http://www.bkjia.com/uploads/allimg/131227/1QZ01643-23.png"/>

 

 

 

 

This article is from the "technical control" blog, please be sure to keep this source http://chenhao6.blog.51cto.com/6228054/1207970

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.