RedHat software management (version 2)-binary software package management

Source: Internet
Author: User
RedHat software management-binary software package management

Linux learning philosophy-Linux is very transparent compared with windows. Therefore, both systems and software have their own built-in instructions or help documents provided by man, as long as we make good use of these documents, as long as the English is good enough, no textbooks are required, and any teaching videos are available, you can learn Linux well!

 

RPM package management

Linux software package naming

Sudo-1.7.2p1-5.el5.i386.rpm

# This includes the software name (SUDO), version number (1.7.2pl), Release number (5. EL5), and hardware platform (i386)

 

Uninstall Software Package

Rpm-E [Soft-name] # If other software packages are dependent on each other, a prompt message is displayed when you detach the software package.

Rpm-e -- nodeps [Soft-name] # Add -- nodeps, which can be forcibly uninstalled. However, it is not recommended to uninstall it like this.

Install software package

Rpm-IVH [software package name] [e.g.: sudo-1.7.2p1-5.el5.i386.rpm]

V: displays details. Optional.

H: displays the installation progress. Optional.

 

1. Attach a CD: [Best Practice: attach the CD and USB flash disk to the/mnt Directory]

Mkdir/mnt/CDROM

Mount/dev/CDROM/mnt/CDROM # enable/mnt/CDROM now is equivalent to accessing the Cd content

2. Check whether the query exists: ls | grep sudo

 

3. Installation: rpm-IVH sudo-1.7.2p1-5.el5.i386.rpm

 

4. Check whether the command is installed: rpm-Q sudo

 

5. rpm-Qa | grep Samba # query all samba-related software packages

-Qa indicates querying all installed software packages]


Other RPM Installation Options

-- Excludedocs does not install software

-- Prefix = path: install the software package to the path specified by path.

For example: rpm-IVH-Prefix =/usr/local sudo-1.7.2p1-5.el5.i386.rpm

However, most RPM packages do not allow you to change the installation path]

-- Test is only for testing, but not for installation. For example, if the dependency is obtained, whether the software package has been installed

 

Appendix-all the binary software on the CD is stored in centos | packages [New centos] Directory

 

Special Cases

A. overwrite the installation

-- Replacepkgs overwrite the software installation package

B. Installation conflict

If a file in the software package to be installed has been installed when other software packages are installed, the following error message is displayed:

rpm -ivh sudo-1.8.6p3-7.el6.i686.rpm warning: sudo-1.8.6p3-7.el6.i686.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEYPreparing...                ########################################### [100%]package sudo-1.8.6p3-7.el6.i686 is already installed

Make -- replacefiles ignore modification error information, overwrite Installation

 

C. Unresolved Dependencies

This software package may depend on other software packages. It can be installed only after a specific software package is installed.

rpm -ivh sudo-1.7.2p1-5.el5.i386.rpm failed dependencies: sudo is needed by bark-3.2-1l

Use the -- nodeps option to forcibly install the software package.


Upgrade Software Package

Sudo-uvh sudo-1.8.6p3-7.el6.i686.rpm

 

Query [important]

-A: Query all installed software packages.

-F: query the software package of the file

-P: query the software package. The software package has not been installed.

-Q: Check whether the software package is installed.

-I: displays the package information.

-L display the file list and location in the Software Package

-D: displays the list of files marked as documents and their locations

-C: displays the list of files marked as configuration files and their locations

 

Instance:

1. query the packages of files/commands

Rpm-qf/etc/services # configuration file

Rpm-qf/bin/ls # command

2. query the software package information

Rpm-Qi Samba // query an installed software package

Rpm-QIP samba-3.6.9-151.el6.i686.rpm # You can query the RPM package that has not been installed, full name!

3. query the installation file of the installation package and the location of the Installation File.

Rpm-QL sudo

Rpm-QIP vsftpd-2.2.2-11.el6_3.1.i686.rpm # not installed, full name!

4. query the help documentation and location of the software package

Rpm-Qd sudo

Rpm-qdp vsftpd-2.2.2-11.el6_3.1.i686.rpm # not installed, full name!

5. query the software package configuration file and its location

Rpm-QC

Rpm-qcp // same as above

Rpm integrated application instance

1. What is vncserver used ???

Rpm-QF vncserver

Then rpm-Qi VNC-server # learn carefully

 

Ii. query Vim standard comments

1. Check whether an installation package has been installed in the query system: rpm-Qa | grep Vim

Instead of using it directly: rpm-A Vim

Query example documents: rpm-Qa Vim | grep example

2. Open and view

VI/usr/share/Vim/vim72/vimrc_example.vim

 

Verification

# It can be used to help us determine if the software package has a problem and where the problem occurs

Rpm-V name is not prompted normally, and its files are not changed.

[When RPM installs a software into the system, it will automatically generate an RPM database. During verification, it will be compared with this database]

 

5. MD5 check value of the file

S file size

L link file

T File Creation or last modification time

D. Device File

U file user

G file User Group

M File Permissions

 

-Md5sum: generate a unique check value for the file through the MD5 algorithm. The check value will not change as long as the content of the file remains unchanged. Make any minor changes to the file content, his checksum changes.

 

Important file repair

For example, if the/etc/inittab file is deleted, the file can be extracted from the original installation disc.

1. Locate the software package to which the file belongs

Rpm-qf/etc/inittab

 

2. Decompress all files to the current directory [not recommended]

Rpm2cpi initscripts-8.45.30-2.el5.centos.i386.rpm | cpio-IDV

Decompress the specified file to the current directory [recommended]

Rpm2cpio/mnt/CDROM/initscripts-8.45.30-2.el5.centos.i386.rpm | cpio-IDV./etc/inittab [Note:./etc/inittab can only be extracted to the current directory]

[In terms of Linux Server Management, we prefer to be stable, not the latest version]

 

Yum software package management

Benefits of using yum

(1) automatically solves dependencies between software installation packages

(2) convenient software package upgrade

(3) trusted, Official Software Package

 

1. Installation

Yum install sudo

 

2. Detection and upgrade

Yum check-update sudo

Yum check-update # Check the upgrade of all software packages

3. Upgrade [important: Upgrade frequently for commonly used software packages]

Yum update sudo

 

4. query the software package information

Yum list // lists all software packages on the software source

Best Practice: Yum list | less

Yum list | grep samba

 

5. query the software package information

Yum info [software name]

Yum info sudo

 

6. Uninstall the Software Package

Yum remove sudo

 

7. View help information

Yum -- help or man yum

[Best Practice: Yum -- help | less]



RedHat software management (version 2)-binary software package 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.