linux 如何安装一个软件包

大家好我是渣渣辉今天我教大家怎么用Yum命令在Linux上安装一个软件包
首先我们向把 光盘挂载到一个空的文件夹

mount /dev/sr0 /mnt
mount: /mnt: WARNING: device write-protected, mounted read-only.

然后我们创立一个yum的仓库然后我们在仓库里面设置2个软件源让yum能去find那些附属软件因为在安装一些软件时要安装一些附属软件有了这个就很快了一下就安完了

cd /etc/yum.repos.d
[root@wzs yum.repos.d]# ll
total 4
-rw-r--r--. 1 root root 358 Nov  9 21:59 redhat.repo
[root@wzs yum.repos.d]# touch httpd.repo
[root@wzs yum.repos.d]# ll
total 4
-rw-r--r--. 1 root root   0 Nov 25 20:35 httpd.repo
-rw-r--r--. 1 root root 358 Nov  9 21:59 redhat.repo
[root@wzs yum.repos.d]# vim httpd.repo

```bash
[APPStream]
name=appstream
baseurl=file:///mnt/AppStream
gpgcheck=0

[baseos]
name=baseos
baseurl=file:///mnt/BaseOS
gpgcheck=0

``
然后就可以安装了

[root@wzs yum.repos.d]# yum install httpd 
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
appstream                                        41 MB/s | 5.8 MB     00:00
baseos                                           62 MB/s | 2.3 MB     00:00
Last metadata expiration check: 0:00:01 ago on Fri 25 Nov 2022 08:55:48 PM CST.
Dependencies resolved.
================================================================================
 Package          Arch   Version                                Repo       Size
================================================================================
Installing:
 httpd            x86_64 2.4.37-21.module+el8.2.0+5008+cca404a3 APPStream 1.4 M
Installing dependencies:
 apr              x86_64 1.6.3-9.el8                            APPStream 125 k
 apr-util         x86_64 1.6.1-6.el8                            APPStream 105 k
 httpd-filesystem noarch 2.4.37-21.module+el8.2.0+5008+cca404a3 APPStream  36 k
 httpd-tools      x86_64 2.4.37-21.module+el8.2.0+5008+cca404a3 APPStream 103 k
 mod_http2        x86_64 1.11.3-3.module+el8.2.0+4377+dc421495  APPStream 158 k
 redhat-logos-httpd
                  noarch 81.1-1.el8                             baseos     26 k
Installing weak dependencies:
 apr-util-bdb     x86_64 1.6.1-6.el8                            APPStream  25 k
 apr-util-openssl x86_64 1.6.1-6.el8                            APPStream  27 k
Enabling module streams:
 httpd                   2.4

Transaction Summary
================================================================================
Install  9 Packages

Total size: 2.0 M
Installed size: 5.5 M
Is this ok [y/N]: y
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                        1/1
  Installing       : apr-1.6.3-9.el8.x86_64                                 1/9
  Running scriptlet: apr-1.6.3-9.el8.x86_64                                 1/9
  Installing       : apr-util-bdb-1.6.1-6.el8.x86_64                        2/9
  Installing       : apr-util-openssl-1.6.1-6.el8.x86_64                    3/9
  Installing       : apr-util-1.6.1-6.el8.x86_64                            4/9
  Running scriptlet: apr-util-1.6.1-6.el8.x86_64                            4/9
  Installing       : httpd-tools-2.4.37-21.module+el8.2.0+5008+cca404a3.x   5/9
  Installing       : redhat-logos-httpd-81.1-1.el8.noarch                   6/9
  Running scriptlet: httpd-filesystem-2.4.37-21.module+el8.2.0+5008+cca40   7/9
  Installing       : httpd-filesystem-2.4.37-21.module+el8.2.0+5008+cca40   7/9
  Installing       : mod_http2-1.11.3-3.module+el8.2.0+4377+dc421495.x86_   8/9
  Installing       : httpd-2.4.37-21.module+el8.2.0+5008+cca404a3.x86_64    9/9
  Running scriptlet: httpd-2.4.37-21.module+el8.2.0+5008+cca404a3.x86_64    9/9
  Verifying        : apr-1.6.3-9.el8.x86_64                                 1/9
  Verifying        : apr-util-1.6.1-6.el8.x86_64                            2/9
  Verifying        : apr-util-bdb-1.6.1-6.el8.x86_64                        3/9
  Verifying        : apr-util-openssl-1.6.1-6.el8.x86_64                    4/9
  Verifying        : httpd-2.4.37-21.module+el8.2.0+5008+cca404a3.x86_64    5/9
  Verifying        : httpd-filesystem-2.4.37-21.module+el8.2.0+5008+cca40   6/9
  Verifying        : httpd-tools-2.4.37-21.module+el8.2.0+5008+cca404a3.x   7/9
  Verifying        : mod_http2-1.11.3-3.module+el8.2.0+4377+dc421495.x86_   8/9
  Verifying        : redhat-logos-httpd-81.1-1.el8.noarch                   9/9
Installed products updated.

Installed:
  apr-1.6.3-9.el8.x86_64
  apr-util-1.6.1-6.el8.x86_64
  apr-util-bdb-1.6.1-6.el8.x86_64
  apr-util-openssl-1.6.1-6.el8.x86_64
  httpd-2.4.37-21.module+el8.2.0+5008+cca404a3.x86_64
  httpd-filesystem-2.4.37-21.module+el8.2.0+5008+cca404a3.noarch
  httpd-tools-2.4.37-21.module+el8.2.0+5008+cca404a3.x86_64
  mod_http2-1.11.3-3.module+el8.2.0+4377+dc421495.x86_64
  redhat-logos-httpd-81.1-1.el8.noarch

Complete!

如果在 yum install httpd 后加-y 可以忽略 要确定的那步 刚才古天乐找我去沙城忘记打了

  • 3
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值