linux 安装rpm包时遇到error:Failed dependencies解法方法

环境:Centos 7.2 + MySQL-server-5.5.31-2.el6.i686.rpm

遇到的问题:

[root@sh158-xen data]#rpm -ivh MySQL-server-5.5.31-2.el6.i686.rpm

error: Failed dependencies:


        libaio.so.1 is needed by MySQL-server-5.5.31-2.el6.i686
        libaio.so.1(LIBAIO_0.1) is needed by MySQL-server-5.5.31-2.el6.i686
        libaio.so.1(LIBAIO_0.4) is needed by MySQL-server-5.5.31-2.el6.i686

 

纠结了半天,终于找到了解决方法:(感谢提供相关文章的博友)

在安装包后面加两个参数,如

[root@VM_55_2_centos mysql]#  rpm -ivh MySQL-server-5.5.31-2.el6.i686.rpm --nodeps --force
Preparing...                ########################################### [100%]
   1:MySQL-server           ########################################### [100%]

 

加上那两个参数的意义就在于,
安装时不再分析包之间的依赖关系而直接安装,
也就不会再提示error: Failed dependencies:这样的错误了

已标记关键词 清除标记
LoginForm.jsp ``` <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="UTF-8"%> <%@ taglib prefix="s" uri="/struts-tags" %> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta content="Content-Type" content="text/html; charset=utf-8"> <title><s:text name="loginPage" /></title> </head> <body> <s:form action="login" method="post"> <s:textfield name="username" key="user"/> <s:textfield name="password" key="pass"/> <s:submit key="login"/> </s:form> <!-- 使用Struts2标签输出tip实例变量值 --> <font color="red"><s:fielderror/></font> </body> </html> ``` LoginAction.java ``` package com.test; import com.opensymphony.xwork2.ActionContext; import com.opensymphony.xwork2.ActionSupport; public class LoginAction extends ActionSupport { // 定义封装请求参数的username和password成员变量 private String username; private String password; public String getUsername() { return this.username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return this.password; } public void setPassword(String password) { this.password = password; } @Override public String execute() throws Exception { if (getUsername().equalsIgnoreCase("user")) { throw new MyException("自定义异常"); } if (getUsername().equalsIgnoreCase("sql")) { throw new java.sql.SQLException("用户名不能为SQL"); } if (getUsername().equals("2012") && getPassword().equals("123")) { addActionMessage("哈哈, 服务器提示!"); return SUCCESS; } return ERROR; } } ``` struts.xml ``` <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN" "http://struts.apache.org/dtds/struts-2.3.dtd"> <struts> <constant name="struts.custom.i18n.resources" value="mess" /> <!-- <constant name="struts.enable.DynamicMethodInvocation" value="false" />--> <!-- <constant name="struts.devMode" value="true" />--> <package name="test" namespace="/0" extends="struts-default"> <global-results> <result name="sql">/WEB-INF/exception.jsp</result> <result name="root">/WEB-INF/exception.jsp</result> </global-results> <global-exception-mappings> <exception-mapping result="sql" exception="java.sql.SQLException"/> <exception-mapping result="root" exception="java.lang.Exception"/> </global-exception-mappings> <action name="login" class="com.test.LoginAction"> <exception-mapping result="my" exception="com.test.MyException"/> <!-- 定义三个逻辑视图和物理资源之间的映射 --> <result name="my">/WEB-INF/exception.jsp</result> <result name="error">/WEB-INF/error.jsp</result> <result name="success">/WEB-INF/welcome.jsp</result> </action> <action name="*"> <result>/WEB-INF/{1}.jsp</result> </action> </package> </struts> ``` exception.jsp ``` <%@ page language="java" contentType="text/html; charset=utf-8"%> <%@ taglib prefix="s" uri="/struts-tags" %> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>异常处理页面</title> </head> <body> 异常信息: <s:property value="exception.message"/> </body> </html> ``` ![图片说明](https://img-ask.csdn.net/upload/201504/12/1428852596_753164.jpg) ![图片说明](https://img-ask.csdn.net/upload/201504/12/1428852614_623339.jpg) 应显示“自定义异常”,但却是No result defined ========================================== 大家帮我看看
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页