yum groupinstall 以及 groupremove用法

本文章內容:

yum groupinstall 以及 groupremove用法

 

問題

以前使用yum groupinstall指令安裝包組時沒問題,但CentOS 7不知道哪個版本開始就會顯示以下問題:

[root@localhost ~]# yum groupinstall "Development Tools"
Loaded plugins: fastestmirror, product-id, search-disabled-repos, subscription-manager

This system is not registered with an entitlement server. You can use subscription-manager to register.

There is no installed groups file.
Maybe run: yum groups mark convert (see man yum)
Loading mirror speeds from cached hostfile
 * base: ftp.tc.edu.tw
 * extras: ftp.tc.edu.tw
 * updates: ftp.tc.edu.tw
base                                                                                                                                   | 3.6 kB  00:00:00     
extras                                                                                                                                 | 2.9 kB  00:00:00     
updates                                                                                                                                | 2.9 kB  00:00:00     
Warning: Group development does not have any packages to install.
Maybe run: yum groups mark install (see man yum)
No packages in any requested group available to install or update

解決方案

方法一

1. 依照執行yum groupinstall "Development Tools"給的提示,執行yum groups mark install "Development Tools" 以安裝

[root@localhost ~]# yum groups mark install "Development Tools"
Loaded plugins: fastestmirror, product-id, search-disabled-repos, subscription-manager

This system is not registered with an entitlement server. You can use subscription-manager to register.

Loading mirror speeds from cached hostfile
 * base: ftp.tc.edu.tw
 * extras: ftp.tc.edu.tw
 * updates: ftp.tc.edu.tw
Marked install: Development Tools  #標記已安裝
[root@localhost ~]# yum grouplist
Loaded plugins: fastestmirror, product-id, search-disabled-repos, subscription-manager

This system is not registered with an entitlement server. You can use subscription-manager to register.

Loading mirror speeds from cached hostfile
 * base: ftp.tc.edu.tw
 * extras: ftp.tc.edu.tw
 * updates: ftp.tc.edu.tw
Available Environment Groups:
   Minimal Install
   Compute Node
   Infrastructure Server
   File and Print Server
   Basic Web Server
   Virtualization Host
   Server with GUI
   GNOME Desktop
   KDE Plasma Workspaces
   Development and Creative Workstation
Installed Groups:  #顯示已安裝
   Development Tools
Available Groups:
   Compatibility Libraries
   Console Internet Tools
   Graphical Administration Tools
   Legacy UNIX Compatibility
   Scientific Support
   Security Tools
   Smart Card Support
   System Administration Tools
   System Management
Done

2. 依照執行yum groupremove "Development Tools"給的提示,執行yum groups mark remove "Development Tools" 以移除

[root@localhost ~]# yum groups mark remove "Development Tools"
Loaded plugins: fastestmirror, product-id, search-disabled-repos, subscription-manager

This system is not registered with an entitlement server. You can use subscription-manager to register.

Loading mirror speeds from cached hostfile
 * base: ftp.tc.edu.tw
 * extras: ftp.tc.edu.tw
 * updates: ftp.tc.edu.tw
Marked remove: Development Tools  #標記已移除
[root@localhost ~]# yum grouplist
Loaded plugins: fastestmirror, product-id, search-disabled-repos, subscription-manager

This system is not registered with an entitlement server. You can use subscription-manager to register.

Loading mirror speeds from cached hostfile
 * base: ftp.tc.edu.tw
 * extras: ftp.tc.edu.tw
 * updates: ftp.tc.edu.tw
Available Environment Groups:
   Minimal Install
   Compute Node
   Infrastructure Server
   File and Print Server
   Basic Web Server
   Virtualization Host
   Server with GUI
   GNOME Desktop
   KDE Plasma Workspaces
   Development and Creative Workstation
Available Groups:
   Compatibility Libraries
   Console Internet Tools
   Development Tools  #未安裝
   Graphical Administration Tools
   Legacy UNIX Compatibility
   Scientific Support
   Security Tools
   Smart Card Support
   System Administration Tools
   System Management
