Linux packages can be broadly divided into two categories: source packages and binary packages.
The source package is an open source (modifiable) software package written by C language. Source package in the compilation of the installation can be free to choose the function, uninstall can be directly convenient to delete, because it is compiled and installed, the installed software can be more compatible with the hardware platform of the machine, more stable and efficient. However, the source package compilation installation of large software collection is cumbersome and error-prone steps.
Binary package also known as RPM package, it is easy to install, usually a command can take a software, but it is compiled, not see the source code, but also can not be modified, and its biggest disadvantage is that the installation software must solve the dependencies of the package, yum online installation solves this thorny problem.
Installation of source Packages
Source package installed in the specified location, generally/usr/local/software_name/, and RPM installed in the default location is different from the installed service can not be set by the Service Manager, can only use the absolute path Management service.
Install the source package because it needs to be compiled, first install the C language compiler gcc in Linux.
Unzip the source package (the source package is generally placed in the/usr/local/scr/), into the decompression directory to start the installation.
Look at the install file and the Readme file before installing.
1. Configure #软件的配置和检查 and write information about the defined functionality and system environment to the makefile file
2. Make #编译
3. Make Install #编译安装
RPM Package Installation
RPM Command Installation
The package name format for RPM packages is typically "name-version-release number-platform. RPM"
RPM package also has binary format and source format, source format with the same source package in the native compilation, can better play the hardware performance of the machine.
Installation:
rpm-ivh/path/Package Full Name
Options
-I. #install安装
-V #verbose Show details (-VV)
-H #hash Show progress in # to show progress, each # represents 2%
--replacepkgs #重新安装, replace the original installation
--force #强行安装, can be re-installed or degraded
--Nodeps #不检测依赖性
Upgrade:
rpm-uvh/path/Package Full Name
-U #升级软件
Unloading:
RPM-E Package Name
-E Erase Uninstall
--Nodeps does not check for dependencies
Inquire:
1. Whether the query is installed
RPM-Q Package Name query is installed
RPM-QA Package Name query all installed RPM packages
[Email protected] ~]# rpm-q screen screen-4.0.3-4.el5[[email protected] ~]# Rpm-qa | Headrmt-0.4b41-4.el5desktop-backgrounds-basic-2.0-37man-pages-2.39-15.el5popt-1.10.2.3-18.el5libusb-0.1.12-5.1readline-5 .1-3.el5bzip2-libs-1.0.3-4.el5_2gdbm-1.8.0-26.2.1elfutils-libelf-0.137-3.el5libfontenc-1.0.2-2.2.el5
2. Query Package Details
RPM-QI Package Name
-I information query software information
-P Package query does not install packages information
[[email protected] ~]# rpm -qi screenname : screen Relocations: (not relocatable) version : 4.0.3 Vendor: centosrelease : 4.el5 Build date: 2011 May 04 Wednesday 23 29 minutes 00 seconds install date: 2015 October 25 Sunday 05 17 minutes 39 seconds Build Host: builder10.centos.orgGroup : applications/system source rpm: screen-4.0.3-4.el5.src.rpmsize : 757243 License: GPL2Signature : DSA/SHA1, May 05, 2011 Thursday 01 13 minutes 55 seconds, key id a8a447dce8562897url : http://www.gnu.org/software/screenSummary : A screen manager that supports multiple logins on a single terminal. The description :screen tool allows you to have multiple logins on a single terminal. screen is useful for users who telnet to a machine or through a simple terminal, but who want to have multiple logins. If you need a screen manager that can support multiple logins on one terminal, install the screen package.
3. Check the file in the package installation location
RPM-QL Package Name
-l List Listing
-P Package query does not install packages information
[[email protected] ~]# rpm -q screenscreen-4.0.3-4.el5[[email protected] ~] # rpm -ql screen/etc/pam.d/screen/etc/screenrc/usr/bin/screen/usr/share/doc/screen-4.0.3/usr/ share/doc/screen-4.0.3/faq/usr/share/doc/screen-4.0.3/news/usr/share/doc/screen-4.0.3/readme/usr/share/doc/ Screen-4.0.3/readme. dotscreen/usr/share/info/screen.info.gz/usr/share/man/man1/screen.1.gz/usr/share/screen/usr/share/screen/ utf8encodings/usr/share/screen/utf8encodings/01/usr/share/screen/utf8encodings/02/usr/share/screen/ utf8encodings/03/usr/share/screen/utf8encodings/04/usr/share/screen/utf8encodings/18/usr/share/screen/ utf8encodings/19/usr/share/screen/utf8encodings/a1/usr/share/screen/utf8encodings/bf/usr/share/screen/ utf8encodings/c2/usr/share/screen/utf8encodings/c3/usr/share/screen/utf8encodings/c4/usr/share/screen/ utf8encodings/c6/usr/share/screen/utf8encodings/c7/usr/share/screen/utf8encodings/c8/usr/share/screen/ Utf8encodings/cc/usr/share/screen/utf8encodIngs/cd/usr/share/screen/utf8encodings/d6/var/run/screen
4. Which RPM package does the query system file belong to?
RPM-QF System File name
-F file queries which package the system files belong to
5. Querying the dependencies of a package
RPM-QR Package Name
-R Query Package dependency requires
[Email protected] ~]# RPM-QR Screen/bin/sh/bin/sh/bin/sh/sbin/install-info/sbin/install-info/usr/sbin/groupadd Config (screen) = 4.0.3-4.el5libc.so.6 libc.so.6 (glibc_2.0) libc.so.6 (glibc_2.1) libc.so.6 (glibc_2.2) libc.so.6 (GLIBC _2.3.4) libc.so.6 (glibc_2.4) libcrypt.so.1 libcrypt.so.1 (glibc_2.0) libncurses.so.5 libpam.so.0 libpam.so.0 (LIBPAM_1 .0) libutempter.so.0 libutil.so.1 rpmlib (compressedfilenames) <= 3.0.4-1rpmlib (payloadfileshaveprefix) <= 4.0-1rtld (Gnu_hash)
RPM Package Check:
Rpm-v Installed package Name
-V verifies the files in the specified RPM package verify
Verify that the content includes the file size (S), the file's type, or the file's permissions rwx (M), the file's MD5 checksum (5), the device's code (D), the file path (L), the owner of the file (owners u), the genus (G), the file's modification time (t), and the corresponding location
File extraction in RPM package:
Rpm2cpio Package Full Name | Cpio-idv. File absolute Path
Convert RPM package to CPIO format
Yum Command Installation
Common commands
View Profile/etc/yum.repos.d/centos-base.repo (view network yum source)
[[email protected] ~]# vim /etc/yum.repos.d/centos-base.repo [base] # Container name name=centos-5 - base #容器说明baseurl = #yum源服务器地址 gpgcheck=1 #RPM数字证书生效与否 (1 for entry into force) gpgkey= #数字证书的公钥文件保存位置 #released updates[update]name=centos-5 - updatesbaseurl=http://centos.ustc.edu.cn/centos/5/updates/$basearch/gpgcheck=1gpgkey=http:// Mirror.centos.org/centos/rpm-gpg-key-centos-5#packages used/produced in the build but not released[addons]name=centos-5 - addonsbaseurl=http://centos.ustc.edu.cn/centos/5/ addons/$basearch/gpgcheck=1gpgkey=http://mirror.centos.org/centos/rpm-gpg-key-centos-5#additional packages that may be useful[extras]name=centos-5 - extrasbaseurl=http:// centos.ustc.edu.cn/centos/5/extras/$basearch/gpgcheck=1gpgkey=http://mirror.centos.org/centos/ Rpm-gpg-key-centos-5#additional packages that extenD functionality of existing packages[centosplus]name=centos-5 - plusbaseurl=http ://centos.ustc.edu.cn/centos/5/centosplus/$basearch/gpgcheck=1enabled=0 #容器生效与否, not written or = 1 for effective, = 0 for non-effective gpgkey=http://mirror.centos.org/centos/rpm-gpg-key-centos-5#contrib - packages by centos users[contrib]name=centos-5 - contribbaseurl=http://centos.ustc.edu.cn/centos/5/contrib/ $basearch/gpgcheck=1enabled=0gpgkey=http://mirror.centos.org/centos/rpm-gpg-key-centos-5#packages in testing[testing]name=centos-5 - testingbaseurl=http://centos.ustc.edu.cn/centos/5/testing/$ Basearch/gpgcheck=1enabled=0gpgkey=http://mirror.centos.org/centos/rpm-gpg-key-centos-5
Query the list of all available packages:
[[Email protected] ~]# yum list | headloading mirror speeds from cached hostfileInstalled PackagesDeployment_Guide-en-US.noarch 5.2-11 installeddeployment_ guide-zh-cn.noarch 5.2-11 installedDeployment_Guide-zh-TW.noarch 5.2-11 installedGConf2.i386 2.14.0-9.el5 installedGConf2-devel.i386 2.14.0-9.el5 installedimagemagick.i386 6.2.8.0-4.el5_1.1 installedMAKEDEV.i386 3.23-1.2 installedexiting on broken pipe
Search for packages that match on the server
[[email protected] ~]# yum search gimploading mirror speeds from cached hostfile================================= matched: gimp =========================== ======glib-devel.i386 : the gimp toolkit (GTK +) and GIMP Drawing kit (GDK) support : library.gtk+.i386 : The GIMP ToolKit (GTK +), a Library for creating guis for x.gtk+-devel.i386 : development tools for GTK+ (Gimp toolkit) applications.gimp.i386 : GNU Image manipulation programgimp-devel.i386 : gimp plug-in and extension development Kit gimp-libs.i386 : gimp Additional files for librariesgimp-data-extras.noarch : gimp . gimp-help.noarch : gimp 's help file. gimp-print.i386 : a groupA high-quality collection of printer drivers. gimp-print-cups.i386 : CUPS drivers for canon, Epson, hp , and compatible printers gimp-print-devel.i386 : develop the files needed for applications that use gimp-print . gimp-print-plugin.i386 : GIMP plugin gimp-print-utils.i386  for gimp-print ;: gimp-print Tool Program glib2-devel.i386 : gimp Toolkit (GTK +) and GIMP drawing packages (GDK) Support library. gtk2.i386 : the gimp toolkit (GTK +), a library for creating guis for xxsane-gimp.i386 : a GIMP plug-in that provides SANE scanner interface.
Yum source installation/upgrade/uninstall (-y automatic)
[[email protected] ~]# yum-y install screen[[email protected] ~]# yum-y Update screen #必须指定包名, otherwise Linux will all be upgraded (including kernel, but kernel cannot be y UM upgrade) [[email protected] ~]# yum-y Remove screen #yum卸载会卸载很多系统相关的软件, it's dangerous.
Yum Software Group Management
Yum Grouplist #列出所有可用的软件组列表
Yum groupinstall #软件组名 Install the specified software group, the group name can be queried by grouplist
Yum groupremove software group name #卸载指定软件组
[[email protected] ~]# yum grouplistsetting up group processloading mirror speeds from cached hostfileinstalled groups: gnome Desktop Environment X Window Systems X Software development Yum Utilities World Wide Web Server office/Productivity Graphics graphical Internet text-based internet Development Tools Development Libraries Print support Dial-Up Networking support Licensing and publishing server configuration tools games and entertainment Administrative Tools System Tools Editor Web server old Web server old software development old software support video and Audio mail server available groups: beagle dns Name Server Eclipse FTP server freenx and nx GNOME SoftDevelopment KDE Software development for horde hyperv java development KDE (k desktop environment) Mono MySQL databases OpenFabrics Enterprise Edition release PostgreSQL database Tomboy windows file Server XFCE-4.4 Xen basic Engineering and science news server cluster cluster storage done
Disc Yum Source Setup
Mount Disc Mount/dev/cdrom/mnt/cdrom
Invalidates the network Yum source file (change. Repo to. Repo.bak)
Modify 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 =1 #值改为1 enabled=1 #值改为1使yum源配置文件生效 gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-centos-6 #不用修改
This article is from the "A-filled blog" blog, please be sure to keep this source http://laizetian.blog.51cto.com/10728827/1707177
Linux Package Management