2017年1月11日, 星期三


yum安装的四种方式

一、默认:从国外下载

二、国内:从阿里获取  http://mirrors.aliyun.com

1. cd /etc/yum.repos.d
2. yum install wget -y
3.  
结果:
可以看到,yum安装所指向的baseurl由国外--http://mirror.centos.org,指向到了阿里--http://mirrors.aliyun.com
[root@node1 etc]# cd yum.repos.d
[root@node1 yum.repos.d]# vi CentOS-Base.repo
安装前
安装后
 

三、本地文件:从本地搭建一个源头(repository)

        mount    /dev/cdrom   /mnt   將驱动设备挂载到linux中

              file:///mnt 将获取资料的源头定义到了本地一个文件
baseurl=file:///mnt
gpgcheck=0

source /etc/profile 改好后,需要重新加载被修改的文件
yum clean all 清理本地缓存
yum makecache 开始将挂载的镜像中的数据包缓存到本地

四、本地服务:http://ip/

局域网yum源配置

这里用的是本地文件的方式

4.1、安装Nginx

略。。

4.2修改nginx.conf配置文件

vi  /usr/local/nginx/conf/nginx.conf

修改

Location 中

Root  /mnt

Autoindex on

4.3挂载到mnt

这里需要注意镜像需要大的iso文件4G的那个,注意开机前连接到这个4G镜像

cd /dev

mount   /dev/cdrom     /mnt

ls /mnt

umount /mnt

4.4、启动Nginx

Service nginx start

Chkconfig nginx on  设置开机启动

注意防火墙要关闭

Service iptables stop

Chkconfig iptables off

 

这时候在浏览器输入nginx所在node的节点的ip,可访问nginx , 查看是否挂载成功

4.5yum源配置文件

在其他node获得source源

Vi  /etc/yum.repos.d/CentOS-Base.repo

 

[base]

name=CentOS-local

baseurl=http://具体yum源服务器的ip地址

gpgcheck=0

Yum install man -y  拔掉网线测试,是否能够成功



yum命令的相关操作:
yum repolist
单个rpm包:
yum search   查看你配置的源中是否有你想安装的包
yum install 安装软件包
yum remove   删除软件包
组:
yum grouplist   显示分组
yum groupinfo         查询组内包含的软件包 组名用“”扩起(如: yum groupinfo "A" "B")
yum groupinstall   按组安装
yum groupremove   按组删除

Linux命令补充:

source /etc/profile   重新加载修改后的文件
yum clean all 清理本地缓存
yum makecache 将远程的数据包缓存到本地
clear 清理屏幕
history 查看历史输入的命令















@font-face{
font-family:"Times New Roman";
}

@font-face{
font-family:"宋体";
}

@font-face{
font-family:"Calibri";
}

@font-face{
font-family:"Calibri Light";
}

@list l0:level1{
mso-level-start-at:3;
mso-level-number-format:chinese-counting;
mso-level-suffix:none;
mso-level-text:"%1、";
mso-level-tab-stop:none;
mso-level-number-position:left;
margin-left:0.0000pt;
text-indent:0.0000pt;
font-family:'Times New Roman';}

@list l1:level1{
mso-level-start-at:2;
mso-level-number-format:chinese-counting;
mso-level-suffix:none;
mso-level-text:"%1、";
mso-level-tab-stop:none;
mso-level-number-position:left;
margin-left:0.0000pt;
text-indent:0.0000pt;
font-family:'Times New Roman';}

@list l2:level1{
mso-level-start-at:5;
mso-level-number-format:chinese-counting;
mso-level-suffix:none;
mso-level-text:"%1、";
mso-level-tab-stop:none;
mso-level-number-position:left;
margin-left:0.0000pt;
text-indent:0.0000pt;
font-family:'Times New Roman';}

p.MsoNormal{
mso-style-name:正文;
mso-style-parent:"";
margin:0pt;
margin-bottom:.0001pt;
mso-pagination:none;
text-align:justify;
text-justify:inter-ideograph;
font-family:Calibri;
mso-fareast-font-family:宋体;
mso-bidi-font-family:'Times New Roman';
font-size:10.5000pt;
mso-font-kerning:1.0000pt;
}

h1{
mso-style-name:"标题 1";
mso-style-next:正文;
margin-top:17.0000pt;
margin-bottom:16.5000pt;
page-break-after:avoid;
mso-pagination:lines-together;
text-align:justify;
text-justify:inter-ideograph;
mso-outline-level:1;
line-height:240%;
font-family:Calibri;
mso-fareast-font-family:宋体;
mso-bidi-font-family:'Times New Roman';
font-weight:bold;
font-size:22.0000pt;
mso-font-kerning:22.0000pt;
}

h2{
mso-style-name:"标题 2";
mso-style-noshow:yes;
mso-style-next:正文;
margin-top:13.0000pt;
margin-bottom:13.0000pt;
page-break-after:avoid;
mso-pagination:lines-together;
text-align:justify;
text-justify:inter-ideograph;
mso-outline-level:2;
line-height:173%;
font-family:'Calibri Light';
mso-fareast-font-family:宋体;
mso-bidi-font-family:'Times New Roman';
font-weight:bold;
font-size:16.0000pt;
mso-font-kerning:1.0000pt;
}

