AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / unix / 问题 / 463019
Accepted
overexchange
overexchange
Asked: 2018-08-17 08:48:18 +0800 CST2018-08-17 08:48:18 +0800 CST 2018-08-17 08:48:18 +0800 CST

如何使用 yum 安装操作系统包?

  • 772

我需要安装以下软件包:

gcc:   gcc-c++-4.4.7-3.el6.x86_64
Flex:  flex-2.5.35-8.el6.x86_64
Bison: bison-2.4.1-5.el6.x86_64
Glib:  glib2-devel-2.22.5-7.el6.x86_64   &  glibc-devel-2.12-1.107.el6_4.2.x86_64
Pcre:  pcre-7.8-6.el6.x86_64  & pcre-devel-7.8-6.el6.x86_64
logrotate:  logrotate-3.7.8-16.el6.x86_64
sendmail:  sendmail-8.14.4-8.el6.x86_64 & sendmail-cf-8.14.4-8.el6.noarch

yum从下面的存储库中使用。


# yum repolist
Loaded plugins: package_upload, product-id, search-disabled-repos, subscription-manager
repo id                                                                                        repo name                                                                                       status
!RBC_RBC-Tools-RHEL7_rbc-tools-rhel-7Server-x86_64-rpms                                        rbc-tools-rhel-7Server-x86_64-rpms                                                                   9
!rhel-7-server-extras-rpms/x86_64                                                              Red Hat Enterprise Linux 7 Server - Extras (RPMs)                                                  747
!rhel-7-server-optional-rpms/7Server/x86_64                                                    Red Hat Enterprise Linux 7 Server - Optional (RPMs)                                             13,201
!rhel-7-server-rpms/7Server/x86_64                                                             Red Hat Enterprise Linux 7 Server (RPMs)                                                        18,022
!rhel-7-server-satellite-tools-6.1-rpms/x86_64                                                 Red Hat Satellite Tools 6.1 (for RHEL 7 Server) (RPMs)                                              86
!rhel-7-server-supplementary-rpms/7Server/x86_64                                               Red Hat Enterprise Linux 7 Server - Supplementary (RPMs)                                           270
repolist: 32,335

但是,我得到以下错误:

# yum install gcc-c++-4.4.7-3.el6.x86_64
Loaded plugins: package_upload, product-id, search-disabled-repos, subscription-manager
RBC_RBC-Tools-RHEL7_rbc-tools-rhel-7Server-x86_64-rpms                                                                                                                        | 1.8 kB  00:00:00
rhel-7-server-extras-rpms                                                                                                                                                     | 2.0 kB  00:00:00
rhel-7-server-optional-rpms                                                                                                                                                   | 2.0 kB  00:00:00
rhel-7-server-rpms                                                                                                                                                            | 2.0 kB  00:00:00
rhel-7-server-satellite-tools-6.1-rpms                                                                                                                                        | 2.1 kB  00:00:00
rhel-7-server-supplementary-rpms                                                                                                                                              | 2.3 kB  00:00:00
No package gcc-c++-4.4.7-3.el6.x86_64 available.
Error: Nothing to do

如何解决此错误?我需要添加更多存储库吗?如果是,如何?

rhel software-installation
  • 1 1 个回答
  • 895 Views

