Linux Study Notes-software package management

Source: Internet
Author: User

Before learning this lesson, I always think that rpm is outdated like many people who are new to me. RedHat is now the world of yum, after the lecture, instructor Li found that rpm is more practical than yum in many cases.

I. Binary Package Installation

Rpm software package management
An example of an RPM package
Sudo-1.7.2p1-5.el5.i386.rpm
Including the software name (SUDO)
Version (1.7.2pl)
Release number (5. EL5)
Hardware Platform (i386)

1. Uninstall
# Rpm-e sudo
NOTE: If other software packages are dependent on each other, a prompt message is displayed during uninstallation. You can use -- nodeps to forcibly uninstall the software.
Theoretically, this is not recommended.
The normal solution is to uninstall the dependency package first, and then uninstall the package.
2. Installation
# Rpm-IVH
I install
V details
H progress, expressed in #
How to attach a cd
The mount point is also an empty directory.
Place the temporarily mounted items in the/mnt directory to create a directory.
Mount/dev/CDROM/mnt/CDROM
In this case, accessing/mnt/CDROM is equivalent to accessing the CD
View
# Rpm-Q
Check whether the software has been installed

Query all software packages
Rpm-Qa | grep samba
View samba-related software packages

Rpm-IVH -- excludedocs sudo
Do not install document
Rpm-IVH -- prefix =/usr/local specifies the installation path
However, many software cannot change the installation path.
Linux does not have the Windows registry concept.
Rpm-IVH -- test is only a test. If it is not installed, you can check whether it is installed, dependency, conflict, etc.

Rpm-IVH -- replacepkgs overwrite installation if necessary

Rpm-IVH -- repacefiles
Conflicts with files *****

File conflict. If a file in the software package to be installed has been installed when other software is installed, the following error message is displayed, so that some information is ignored during the software package installation.

Rpm-IVH -- nodeps
3. rpm-uvh for upgrade

Yum package management
Benefits of Yum:
1) automatically resolves the package dependency
2) convenient software package upgrade

Install Yum install
Detect and upgrade Yum check-Update
Upgrade Yum update
Query Yum list by software package
Package information Yum info
Uninstall Yum remove
Help Yum -- help, man yum

Rpm query application cases
1. Check the software package of the file: rpm-QF
2. query the software package information: rpm-qi and rpm-QIP. (to query the software packages that are not installed, enter the full name)
3. query the package installation files: rpm-QL and rpm-qlp.
The configuration file under the/etc directory is generally
4. query the help documentation of the software package: rpm-Qd
5. view the configuration files: rpm-QC and rpm-qcp (view uninstalled software packages)

The rpm-V sudo check package has not been changed. If it has not been changed, there should be no response. But as shown in the following example:
[Root @ Lovelock ~] # Rpm-QL sudo
/Etc/PAM. d/sudo
/Etc/PAM. d/Sudo-I
// Etc/sudo-ldap.conf
/Etc/sudoers
/Etc/sudoers. d
/Usr/bin/sudo
/Usr/bin/sudoedit
If VI/etc/sudoers
Delete a character, for example
Delete a t in the second row
[Root @ Lovelock ~] # Rpm-V sudo
S.5... T. C/etc/sudoers
S indicates that the file size has changed,
5 indicates that the MD5 checksum of the file has changed.
T indicates that the time value has changed.
M indicates that the permission has changed.
The utable indicates that the owner has changed.
L link file
D. The feature of the device file is changed.
The group to which the G file belongs has changed.

Package file Extraction
Decompress all files to the current directory.
# Rpm2cpi initscripts-8.45.30-2.el5.centos.i386.rpm | cpio-IDV
I is execution
V is details
D. Keep the original file.

After the preceding statement, the corresponding file name is used to extract the specified file to the current directory.
Note that you need to add "." Before the directory name to decompress the package to the current directory.

Ii. Installation of source code packages

Application Example (ProFTPD)
# Tar-xzvf proftpd-1.3.3d.tar.gz (extract package)
# Cd proftpd-1.3.3d
#./Configure -- prefix =/usr/local/ProFTPD (configuration)
# Make (Compilation)
# Makeinstall (installation)

Iii. Script Installation
Application Example (Webmin (shell script) and OpenOffice (Java Script ))
# Tar-xzvf webwin-1.530.tar.gz
# Cd webmin-1.530
# Vi readme
#./Setup. Sh

4. APT package management
Search software package apt-cache search
Package information apt-Cache show
Install apt-Get install (reinstall,-f)
Delete apt-Get remove (autoremove, -- purge)
Update Software source apt-Get update
Update with installation package apt-Get upgrade

Summary

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.