7.16 练习

1.插⼊优盘,读取优盘数据

1.`mount`命令来挂载U盘,

指定挂载文件,将/dev/sr1 挂载到 /mnt 下

[root@localhost ~]# mount -o ro /dev/sr1 /mnt/

或者:

[root@localhost ~]# echo "mount -o ro /dev/sr1 /mnt" >> /etc/rc.loca

2.`ls`命令来查看U盘的内容,

 [root@localhost ~]# ls /mnt/

3.`umount`命令来卸载U盘,

 [root@localhost ~]# umount  /mnt/

4.`eject`命令来拔出U盘

2.在vmware配置光盘iso⽂件,在linux系统中读取光盘⽂件

1. 创建挂载点mkdir /mnt/cdrom在 /mnt 目录下创建一个空文件夹cdrom作为光盘的挂载点(任何一个空目录都可以作为挂载点)

2. 打开光驱,放入光盘如果用的是VMware中的虚拟机,进入虚拟机设置,选择“CD/DVD”硬件,勾选“已连接”和“启动时连接”,在连接处,选择“使用ISO映像文件”,浏览选择本地电脑中下载好的ISO光盘镜像文件,点击确定

3.配置阿⾥云yum仓库

1.搜索阿⾥镜像源

2. 根据官⽅提示配置yum源

centos镜像_centos下载地址_centos安装教程-阿里巴巴开源镜像站

阿里巴巴开源镜像站为您提供免费的centos下载地址及centos安装教程,centos镜像简介:CentOS,是基于Red Hat Linux提供的可自由使用源代码的企业级Linux发行版本,是RHEL(Red Hat Enterprise Linux)源代码再编译的产物,是一个免费的企业级计算平台;CentOS 定期发行及更新版本,以便支持新的硬件,从而建立一个安全、低维护、稳定、高预测性、高重复性的Linux环境。阿里巴巴开源镜像站,持续同步CentOS、CentOC-altarch等最新版镜像文件,为用户提供极致的下载体验。阿里巴巴开源镜像站

https://developer.aliyun.com/mirror/centos

3.复制阿⾥云提供的url,下载⽂件

[root@localhost ~]# mv /etc/yum.repos.d/soft.repo /etc/yum.repos.d/soft.repo.bak

