在centOS7中通过没有互联网的yum安装软件包

时间:2016-05-09 09:27:53

标签: wget yum centos7

我猜有两个相同的方法 方法1:CentOS DVD ISO YUM存储库

<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:file="http://www.mulesoft.org/schema/mule/file" xmlns:dw="http://www.mulesoft.org/schema/mule/ee/dw" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
    xmlns:spring="http://www.springframework.org/schema/beans" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd
http://www.mulesoft.org/schema/mule/ee/dw http://www.mulesoft.org/schema/mule/ee/dw/current/dw.xsd">

    <configuration doc:name="Configuration">
     <expression-language>
         <global-functions>
            def getCompanyName(Company){
                 if (flowVars.companyList contains Company) {
                    return "";
                 }  else {
                    flowVars.companyList.add(Company);
                    return Company;
                 }
            }
          </global-functions>
     </expression-language>
 </configuration>
    <file:connector name="File" autoDelete="true" streaming="true" validateConnections="true" doc:name="File"/>
    <file:connector name="File1" autoDelete="true" outputAppend="true" streaming="true" validateConnections="true" doc:name="File"/>
    <flow name="csvtocsvrecordemptyFlow">
        <file:inbound-endpoint path="src\test\resources\input" connector-ref="File" responseTimeout="10000" doc:name="File"/>
        <set-variable variableName="companyList" value="[[]]" doc:name="Variable"/>
        <dw:transform-message doc:name="Transform Message">
            <dw:set-payload><![CDATA[%dw 1.0
%output application/csv header=true
---
payload map {
    CompanyName: getCompanyName($.Company),
    name:$.FirstName
}]]></dw:set-payload>
        </dw:transform-message>

        <file:outbound-endpoint path="src\test\resources\output" outputPattern="test.csv" connector-ref="File1" responseTimeout="10000" doc:name="File"/>
    </flow>
</mule>

这不适合我。

我通过

使用了命令
step 1:Download/Transfer CentOS DVD ISO

但它下载一个html文件而不是iso文件

第二种方法是自定义yum存储库

2 个答案:

答案 0 :(得分:0)

也许这是因为你的命令中有空格?使用此

wget http://mirror.lihnidos.org/CentOS/7/isos/x86_64/CentOS-7-x86_64-DVD-1511.iso

哦,您可以以.RPM格式下载所需的软件包,然后使用此命令:

yum install MyPackage.rpm

确保按文件名称编辑“MyPackage”:)

答案 1 :(得分:0)

For better resolving dependencies, you better to install via yum just like yum localinstall MyPackage.rpm