Great God yum sources are in use

This article Original starting in Public Number: Programming three minutes

Use yum command

yum command with every day, almost rotten, but many people do not know why as long as networking, yum command can be like a magic wand in the hands of the same grandmother, arbitrary downloaded to think of the package.

For example, you want to put on a c ++ environment directly yum install gcc-c++.

Obsessive-compulsive disorder have done a thing like later confirm, you can use rpm -qa | grep 包名way to view.

If the equipment is not the desired version, yum list *gcc-c++*search it, the package can be installed on a bunch of names listed, to install equipment which version of which version.

Of course, can hold can be unloaded, a yum remove gcc-c++buttoned

What? You want to put on a docker, want to put on a go, I want to install a different version of python, so the United States wanted to loud noise it?

no problem! Even if you want to install always such a thing, yum can do, she is like an inclusive old mother always loved the naughty little boy, ok, as long as there is Mom, Mom has not managed to find from somewhere else . As long as the source is there, there is no source of more with a source on it.

yum source

Hey? Here comes the concept of a source, the source is simply a special storage warehouse pack, disaggregated put away, yum command is the warehouse steward, according to the configured rules, to find the source of the pile of packages the way you want to find this package dependence of other packages, the packages according to automatically install all dependencies. And a lower package dependencies as in FIG.

/etc/yum.repos.d/Directory is a special directory to store a variety of sources, source files to .repothe end of the suffix, habitual source of the same business into a file, such as Platform A, B platform can be divided into two files, you of course your site call the shots, like how to divide can be. The picture below is my source configured on the server.

Each repofile, you can configure multiple warehouses (source), each warehouse store different packages, as we have just installed gcc-c++in the oswarehouse, warehouse name is unique.

FIG excerpt from the cloud server Tencent CentOS-Base.repobrackets, the name of the source figure above is easy to obtain and identify yum, the following items are arranged to the brief explanation of the meaning of each configuration item.

enabled=1 This source expressed enabled, 0 is not enabled.

gpg(GNU Private Guard)A check algorithm for determining the rpm packet source is safe and effective, gpgkeyis the gpglocation of the key location.

baseurlIt is the source path.

nameThe name of the warehouse, for convenience only, generally useless.

By just installing and uninstalling, we clearly see gcc-c++in the os library, and because the library name is unique, so be sure it is CentOS-Base.repoin the os library, we now look set to disable him can not be installed.

Some people say, "I have a table Centosof the machine simply can not be networked with yumcommand dim, not one by one to the next online? To completely dependent on artificial solve the problem ah."

I can only say that the students, you sit down! Bear once said, as long as the ideology is not landslide, the method is better than more difficult. As long as a server can find the same os with the following command will be able to rpmpackage and to rely on his all downloaded to the local, and then copy the past installed.

yum install --downloadonly --downloaddir=/tmp/pzqu gcc-c++

--downloaddirSpecify the download directory

If --downloadonlyimpossible, you may be missing a plug-in yum install yum-plugin-downloadonlyinstalled on just fine.

postscript

If you want all cached warehouse, I can only say No kidding, how can we have a big hard drive, personal did not need to do so.

But to complete their own projects package can be a source of self, develop test deployment packages automatically when they are to the source, the offline environment which is just to take away the source, which would like to be able to deploy where deployed from here I seem to see the shadow of continuous integration.

Predict how funeral, please listen next time decomposition.

image.png

Guess you like

Origin www.cnblogs.com/pzqu/p/11669986.html