Linux Learning 6 Package installation

Source: Internet
Author: User
Tags gpg

First, package management Introduction two, RPM package management-RPM Command Management III, RPM package management-Yum Online Management Iv. source package management Five, script installation package and package selection1, Package classification? Source package? Script installation package? Binary package (RPM package, system default package)2, source package source code package advantages are:? Open source, if you have sufficient capacity, you can modify the source? Is it possible to freely select the desired function? Software is compiled and installed, so more suitable for your own system, more stable and more efficient? The disadvantages of uninstalling the convenient source package? In particular, when installing large software collections (such as lamp environment), prone to spelling errors? The compilation process takes a long time, and the installation is longer than the binary installation time? Because it is a compilation installation, the installation process when the novice is difficult to solve3the advantages of RPM package binary package? Package management system is simple, only through a few commands can be implemented package installation, upgrade, query and installation speed than the source package installation faster than the multi-binary package disadvantages:? After compiling, no longer see the source code? The function selection is not as flexible as the source package? Dependency two, RPM package management -RPM Command Management1, RPM package naming principle httpd-2.2. the- the. El6.centos.1. i686.rpm httpd Package Name2.2. thesoftware version thenumber of software releases El6.centos suitable Linux platform i686 suitable hardware platform rpm RPM package extension6.2.1RPM Package Management-rpm Command Management-package naming and dependencies2, RPM packet dependency? Tree dependency: A?b?c? Ring-dependent: A?b?c?a? Module dependency: module dependent Query Web site: www.rpmfind.net6.2.2RPM Package Management-rpm Command Management-install upgrade and uninstall1, package full name and package name? Package Full Name: The package full name is used when the package that operates is not installed. and pay attention to the path? Package Name: Use the package name when operating a package that has already been installed. is Search/var/lib/rpm/the database in2, RPM installation RPM–IVH package full Name option:-I (install) installation-V (verbose) Show Details-h (hash) Show Progress--Nodeps does not detect dependencies3, RPM package upgrade RPM-UVH Package full name option:-U (upgrade) Upgrade1, the query is installed [[email protected]~]# RPM-q Package name #查询包是否安装 options:-q query [[email protected]~]# rpm–qa #查询所有已经安装的RPM包 options:-A (All)2, query package details [[email protected]~]# RPM–QI Package name options:-I query software information (information)-P Query The package information is not installed3, query the file installation location in the package [email protected]~]# RPM–QL Package name options:-L List-P Query The package information is not installed3, query the file installation location in the package [email protected]~]# RPM–QL Package name options:-L List-P Query The package information is not installed5, query package dependencies [[email protected]~]# RPM–QR Package name options:-R Query Package dependencies (requires)-p Query for package information not installed6.2.3RPM Package Management-rpm Command Management-RPM Package Query1, the query is installed [[email protected]~]# RPM-q Package name #查询包是否安装 options:-q query [[email protected]~]# rpm–qa #查询所有已经安装的RPM包 options:-A (All)2, query package details [[email protected]~]# RPM–QI Package name options:-I query software information (information)-p Query for package information not installed3, query the file installation location in the package [email protected]~]# RPM–QL Package name options:-L List-P Query The package information is not installed4, query system file belongs to which RPM package [[email protected]~]# RPM–QF System file name options:-F Query which package the system file belongs to (file5, query package dependencies [[email protected]~]# RPM–QR Package name options:-R Query Package dependencies (requires)-P Query The package information is not installed6.2.4RPM Package Management-rpm Command Management-Checksum file Extraction1, RPM package check [[email protected]~]# rpm–v Installed package name option:-V Verify the contents of the file (verify) in the specified RPM package to verify that the content of the 8 information is as follows:? Is the size of the S file changed? is the type of M file or the file's permissions (RWX) changed?5does the file MD5 checksum change (as if the contents of the file have changed)? D device, from code change? L file path changed? Does the owner of the U file change? is the genus Group of G file changed? Does the modified time of the file change the file type? C Config file? d normal document (documentation)? g "Ghost file", very rarely, is that the file should not be included in this RPM package? l authorization File (license file)? r profile (Read Me)2, RPM package file extraction [[email protected]~]# Rpm2cpio Package Full name |\ Cpio-idv. File absolute path Rpm2cpio #将rpm包转换为cpio格式的命令 cpio #是一个标准工具, which is used to create software archive files and extract files from files [email protected]~]# cpio Options < [File |Devices] Option:-i:copy-in mode, restore-D: Automatically create a new directory when restoring-V: Show restore process [[email protected]~]# rpm-qf/bin/ls #查询ls命令属于哪个软件包 [[email protected]~]# mv/bin/ls/tmp/#造成ls命令误删除假象 [[email protected]~]# rpm2cpio/mnt/cdrom/packages/coreutils-8.4- +. el6.i686.rpm | Cpio-idv./bin/ls #提取RPM包中ls命令到当前目录的/bin/ls under [[email protected]~]# cp/root/bin/ls/bin/#把ls命令复制会/bin/directory, repair file missing6.3.1RPM Package Management-yum Online Management-IP address configuration and network Yum source6.3.1IP address configuration and network Yum source6.3.2Yum Command6.3.2disc Yum Source setup1, IP address configuration [[email protected]~]# setup #使用setup工具 [[email protected]~]# vi/etc/sysconfig/network-scripts/ifcfg-eth0 put Onboot="No" change to Onboot="yes" #启动网卡 [[email protected]~]# Service Network restart #重启网络服务2, network yum source [[email protected] yum.repos.d]# vi/etc/yum.repos.d/centos-Base.repo? [Base] Container name, must be placed in []? name container description, you can write it yourself? Mirrorlist Mirror site, this can be commented out? BaseURL the address of our Yum source server. The default is the official CentOS Yum source server, is available, if you feel slow can be changed to your favorite Yum source address? Enabled if this container is not written or written as enable=1 are in force, written enable=0 is not effective? Gpgcheck if 1 means the RPM digital certificate is in effect, if 0 does not take effect? Gpgkey the public key file where the digital certificate is stored. No modification6.3.2Yum Command1, common yum commands1) query [[email protected] yum.repos.d]# Yum list #查询所有可用软件包列表 [[email protected] yum.repos.d]# Yum search keyword #搜索服务器上所有和关 Key-word-related packages2) Install [[email protected] yum.repos.d]# yum–y Install package name option: Installation-y Answer yes automatically3) upgrade [[email protected] yum.repos.d]# Yum-y update package name option: Update Upgrade-y Answer yes automatically4) Uninstall [[email protected] yum.repos.d]# Yum-y Remove Package name option: Remove Uninstall-y Answer yes automatically2, yum software Group management commands [[email protected]~]# Yum grouplist #列出所有可用的软件组列表 [[email protected]~]# yum groupinstall software group name #安装指定软件组, group name can be queried by grouplist [email protected]~]# yum groupremove software group name #卸载指定软件组6.3.3RPM Package Management-yum Online Management-Disc Yum Source6.3.2Setup process of Yum source for CD-ROM yum source1) Mount disc [[email protected]~]# mount/dev/cdrom/mnt/cdrom/2) to invalidate the network yum source file [email protected]~]# cd/etc/yum.repos.d/[email protected] yum.repos.d]# MV CentOS-base.repo \ CentOS-Base.repo.bak [[email protected] yum.repos.d]# MV CentOS-debuginfo.repo \ CentOS-Debuginfo.repo.bak [[email protected] yum.repos.d]# MV CentOS-vault.repo \ CentOS-Vault.repo.bak3Modify disc yum source file [[email protected] yum.repos.d]# vim CentOS-Media.repo [C6-Media] Name=centos-$releasever-Media BaseURL=file:///Mnt/cdrom#地址为你自己的光盘挂载地址 # File:///media/cdrom/# File:///media/cdrecorder/#注释这两个不存在的地址 Gpgcheck=1enabled=1#把enabled=0 Change to Enabled=1, let this yum source configuration file take effect Gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-centos-66.4Source Package Management6.4.1the difference between the source package and the RPM package6.4.2Source Package Installation process1, difference? Before installation: A conceptual difference? The difference after installation: different installation locations2, RPM package installation location? is installed in the default location RPM package default installation path/etc/configuration file installation directory/usr/bin/executable Command installation directory/usr/lib/function library where the program is stored/usr/share/doc/Basic software User manual save location/usr/share/man/Help file Save location3, source package installation location? installed in the designated location, is generally/usr/local/Software name/4, the impact of different installation locations? RPM Package Installed services can be managed using the System Service Management Command (service), such as the RPM package installed Apache boot method is:?/etc/rc.d/init.d/httpd start service httpd start? The source package installation service cannot be managed by the Service Management command because it is not installed in the default path. So you can only use the absolute path of service management, such as:?/usr/local/apache2/bin/apachectl Start6.4.2SOURCE Package Management-Source Package Installation process6.4.1the difference between the source package and the RPM package6.4.2Source Package Installation process1, installation preparation? Install the C language compiler? Download the source package http://mirror.bit.edu.cn/apache/httpd/2, installation precautions? Where to save the source code:/usr/local/src/? Software Installation Location:/usr/local/How to determine the installation process error:? The installation process stops? and a hint of error, warning, or no appears3, the source package installation process? Download the source package? Unzip the downloaded source package? into the Unzip directory?/Configure software configuration and inspection? Define the required feature options. To detect whether the system environment meets the installation requirements. Write the defined function options and the inspection system environment information to the makefile file for subsequent edits. Make compile? Make Install build installation4, the source package uninstall? Do not need to uninstall the command, directly delete the installation directory. No junk files will be left behind. 6.5Script installation Package1, the script installation package? The script installation package is not a standalone package type, and the common installation is the source package. is a script that installs automatically, as long as you execute the script and define simple parameters, you can complete the installation. Very similar to how Windows software is installed. 2, the role of Webmin? Webmin is a WEB-based Linux system management interface. You can set up user accounts, Apache, DNS, file sharing and other services in a graphical way. 3, webmin installation process? Download the software? http://sourceforge.net/projects/webadmin/files/webmin/? Unzip and go to the zipped directory? Execute the installation script

Linux Learning 6 Package installation

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.