One, how yum solves the dependency of rpm
When we talked about the dependency of rpm earlier, we said that if we install an x file, it depends on the library of y. This means that without y, x cannot run, but if y depends on z, this is It is acceptable. If there are a lot behind z, we have to press a string of x, which is a waste of time. What's more interesting is what should we do if it is a loop? Just like x depends on y, y depends on z, and z depends on y, then we are blinded, and we can't press any one. Using yum can make up for this defect.
First of all, yum is constructed by C/S (client, Server), and then our client needs to connect to the server to obtain its needs. The server here is not completely similar to our web server or ftp server, it can be a local yum warehouse. What is yum warehouse? It is the place or file service to put all the rpm packages we expect to use. There are three forms of file service. The first can provide an ftp server to provide services, the second can also provide a web server, which can be accessed through the web, and the third can even provide a local file path, so it can also be a complete local file path. Regardless of the form, the working mechanism of yum is the same. First of all, yum has its own client. Its working mechanism is dependent on the configuration file. In the configuration file, we can specify where the server is located. This server can be in ftp format or web format, either. But be sure to specify a file path for it.
Join and say that we install one x, and x depends on other 10 packages, and 8 of these 10 packages are installed, only 2 are left, yum goes to the warehouse to retrieve the other 2 needs to be installed After finding these two packages, they are also downloaded locally, and then installed at the same time. The working mechanism of yum actually depends on this yum warehouse. Yum can solve the relationship between them by itself, and can download it on demand.
What Yum relies on is not a certain package, but a capability. And there is a file stored in the yum warehouse. This file lists every rpm package in the current warehouse, and the capabilities provided by each rpm package are explained in detail. So when we use yum to install a certain file, it is not directly downloaded to the local, but combined with the local download situation and the information in the list in the warehouse, the analysis can conclude that to install x, which ones need to be installed Dependent packages, so download those packages to the local.
Extended Markup Language: XML: eXtended Mark Language
Hypertext language: HTML: HyperText Mark Language
2. Metadata files in yum warehouse:
primary.xml.gz: 1, a list of all RPM packages in the entire warehouse
2. Contains the dependencies of each package
3. List of files that can be generated by each RPM package
filelists.xml.gz:
List of all files of all RPM packages in the current warehouse:
other.xml.gz:
Additional information, modification log of RPM package;
repomd.xml:
What is recorded is the timestamp and checksum of the above three files
yum install zsh:
comps*.xml: RPM package grouping information (and rpm packages in each group are divided into three categories: must be installed; recommended to install; can be installed)
When we choose yum to install, we can install a group at once, and install the information inside at once.
Three, configure yum warehouse
/etc/yum.conf
In the future, which file we want to manually configure will be configured under /etc/yum.repos.d/, and the suffix of the name must be .repo. It's not that this one cannot be recognized. Let's take a look at the format of the file content. For example: let's look at the content of rhel-debuginfo.repo.
How to use /media/cdrom{Serve,VT,Cluster,ClusterStorage} to create a yum warehouse
Destination: cd /etc/yum.repos.d/
Edit in: vim Sever.repo, the type is as follows
How to define repo file for yum
format:
[Repo_ID]
name=: description information
baseurl =
ftp:// (protocol separator) refers to the warehouse
http://
file:///(/ refers to the root)
enabled={0|1}0 disable 1 enable
gpgcheck={0|1} defaults to 1
gpgkey=: Specify the accurate storage location of gpg
If our Server defines it as a repo warehouse, we also define VT as a repo warehouse
How to create a yum warehouse by yourself [Note: If there is an error while doing the list, we will clear the cache and perform the list]
createrepo
First of all, we have to enter /etc/yum.repos.d, and we will edit the content of Server (vim Server) as (as shown in the figure:) and then view it in yum list.
First: cd /etc/yum.repos.d/, after installing createrepo, we create a VT in the yum directory, and then copy all the *.rpm files in /media/cdrom/VT/ to the created VT, Then edit vim cdrom.repo. The format is as above
But there may be no repodata above, so we have to create it, using createrepo /yum/VT, and create it under /yum/VT.
Four, yum command:
yum [options] [command][pacdkage...]
-y: automatically answer yes
--nogpgcheck: do not do gpg check
list: list
Mechanism to support glob wildcard
all: default
available: available, in the warehouse but not installed
installed: installed
updates: available upgrades
clean: clear cache [packages|headers|metadata|dbcache|all]
For example: we only show packages with zsh*
repolist: Display the list of repo and its brief information
all: all
enabled: Only display allowed (default)
disabled: display standby
If we check the details yum repolist. As shown:
Five, install: install
yum install PACKAGE_NAME
update: upgrade (automatically upgrade to the latest version)
update_to; upgrade to the specified version
remove|erase: uninstall
info: Query the description information of the specified package. Equivalent to rpm -qi
provides|whatprovides: View which package installation generated the specified file or feature
grouplist: List all groups
hidden: show hidden
groupwildcard:
For example: before we installed php53-mysql-5.3.3-5.el5.i386.rpm but did not install successfully, now we use yum to install. The package in the first box is the dependency relationship, and the description in the second box is in the base. This is the advantage of yum.
If we uninstall php53-pdo from the package that php53-mysql depends on, we find that even php53-mysql is uninstalled. Why are the other two not uninstalled? Because the other two have nothing to do with php53-pdo.
If we use yum how to query the description information of the specified package, the result of using info is the same as the -qi query in rmp.
If we want to query which package the /etc/inittab package is generated. Use yum provides /etc/inittab to check.
We use grouplist to list all groups first, we use yum grouplist "Development Tools"Listed. (Due to too much content, no picture cut)
Among them, there is a Mandotory Packages group that is mandatory to install at the beginning, Default Packages in the middle is installed by default, and Optional Packages below are selected for installation.
We install the package php53-mysql-5.3.3-5.el5.i386.rpm once to let everyone see the benefits of yum more clearly. (Due to too much content, we cut the part) Red can see that the dependent software packages cannot be processed by rpm, but yum can be used. And here is also used localinstall local installation. If this package is not local, it is a package on the Internet, if you can’t check this package
If this package is not local, it is a package on the Internet. If this package cannot be checked, we will use it at this time—nogpgcheck does not do gpg checking.
Six, RPM installation
Some features are actually selected at compile time. If this feature is not selected at compile time, it will not be available
The version of the rpm package will lag behind the source package, or even a lot: bind -9.8.7, bind-9.7.2
Custom installation: manually compile and install
Compilation environment
Development library
Common compilation environment
C,C++
gcc:GNU c complier, C
g++ (compiler): C++
make: project management tool (this tool can make our multiple different project files into a project, and provide this configuration file through a configuration file called makefile)
makefile: defines the order in which make (gcc, g++) compiles the source programs in these source program files
Three steps to compile and install
Prerequisite: Prepare the development environment (compilation environment)
Install "Development Tools" and "Deve"
# tar
# cd
./configure
--help
--prefix=/path/to/somewhere [path to software installation]
--sysconfdir=/PATH/TO/CONFFILE_PATH
Function: 1. Let the user select the compilation feature: 2. Check the compilation environment
#make
#make install
If we download a software package on the server, the location of this software package is tengine-1.4.2.tar.gz under /pub/Sources/Tengine in ftp. We know this is a compressed file, so we need to expand File it, tar xf tengine-1.4.2.tar.gz and then we will view (because the picture is too big, so we cut a part), and then we use ./configure --prefix=/usr/local/tengine - conf-path=/etc/tengine. Use #make, then #make install, and finally #/usr/local/tengine/sbin/nginx, and you are done.
After completion, we will use the web to access the following