Linux is not an easy to underestimate and accustomed to the installation of service mode!

Source: Internet
Author: User

Common situations :

Sometimes in some groups see some small partners to help download some packages, source packages, or RPM packages.

Perhaps they also know that Yum download installation, but sometimes due to the network slow, forced to rely on a large number of packages (may be automatically upgraded), bad management, may want to install the specified version rather than the latest version, so you will want to download the package before installation.


One case:

A friend, with Yum installed a tool, just this tool depends on some packages, after installation, then uninstall, directly with Yum Remove Package-y, along with a series of errors, because some services depend on the package is not (specifically, some Lib library), Here also give some advice: production environment do not arbitrarily unload things. The basics play well and then again.

#################################################################


It says that some small partners like the Yum tool, I'm a little verbose, for example (for CentOS and Redhat)!

Yum (Yeller)

Red Hat and CentOS are easy to install service tools that can be Such a good tool does not provide the ability to download only the features that are not installed.


Common Yum Commands:

Yum Install package (-y

Yum List package (Yum package listed)--easy to install a specific version of the package

Yum Clean all (clear cache)

Yum Makecache (Cache)

Manual can refer to man yum or Yum--help

Also mentioned above, may sometimes just want to download the package (directly installed can not be enough to define the dependent environment and package)

At this point, you can download only the package installation in some way.


The first way:

Yum install yum-downloadonly (recommended)

After the installation is complete, Yum has two more command parameters, namely:

--downloadonly don ' t update, just download

--DOWNLOADDIR=DLDIR specifies an alternate directory to store packages

Yum Install httpd--downloadonly--downloaddir=/root/yum

650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M00/8A/4A/wKioL1gtCdPQv_MsAABFTiUPf7w901.png-wh_500x0-wm_3 -wmp_4-s_3296778379.png "title=" Qq20161117093707.png "alt=" Wkiol1gtcdpqv_msaabftiupf7w901.png-wh_50 "/>

Second way: (also recommended)

Yum Install yum-utils-y (you will find some more commands in this case, including Yumdownloader)

650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M01/8A/4B/wKioL1gtDXrSO-s6AAAykBURqTE396.png-wh_500x0-wm_3 -wmp_4-s_211868755.png "title=" 1.png "alt=" Wkiol1gtdxrso-s6aaaykburqte396.png-wh_50 "/>

The default is in the directory of course.

650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M02/8A/4B/wKioL1gtDkDiOm_kAAEUQw7KGIk720.png-wh_500x0-wm_3 -wmp_4-s_1552095131.png "title=" 1.png "alt=" Wkiol1gtdkdiom_kaaeuqw7kgik720.png-wh_50 "/>

Specific parameters can be seen Yumdownloader--help


--downloadonly don ' t update, just download

--downloaddir=dldir

Specifies a alternate directory to store packages

The Third Way:

Vim/etc/yum.conf (at this time the Yum Master profile)

(Enable caching, you can also download the specified package, but not recommended, the process will be installed automatically, it may not be the original purpose, of course, if you want to install the package while retaining the package, it is also possible)

[Main]

cachedir=/var/cache/yum/$basearch/$releasever

Keepcache=0

650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M01/8A/4E/wKiom1gtDsfxnN6tAADAKke5a-g379.png-wh_500x0-wm_3 -wmp_4-s_498627162.png "title=" 1.png "alt=" Wkiom1gtdsfxnn6taadakke5a-g379.png-wh_50 "/>

Modify Keepcache=0 to Keepcache=1

#################################################################

With Linux for a few years I came down here to talk about this tool and share some experience. 650) this.width=650; "src=" Http://img.baidu.com/hi/jx2/j_0048.gif "alt=" J_0048.gif "/>

Common ways to install packages and pros and cons:

1. Yum

Advantages:

Easy to install, as long as your Yum source is strong enough to meet the basic package. Avoid the hassle of dependency relationships.

Disadvantages:

Need good network speed, install default path default, need to have a basic person to be familiar with, in addition to rely on the relationship needs to master, can not be hastily uninstalled, otherwise it may affect other programs.


In other words, when you enjoy the convenience it brings to you, you also have to understand the consequences. The flexibility and ease of management make the Yum installation way very popular.


2. Compile and install

Advantages:

Can install the specified version of the package, the path parameters are their own definition, in the Linux environment, only need to install its installation directory (as far as the dependent package can be manually deleted, basic dependency package GCC C + + can not uninstall, a lot of things must rely on these packages).

Disadvantages:

Complex installation, strong dependencies (Linux package compatibility is not good, and therefore requires experience to determine and try to install)


3, binary installation

Advantages: Fast installation, easy management, this is similar to the compilation installation (special binary installation of MySQL, really convenient)

Cons: Manual configuration is also required, not many packages have binary. Need to refer to some official website manual to configure, relatively strict. A certain amount of experience is required. Of course both the compiled and the binary installations can write scripts.


#################################################################


Above is just roughly based on my experience, talk about the three kinds of installation methods and advantages and disadvantages, if there are inappropriate, we can guide.

This article from "Ningzhiyuan 51CTO blog" blog, declined reprint!

Linux is not an easy to underestimate and accustomed to the installation of service mode!

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.