1 个回答

  • Voted
  1. Best Answer
    thebtm
    2018-08-17T09:01:32+08:002018-08-17T09:01:32+08:00

    如果您正在寻找安装 GCC,您需要做的就是yum install gcc-c++如果您可以访问它们,它将获取它的依赖项,否则它将出错。对于其余的包,只需在 <name>-<version number> 之前输入文本名称。yum install flex bison sendmail只需查看其他软件包是否作为依赖项安装,如果没有返回并使用yum install <name>.

    如果您需要更多帮助来理解yum,只需键入man yum以获取更多参考和详细信息yum。

    [root@server thebtm]# yum install gcc                                                                                                                                                                                                   
    Loaded plugins: fastestmirror, langpacks                                                                                                                                                                                                     
    Loading mirror speeds from cached hostfile                                                                                                                                                                                                   
     * base: mirror.its.sfu.ca                                                                                                                                                                                                                   
     * epel: muug.ca                                                                                                                                                                                                                             
     * extras: muug.ca                                                                                                                                                                                                                           
     * ius: mirrors.kernel.org                                                                                                                                                                                                                   
     * updates: mirror.its.sfu.ca
    Package gcc-4.8.5-28.el7_5.1.x86_64 already installed and latest version
    Nothing to do
    

    未安装时的示例:

    [root@fada2474faea iop]# yum install gcc-c++
    Loaded plugins: fastestmirror, ovl
    Loading mirror speeds from cached hostfile
    epel/x86_64/metalink                                                                                                                                                                                                  |  16 kB  00:00:00     
     * base: mirror.its.sfu.ca
     * epel: mirrors.cat.pdx.edu
     * extras: mirror.its.sfu.ca
     * ius: mirrors.kernel.org
     * updates: mirror.its.sfu.ca
    base                                                                                                                                                                                                                  | 3.6 kB  00:00:00     
    epel                                                                                                                                                                                                                  | 3.2 kB  00:00:00     
    extras                                                                                                                                                                                                                | 3.4 kB  00:00:00     
    ius                                                                                                                                                                                                                   | 2.3 kB  00:00:00     
    updates                                                                                                                                                                                                               | 3.4 kB  00:00:00     
    (1/2): epel/x86_64/updateinfo                                                                                                                                                                                         | 933 kB  00:00:00     
    (2/2): epel/x86_64/primary                                                                                                                                                                                            | 3.6 MB  00:00:00     
    epel                                                                                                                                                                                                                             12647/12647
    Resolving Dependencies
    --> Running transaction check
    ---> Package gcc-c++.x86_64 0:4.8.5-28.el7_5.1 will be installed
    --> Processing Dependency: libstdc++-devel = 4.8.5-28.el7_5.1 for package: gcc-c++-4.8.5-28.el7_5.1.x86_64
    --> Processing Dependency: gcc = 4.8.5-28.el7_5.1 for package: gcc-c++-4.8.5-28.el7_5.1.x86_64
    --> Processing Dependency: libmpfr.so.4()(64bit) for package: gcc-c++-4.8.5-28.el7_5.1.x86_64
    --> Processing Dependency: libmpc.so.3()(64bit) for package: gcc-c++-4.8.5-28.el7_5.1.x86_64
    --> Running transaction check
    ---> Package gcc.x86_64 0:4.8.5-28.el7_5.1 will be installed
    --> Processing Dependency: cpp = 4.8.5-28.el7_5.1 for package: gcc-4.8.5-28.el7_5.1.x86_64
    --> Processing Dependency: glibc-devel >= 2.2.90-12 for package: gcc-4.8.5-28.el7_5.1.x86_64
    ---> Package libmpc.x86_64 0:1.0.1-3.el7 will be installed
    ---> Package libstdc++-devel.x86_64 0:4.8.5-28.el7_5.1 will be installed
    ---> Package mpfr.x86_64 0:3.1.1-4.el7 will be installed
    --> Running transaction check
    ---> Package cpp.x86_64 0:4.8.5-28.el7_5.1 will be installed
    ---> Package glibc-devel.x86_64 0:2.17-222.el7 will be installed
    --> Processing Dependency: glibc-headers = 2.17-222.el7 for package: glibc-devel-2.17-222.el7.x86_64
    --> Processing Dependency: glibc-headers for package: glibc-devel-2.17-222.el7.x86_64
    --> Running transaction check
    ---> Package glibc-headers.x86_64 0:2.17-222.el7 will be installed
    --> Processing Dependency: kernel-headers >= 2.2.1 for package: glibc-headers-2.17-222.el7.x86_64
    --> Processing Dependency: kernel-headers for package: glibc-headers-2.17-222.el7.x86_64
    --> Running transaction check
    ---> Package kernel-headers.x86_64 0:3.10.0-862.11.6.el7 will be installed
    --> Finished Dependency Resolution
    
    Dependencies Resolved
    
    =============================================================================================================================================================================================================================================
     Package                                                     Arch                                               Version                                                            Repository                                           Size
    =============================================================================================================================================================================================================================================
    Installing:
     gcc-c++                                                     x86_64                                             4.8.5-28.el7_5.1                                                   updates                                             7.2 M
    Installing for dependencies:
     cpp                                                         x86_64                                             4.8.5-28.el7_5.1                                                   updates                                             5.9 M
     gcc                                                         x86_64                                             4.8.5-28.el7_5.1                                                   updates                                              16 M
     glibc-devel                                                 x86_64                                             2.17-222.el7                                                       base                                                1.1 M
     glibc-headers                                               x86_64                                             2.17-222.el7                                                       base                                                678 k
     kernel-headers                                              x86_64                                             3.10.0-862.11.6.el7                                                updates                                             7.1 M
     libmpc                                                      x86_64                                             1.0.1-3.el7                                                        base                                                 51 k
     libstdc++-devel                                             x86_64                                             4.8.5-28.el7_5.1                                                   updates                                             1.5 M
     mpfr                                                        x86_64                                             3.1.1-4.el7                                                        base                                                203 k
    
    Transaction Summary
    =============================================================================================================================================================================================================================================
    Install  1 Package (+8 Dependent packages)
    
    Total download size: 40 M
    Installed size: 84 M
    Is this ok [y/d/N]: n
    Exiting on user command
    Your transaction was saved, rerun it with:
     yum load-transaction /tmp/yum_save_tx.2018-08-16.23-11.GY0gCD.yumtx
    
    • 5

相关问题

  • linux redhat 7 ( 或 centos 7 ) + firewalld 屏蔽防火墙

  • systemctl 命令在 RHEL 6 中不起作用

  • 如何在 RHEL 7 上离线安装 docker?

  • 在 Debian 中编写 C#

  • 在 Gnome3 中禁用窗口的自动最大化

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    ssh 无法协商:“找不到匹配的密码”,正在拒绝 cbc

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    如何卸载内核模块“nvidia-drm”?

    • 13 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Wong Jia Hau ssh-add 返回:“连接代理时出错:没有这样的文件或目录” 2018-08-24 23:28:13 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST
  • Martin Hope
    Bagas Sanjaya 为什么 Linux 使用 LF 作为换行符? 2017-12-20 05:48:21 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve