美文网首页
千万不要直接运行yum remove

千万不要直接运行yum remove

作者: TerryLaravel | 来源:发表于2020-06-08 11:30 被阅读0次

    在Linux下coding的小伙伴都知道,yum install是安装软件,对应的yum remove 是卸载软件,但是如果你对于yum remove 也回答yes的话,很可能会把系统搞崩溃的。
    比如:安装和卸载nginx
    使用yum install nginx 安装了nginx,
    这是如果直接使用yum remove nginx 的话,会把依赖的一些包也删掉,

    Dependencies resolved.
    ========================================================================================================================
     Package                            Architecture  Version                                       Repository         Size
    ========================================================================================================================
    Removing:
     nginx                              x86_64        1:1.14.1-9.module_el8.0.0+184+e34fea82        @AppStream        1.7 M
    Removing unused dependencies:
     gd                                 x86_64        2.2.5-6.el8                                   @AppStream        431 k
     jbigkit-libs                       x86_64        2.1-14.el8                                    @AppStream        107 k
     libXpm                             x86_64        3.5.12-7.el8                                  @AppStream        129 k
     libjpeg-turbo                      x86_64        1.5.3-10.el8                                  @AppStream        623 k
     libtiff                            x86_64        4.0.9-15.el8                                  @AppStream        619 k
     libwebp                            x86_64        1.0.0-1.el8                                   @AppStream        841 k
     libxslt                            x86_64        1.1.32-3.el8                                  @BaseOS           745 k
     nginx-all-modules                  noarch        1:1.14.1-9.module_el8.0.0+184+e34fea82        @AppStream          0  
     nginx-filesystem                   noarch        1:1.14.1-9.module_el8.0.0+184+e34fea82        @AppStream          0  
     nginx-mod-http-image-filter        x86_64        1:1.14.1-9.module_el8.0.0+184+e34fea82        @AppStream         29 k
     nginx-mod-http-perl                x86_64        1:1.14.1-9.module_el8.0.0+184+e34fea82        @AppStream         61 k
     nginx-mod-http-xslt-filter         x86_64        1:1.14.1-9.module_el8.0.0+184+e34fea82        @AppStream         25 k
     nginx-mod-mail                     x86_64        1:1.14.1-9.module_el8.0.0+184+e34fea82        @AppStream        113 k
     nginx-mod-stream                   x86_64        1:1.14.1-9.module_el8.0.0+184+e34fea82        @AppStream        171 k
    
    Transaction Summary
    ========================================================================================================================
    Remove  15 Packages
    
    Freed space: 5.5 M
    Is this ok [y/N]: n
    

    所以要使用rpm -e --nodeps nginx这个命令,就只删除nginx这个包,不会删除依赖包,

    rpm -e --nodeps nginx
    

    相关文章

      网友评论

          本文标题:千万不要直接运行yum remove

          本文链接:https://www.haomeiwen.com/subject/ufcazhtx.html