千萬不要直接運行yum remove

在Linux下coding的小伙伴都知道,yum install是安裝軟件,對應的yum remove 是卸載軟件,但是如果你對于yum remove 也回答yes的話,很可能會把系統(tǒng)搞崩潰的。
比如:安裝和卸載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
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

友情鏈接更多精彩內(nèi)容