Done

 

方法二

1.執行yum group info "Development Tools"

[root@client ~]# yum group info "Development Tools"
Loaded plugins: fastestmirror, product-id, search-disabled-repos, subscription-manager

This system is not registered with an entitlement server. You can use subscription-manager to register.

There is no installed groups file.
Maybe run: yum groups mark convert (see man yum)
Loading mirror speeds from cached hostfile
 * base: ftp.tc.edu.tw
 * extras: ftp.tc.edu.tw
 * updates: ftp.tc.edu.tw

Group: Development Tools
 Group-Id: development
 Description: A basic development environment.
 Mandatory Packages:
    autoconf
    automake
    binutils
    bison
    flex
    gcc
    gcc-c++
    gettext
    libtool
    make
    patch
    pkgconfig
    redhat-rpm-config
    rpm-build
    rpm-sign
 Default Packages:
    byacc
    cscope
    ctags
    diffstat
    doxygen
    elfutils
    gcc-gfortran
    git
    indent
    intltool
    patchutils
    rcs
    subversion
    swig
    systemtap
 Optional Packages:
   ElectricFence
   ant
   babel
   bzr
   chrpath
   cmake
   compat-gcc-44
   compat-gcc-44-c++
   cvs
   dejagnu
   expect
   gcc-gnat
   gcc-objc
   gcc-objc++
   imake
   javapackages-tools
   ksc
   mercurial
   mod_dav_svn
   nasm
   perltidy
   rpmdevtools
   rpmlint
   systemtap-sdt-devel
   systemtap-server

2. 執行yum groupinstall "Development Tools" --setopt=group_package_types=mandatory,default,optional 以安裝   #groupinstall可以寫成groups install

[root@localhost ~]# yum groupinstall "Development Tools" --setopt=group_package_types=mandatory,default,optional  #注意:mandatory,default,optional要小寫
[root@localhost ~]# yum grouplist
Loaded plugins: fastestmirror, product-id, search-disabled-repos, subscription-manager

This system is not registered with an entitlement server. You can use subscription-manager to register.

Loading mirror speeds from cached hostfile
 * base: ftp.tc.edu.tw
 * extras: ftp.tc.edu.tw
 * updates: ftp.tc.edu.tw
Available Environment Groups:
   Minimal Install
   Compute Node
   Infrastructure Server
   File and Print Server
   Basic Web Server
   Virtualization Host
   Server with GUI
   GNOME Desktop
   KDE Plasma Workspaces
   Development and Creative Workstation
Installed Groups:  #顯示已安裝
   Development Tools
Available Groups:
   Compatibility Libraries
   Console Internet Tools
   Graphical Administration Tools
   Legacy UNIX Compatibility
   Scientific Support
   Security Tools
   Smart Card Support
   System Administration Tools
   System Management
Done

3. 執行yum groupremove "Development Tools" 以移除  #groupremove可以寫成groups remove

[root@localhost ~]# yum groupremove "Development Tools"
[root@localhost ~]# yum grouplist
Loaded plugins: fastestmirror, product-id, search-disabled-repos, subscription-manager

This system is not registered with an entitlement server. You can use subscription-manager to register.

Loading mirror speeds from cached hostfile
 * base: ftp.tc.edu.tw
 * extras: ftp.tc.edu.tw
 * updates: ftp.tc.edu.tw
Available Environment Groups:
   Minimal Install
   Compute Node
   Infrastructure Server
   File and Print Server
   Basic Web Server
   Virtualization Host
   Server with GUI
   GNOME Desktop
   KDE Plasma Workspaces
   Development and Creative Workstation
Available Groups:
   Compatibility Libraries
   Console Internet Tools
   Development Tools  #未安裝
   Graphical Administration Tools
   Legacy UNIX Compatibility
   Scientific Support
   Security Tools
   Smart Card Support
   System Administration Tools
   System Management
Done