span.msoIns{
mso-style-type:export-only;
mso-style-name:"";
text-decoration:underline;
text-underline:single;
color:blue;
}

span.msoDel{
mso-style-type:export-only;
mso-style-name:"";
text-decoration:line-through;
color:red;
}
@page{mso-page-border-surround-header:no;
mso-page-border-surround-footer:no;}@page Section0{
margin-top:72.0000pt;
margin-bottom:72.0000pt;
margin-left:90.0000pt;
margin-right:90.0000pt;
size:595.3000pt 841.9000pt;
layout-grid:15.6000pt;
}
div.Section0{page:Section0;}

yum安装_yum命令的相关操作的更多相关文章

  1. CentOS7用yum安装wget命令后仍然提示命令找不到的解决方法

    需求:用的AWS实例自带的CentOS7用yum安装wget命令后扔提示命令找不到,后面用源码安装方式解决,下面先讲解决方法,疑问及知识点扩展最后写出 1.问题(因是mini版本系统,有些基本命令扔需 ...

  2. linux下安装mysql数据库与相关操作

    如下命令都是用root身份安装,或者在命令前加上sudo 采用yum安装方式安装 yum install mysql #安装mysql客户端 yum install mysql-server #安装m ...

  3. yum安装man命令程序错误

    第一次安装CentOS后,man命令无法使用,查了一下,发现没有安装man命令程序.尝试安装man yum install man 结果如下: Loaded plugins: fastestmirro ...

  4. Linux(CentOS7)yum安装卸载命令,离线下载安装包

    一.Linux版本 二.yum安装 比如安装vim编辑器,y是自动应答,即默认一路确认,不用中途确认 yum install -y vim 三.yum卸载 比如卸载掉刚刚安装的vim yum eras ...

  5. centos yum安装常用命令

    安装killall命令 yum install -y psmisc 安装sz(下载)和rz(上传)命令 yum install -y lrzsz 安装 ifconfig 命令 yum install ...

  6. linux常用命令---用户相关操作

    用户相关操作

  7. yum安装pip命令

    pip命令是python里的命令,类似于linux系统里的yum命令 我们只需要安装python-pip这个包即可. yum -y install  python-pip 在linux下还有一个命令: ...

  8. yum 安装fuser命令

    yum install -y psmisc 转自:https://www.cnblogs.com/saneri/p/5465718.html 有时候我们需要umount某个挂载目录时会遇到如下问题: ...

  9. Linux下使用yum安装软件命令

    1.yum list | grep 要下载的文件名字2.yum install 完整文件名字3.rpm -qa | grep 软件名字 //查看版本

随机推荐

  1. ThoughtWorks.QRCode类库

    ThoughtWorks.QRCode一个二维码生成类库.

  2. 微信小程序公共组件的引用与控制

    思路: 1.在组件wxml文件里实现布局.数据绑定.事件绑定: 2.组件js文件里定义事件,并将文件所有内容作为一个对象export出去:3.在引用的文件引入组件(方式有两种,一个是用include引 ...

  3. 6/7 sprint2 看板和燃尽图的更新

  4. Delphi 使用TAdoQuery执行存储过程的样例

    procedure TCustomerForm.FindCustomerInfo;var  strSql:string;begin //  BL_HV_FindCustomerInfo 存储过程的名称 ...

  5. lr几个常用的函数

    将字符串保存为参数 lr_save_string("string you want to save", "arg_name"); 将int型数字保存为参数 lr ...

  6. QT源码解析(七)Qt创建窗体的过程,作者“ tingsking18 ”(真正的创建QPushButton是在show()方法中,show()方法又调用了setVisible方法)

    前言:分析Qt的代码也有一段时间了,以前在进行QT源码解析的时候总是使用ue,一个函数名在QTDIR/src目录下反复的查找,然后分析函数之间的调用关系,效率实在是太低了,最近总结出一个更简便的方法, ...

  7. (转)关于ES6的 模块功能 Module 中export import的用法和注意之处

    关于ES6的 模块功能 Module 中export import的用法和注意之处 export default 的用法 export default命令用于指定模块的默认输出.显然,一个模块只能有一 ...

  8. 浏览器本地存储(browser-storage)

    https://www.baidufe.com/component/browser-storage/api.html 首页 | API参考 | 升级日志 BrowserStorage.api.set( ...

  9. P2325 [SCOI2005]王室联邦

    题目描述 “余”人国的国王想重新编制他的国家.他想把他的国家划分成若干个省,每个省都由他们王室联邦的一个成员来管理. 他的国家有n个城市,编号为1..n.一些城市之间有道路相连,任意两个不同的城市之间 ...

  10. 快速配置java环境变量

    右键单击计算机--->属性 点击 “高级系统设置”--->"环境变量",出现环境变量设置窗口 系统变量--->新建 JAVA_HOME变量,变量值填写jdk安装路 ...