[root@localhost ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo

[root@localhost ~]# curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo

4.运⾏ yum makecache⽣成缓存 yum clear

[root@localhost ~]# yum makecache

5.查看源

[root@localhost yum.repos.d]# yum repolist all

# 清理缓存

[root@localhost ~]# yum clear all

# 创建缓存

[root@localhost ~]# yum makecache

4.配置清华镜像仓库

官网无CentOS7镜像

5.配置腾讯镜像仓库

[root@localhost ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.cloud.tencent.com/repo/centos7_base.repo

[root@localhost ~]# curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.cloud.tencent.com/repo/centos7_base.repo

4.运⾏ yum makecache⽣成缓存 yum clear

[root@localhost ~]# yum makecache

5.查看源

[root@localhost yum.repos.d]# yum repolist al

# 清理缓存

[root@localhost ~]# yum clear all

# 创建缓存

[root@localhost ~]# yum makecache

6.⾃建仓库 包含 tree net-tools bash-completion nginx tree等包

[root@localhost ~]# vim /etc/yum.conf

[main]

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

keepcache=1

debuglevel=2

logfile=/var/log/yum.log

exactarch=1

obsoletes=1

gpgcheck=1

plugins=1

installonly_limit=5

bugtracker_url=http://bugs.centos.org/set_project.php?project_id=23&ref=http://bugs.centos.org/bug_report_page.php?category=yum

distroverpkg=centos-release

[root@localhost ~]# yum -y install --downloadonly --downloaddir=./soft/ tree net-tools bash-completion nginx

[root@localhost ~]# yum -y install createrepo

[root@localhost ~]# createrepo soft/

[root@localhost ~]# vim /etc/yum.repos.d/soft.repo

[soft]

name=soft

baseurl=file:///root/soft/

gpgcheck=0

enable=1

[root@localhost ~]#  yum clean all

[root@localhost ~]#  yum makecache

[root@localhost ~]# yum -y install tree

已加载插件:fastestmirror

Loading mirror speeds from cached hostfile

正在解决依赖关系

--> 正在检查事务

---> 软件包 tree.x86_64.0.1.6.0-10.el7 将被 安装

--> 解决依赖关系完成

依赖关系解决

=================================================================================================================================

 Package                     架构                          版本                                  源                         大小

=================================================================================================================================

正在安装:

 tree                        x86_64                        1.6.0-10.el7                          os                         46 k

事务概要

=================================================================================================================================

安装  1 软件包

总下载量:46 k

安装大小:87 k

Downloading packages:

tree-1.6.0-10.el7.x86_64.rpm                                                                              |  46 kB  00:00:00  

Running transaction check

Running transaction test

Transaction test succeeded

Running transaction

  正在安装    : tree-1.6.0-10.el7.x86_64                                                                                     1/1

  验证中      : tree-1.6.0-10.el7.x86_64                                                                                     1/1

已安装:

  tree.x86_64 0:1.6.0-10.el7                                                                                                     

完毕!

[root@localhost ~]# yum -y install net-tools

已加载插件:fastestmirror

Loading mirror speeds from cached hostfile

正在解决依赖关系

--> 正在检查事务

---> 软件包 net-tools.x86_64.0.2.0-0.22.20131004git.el7 将被 升级

---> 软件包 net-tools.x86_64.0.2.0-0.25.20131004git.el7 将被 更新

--> 解决依赖关系完成

依赖关系解决

=================================================================================================================================

 Package                      架构                      版本                                         源                     大小

=================================================================================================================================

正在更新:

 net-tools                    x86_64                    2.0-0.25.20131004git.el7                     os                    306 k

事务概要

=================================================================================================================================

升级  1 软件包

总下载量:306 k

Downloading packages:

No Presto metadata available for os

net-tools-2.0-0.25.20131004git.el7.x86_64.rpm                                                             | 306 kB  00:00:00     

Running transaction check

Running transaction test

Transaction test succeeded

Running transaction

  正在更新    : net-tools-2.0-0.25.20131004git.el7.x86_64                                                           1/2

  清理        : net-tools-2.0-0.22.20131004git.el7.x86_64                                                              2/2

  验证中      : net-tools-2.0-0.25.20131004git.el7.x86_64                                                            1/2

  验证中      : net-tools-2.0-0.22.20131004git.el7.x86_64                                                            2/2

更新完毕:

  net-tools.x86_64 0:2.0-0.25.20131004git.el7                                                                                    

完毕!

[root@localhost ~]# yum -y install bash-completion

已加载插件:fastestmirror

Loading mirror speeds from cached hostfile

正在解决依赖关系

--> 正在检查事务

---> 软件包 bash-completion.noarch.1.2.1-6.el7 将被 升级

---> 软件包 bash-completion.noarch.1.2.1-8.el7 将被 更新

--> 解决依赖关系完成

依赖关系解决

=================================================================================================================================

 Package                              架构                        版本                             源                       大小

=================================================================================================================================

正在更新:

 bash-completion                      noarch                      1:2.1-8.el7                      os                       87 k

事务概要

=================================================================================================================================

升级  1 软件包

总下载量:87 k

Downloading packages:

No Presto metadata available for os

bash-completion-2.1-8.el7.noarch.rpm                                                                      |  87 kB  00:00:00     

Running transaction check

Running transaction test

Transaction test succeeded

Running transaction

  正在更新    : 1:bash-completion-2.1-8.el7.noarch                                                                      1/2

  清理        : 1:bash-completion-2.1-6.el7.noarch                                                                         2/2

  验证中      : 1:bash-completion-2.1-8.el7.noarch                                                                       1/2

  验证中      : 1:bash-completion-2.1-6.el7.noarch                                                                       2/2

更新完毕:

  bash-completion.noarch 1:2.1-8.el7                                                                                             

完毕!

[root@localhost ~]# yum -y install nginx

加载插件:fastestmirror

Loading mirror speeds from cached hostfile

正在解决依赖关系

--> 正在检查事务

---> 软件包 nginx.x86_64.1.1.26.1-2.el7.ngx 将被 安装

--> 解决依赖关系完成

依赖关系解系

=================================================================================================================================

 Package                    架构                        版本                                    源                          大小

=================================================================================================================================

正在安装:

 nginx                      x86_64                      1:1.26.1-2.el7.ngx                      nginx                      807 k

事务概要

=================================================================================================================================

安装  1 软件

总计:807 k

安装大小:2.8 M

Downloading packages:

Running transaction check

Running transaction test

Transaction test succeeded

Running transaction

  正在安装    : 1:nginx-1.26.1-2.el7.ngx.x86_64                                                                           1/1

----------------------------------------------------------------------

Thanks for using nginx!

Please find the official documentation for nginx here:

* https://nginx.org/en/docs/

Please subscribe to nginx-announce mailing list to get

the most important news about nginx:

* https://nginx.org/en/support.html

Colocalhostercial subscriptions for nginx are available on:

* https://nginx.com/products/

  • 9
    点赞
  • 18
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值