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. js一些常用方法总结

    这两天开始在牛客网上做一些js在线编程,发现很多编程题其实调用的js方法都差不多一样,所以觉得可以汇总一下,方便记忆也可以多多熟悉. 1.slice()方法 这个方法就是可以从已有的数组中返回选定的元 ...

  2. 团队作业2 <嗨,你的快递!>需求分析与原型设计

    哦,不,是你的快速(*_*) 第一部分 需求分析 1.1 用户调研 1.1.1调研对象:由于我们的系统是校园快递代取业务,面向的是大学生活,所以本次调研范围都是在校大学生(除了师大学生,也包括了外校的 ...

  3. Windows Apache(ApacheHaus)安装配置教程

    1,Apache下载 选择一个版本,点击Download 点击File For Microsoft Windows 由于Apache HTTP Server官方不提供二进制(可执行)的发行版,所以我们 ...

  4. jmeter 多线程组间变量共享

    jmeter的线程组之间是相互独立的,各个线程组互不影响,所以线程组A中输出的参数,是无法直接在线程组B中被调用的. 但是有时为了方便管理,我们可能是把各个接口单独存放在不同的线程组中.拿Cookie ...

  5. vmware 已将该虚拟机配置为使用 64 位客户机操作系统。但是,无法执行 64 位操作。

    错误提示:已将该虚拟机配置为使用 64 位客户机操作系统.但是,无法执行 64 位操作. 此主机支持 Intel VT-x,但 Intel VT-x 处于禁用状态. 如果已在 BIOS/固件设置中禁用 ...

  6. spring 整合 Struts1.X [转]

    这篇博客摘自[http://blog.csdn.net/chendc201/article/details/8464008], 其中也有一些是自己增加的部分 . 第一步, 需要为 Struts 装载 ...

  7. POJ3281_Dining

    有一些饮料和食物,每种一个,每个客人喜欢一些饮料和一些食物,每个客人可以选择一种饮料和一种食物,问最多能够同时满足多少个客人同时拥有饮料和食物. 这样的,源点连接饮料,汇点连接食物,中间人分别连接饮料 ...

  8. In Place Algorithm

    本篇是in place algorithm的学习笔记.目前学习的是in place merge与in place martrix transposition这两个算法. 1.in place merg ...

  9. 【BZOJ1029】建筑抢修(贪心)

    [BZOJ1029]建筑抢修(贪心) 题面 BZOJ 洛谷 题解 感觉自己已经不会贪心了. 很明显的一个想法是按照终止时间排序,然后能选则选. 但是这样子可能会因为前面选择了一个修理时间很长的,导致现 ...

  10. 51nod 1494 选举拉票 | 线段树

    51nod1494 选举拉票 题面 现在你要竞选一个县的县长.你去对每一个选民进行了调查.你已经知道每一个人要选的人是谁,以及要花多少钱才能让这个人选你.现在你想要花最少的钱使得你当上县长.你当选的条 ...