最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

yum徹底卸載軟件包實(shí)現(xiàn)方式(包含依賴)

 更新時(shí)間:2025年10月29日 10:01:49   作者:mighty13  
文章介紹了如何使用yum命令安裝軟件包時(shí)自動(dòng)處理依賴關(guān)系,以及當(dāng)需要?jiǎng)h除這些依賴包時(shí),如何通過`yumhistory`命令查看和回滾安裝事務(wù)來實(shí)現(xiàn),具體步驟包括查看事務(wù)歷史、篩選事務(wù)、查看詳細(xì)信息以及回滾事務(wù)

概述

yum命令安裝軟件包時(shí)會(huì)自動(dòng)依賴包,但yum remove子命令只卸載該軟件包而不能卸載依賴。

如果需要?jiǎng)h除安裝時(shí)自動(dòng)安裝的依賴包,則可以使用yum history子命令回滾安裝事務(wù)以達(dá)到目的。

具體操作

查看yum操作(事務(wù))歷史

[root@localhost ~]# yum history list 或 yum history
Loading "fastestmirror" plugin
Config time: 0.007
Yum version: 3.4.3
ID     | Login user               | Date and time    | Action(s)      | Altered
-------------------------------------------------------------------------------
     3 | root <root>              | 2022-01-10 15:38 | Install        |   12 EE
     2 | root <root>              | 2022-01-10 10:38 | I, U           |    8   
     1 | System <unset>           | 2022-01-10 10:05 | Install        |  311   

查看某個(gè)事務(wù)詳細(xì)信息

歷史記錄當(dāng)中沒有直接列出事務(wù)的詳細(xì)信息,但是可根據(jù)時(shí)間和操作類型初步篩選事務(wù)。

然后通過 yum history info子命令查看事務(wù)的詳細(xì)信息。

例如這里查看ID為3的事務(wù)的詳細(xì)信息。

[root@localhost ~]# yum history info 3
Loaded plugins: fastestmirror
Transaction ID : 3
Begin time     : Mon Jan 10 15:38:41 2022
Begin rpmdb    : 318:0a512f196782814fe726bc61f44b5332aac74b38
End time       :            15:38:44 2022 (3 seconds)
End rpmdb      : 330:d9fb4e7bea655b40bcabffd6eb2a8a2f81110793
User           : root <root>
Return-Code    : Success
Command Line   : install zabbix-server-mysql zabbix-agent
Transaction performed with:
    Installed     rpm-4.11.3-32.el7.x86_64                      @anaconda
    Installed     yum-3.4.3-158.el7.centos.noarch               @anaconda
    Installed     yum-plugin-fastestmirror-1.1.31-45.el7.noarch @anaconda
Packages Altered:
    Dep-Install OpenIPMI-libs-2.0.23-2.el7.x86_64          @centos7
    Dep-Install OpenIPMI-modalias-2.0.23-2.el7.x86_64      @centos7
    Dep-Install fping-3.10-4.el7.x86_64                    @epel
    Dep-Install libevent-2.0.21-4.el7.x86_64               @centos7
    Dep-Install net-snmp-libs-1:5.7.2-32.el7.x86_64        @centos7
    Dep-Install traceroute-3:2.0.22-2.el7.x86_64           @centos7
    Dep-Install unixODBC-2.3.1-11.el7.x86_64               @centos7
    Dep-Install zabbix50-5.0.18-1.el7.x86_64               @epel
    Install     zabbix50-agent-5.0.18-1.el7.x86_64         @epel
    Dep-Install zabbix50-dbfiles-mysql-5.0.18-1.el7.noarch @epel
    Dep-Install zabbix50-server-5.0.18-1.el7.noarch        @epel
    Install     zabbix50-server-mysql-5.0.18-1.el7.x86_64  @epel
Scriptlet output:
   1 sed: can't read /etc/sysconfig/ipmi: No such file or directory
history info

回滾事務(wù)(刪除)

確定需要回滾的安裝事務(wù)后,使用yum history undo子命令實(shí)現(xiàn)回滾。

[root@localhost ~]# yum history undo 3
......
Removed:
  OpenIPMI-libs.x86_64 0:2.0.23-2.el7           OpenIPMI-modalias.x86_64 0:2.0.23-2.el7             fping.x86_64 0:3.10-4.el7              libevent.x86_64 0:2.0.21-4.el7               net-snmp-libs.x86_64 1:5.7.2-32.el7                 
  traceroute.x86_64 3:2.0.22-2.el7              unixODBC.x86_64 0:2.3.1-11.el7                      zabbix50.x86_64 0:5.0.18-1.el7         zabbix50-agent.x86_64 0:5.0.18-1.el7         zabbix50-dbfiles-mysql.noarch 0:5.0.18-1.el7        
  zabbix50-server.noarch 0:5.0.18-1.el7         zabbix50-server-mysql.x86_64 0:5.0.18-1.el7  

yum history子命令詳細(xì)幫助

[root@localhost ~]# man yum
......
      history
              The history command allows the user to view what has happened in past transactions (assuming the history_record config. option is set). You can use info/list/packages-list/packages-info/summary to view what happened,
              undo/redo/rollback to act on that information and new to start a new history file.

              The info/list/summary commands take either a transaction id or a package (with wildcards, as in Specifying package names), all three can also be passed no arguments. list can be passed the keyword "all" to  list  all
              the transactions.

              The info command can also take ranges of transaction ids, of the form start..end, which will then display a merged history as if all the transactions in the range had happened at once.
              Eg. "history info 1..4" will merge the first four transactions and display them as a single transaction.

              The packages-list/packages-info commands takes a package  (with wildcards, as in Specifying package names). And show data from the point of view of that package.

              The  undo/redo/rollback  commands  take  either a single transaction id or the keyword last and an offset from the last transaction (Eg. if you've done 250 transactions, "last" refers to transaction 250, and "last-4"
              refers to transaction 246).  The redo command can also take some optional arguments before you specify the transaction. "force-reinstall" tells it reinstall any packages that were installed in that  transaction  (via
              install, upgrade or downgrade).  "force-remove" tells it to forcibly remove any packages that were updated or downgraded.

              The  undo/redo  commands  act  on the specified transaction, undo'ing or repeating the work of that transaction. While the rollback command will undo all transactions up to the point of the specified transaction. For
              example, if you have 3 transactions, where package A; B and C where installed respectively.  Then "undo 1" will try to remove package A, "redo 1" will try to install package A (if it  is  not  still  installed),  and
              "rollback 1" will try to remove packages B and C. Note that after a "rollback 1" you will have a fourth transaction, although the ending rpmdb version (see: yum version) should be the same in transactions 1 and 4.

              The addon-info command takes a transaction ID, and the packages-list command takes a package (with wildcards).

              The stats command shows some statistics about the current history DB.

              The sync commands allows you to change the rpmdb/yumdb data stored for any installed packages, to whatever is in the current rpmdb/yumdb (this is mostly useful when this data was not stored when the package went into
              the history DB).

              In "history list" you can change the behaviour of the 2nd column via the configuration option history_list_view.

              In "history list" output the Altered column also gives some extra information if there was something not good with the transaction (this is also shown at the end of the package column in the packages-list command).

              > - The rpmdb was changed, outside yum, after the transaction.
              < - The rpmdb was changed, outside yum, before the transaction.
              * - The transaction aborted before completion.
              # - The transaction completed, but with a non-zero status.
              E - The transaction completed fine, but had warning/error output during the transaction.
              P - The transaction completed fine, but problems already existed in the rpmdb.
              s - The transaction completed fine, but --skip-broken was enabled and had to skip some packages.
[root@localhost ~]# yum history help
Loaded plugins: fastestmirror
Invalid history sub-command, use: list, info, summary, repeat, redo, undo, new, rollback, addon, addon-info, stats, statistics, sync, synchronizepkg, pkgs, pkg-list, pkgs-list, package, package-list, packages, packages-list, pkg-info, pkgs-info, package-info, packages-info.

總結(jié)

以上為個(gè)人經(jīng)驗(yàn),希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。

相關(guān)文章

  • linux寫shell需要注意的問題(必看)

    linux寫shell需要注意的問題(必看)

    下面小編就為大家?guī)硪黄猯inux寫shell需要注意的問題(必看)。小編覺得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧
    2016-12-12
  • CentOS-NAT模式下(DHCP)聯(lián)網(wǎng)成功案例

    CentOS-NAT模式下(DHCP)聯(lián)網(wǎng)成功案例

    這篇文章主要為大家詳細(xì)介紹了CentOS-NAT模式下(DHCP)聯(lián)網(wǎng)成功,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2017-11-11
  • 詳解Linux中搭建常用服務(wù)器

    詳解Linux中搭建常用服務(wù)器

    本篇文章主要介紹了Linux中搭建常用服務(wù)器,主要包括telnet、DHCP、DNS、sendmail、FTP、web、samba有興趣的可以了解一下。
    2016-12-12
  • Linux安裝VNC過程(Linux桌面版遠(yuǎn)程)

    Linux安裝VNC過程(Linux桌面版遠(yuǎn)程)

    文章介紹了在CentOS?7上安裝和配置VNC服務(wù)的方法,包括設(shè)置密碼、啟停服務(wù)、關(guān)閉端口以及設(shè)置開機(jī)自啟動(dòng),還提到了卸載GUI圖形界面的方法,以提高服務(wù)器性能
    2026-01-01
  • Vim編輯器常用的命令總結(jié)

    Vim編輯器常用的命令總結(jié)

    使用 Vim 的時(shí)間不長,但如今已經(jīng)離不開熟悉的 Vim 編輯模式了。 Vim 的學(xué)習(xí)曲線是非常陡的,一開始學(xué)習(xí)的時(shí)候,面對(duì)很多的操作命令要去記住,常常望而卻步。其實(shí),只要記住一些常用的命令,加之在工作中堅(jiān)持使用 Vim 進(jìn)行編輯,很快就能得心應(yīng)手了。下面來一起看看吧。
    2017-04-04
  • Linux nohup命令原理及實(shí)例解析

    Linux nohup命令原理及實(shí)例解析

    這篇文章主要介紹了Linux nohup命令原理及實(shí)例解析,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下
    2020-05-05
  • linux如何將環(huán)境文件或者文件夾打包

    linux如何將環(huán)境文件或者文件夾打包

    這篇文章主要介紹了linux如何將環(huán)境文件或者文件夾打包問題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2023-12-12
  • Linux系統(tǒng)CPU100%的處理步驟和方法

    Linux系統(tǒng)CPU100%的處理步驟和方法

    當(dāng) Linux 系統(tǒng)的 CPU 使用率達(dá)到 100% 時(shí),系統(tǒng)可能會(huì)變得卡頓,響應(yīng)速度減慢,甚至無法正常使用,這種情況通常由高負(fù)載的進(jìn)程、資源不足或潛在的系統(tǒng)問題引起,以下是處理 CPU 100% 的具體步驟和方法,需要的朋友可以參考下
    2025-11-11
  • apache rewrite規(guī)則實(shí)現(xiàn)白名單

    apache rewrite規(guī)則實(shí)現(xiàn)白名單

    今天弄了半天apache 的rewrite 規(guī)則,還是沒有配置出符合的規(guī)則。后一同事,研究了半個(gè)小時(shí)弄出來,很是慚愧。
    2014-06-06
  • 解決Ubuntu19 安裝Theano問題

    解決Ubuntu19 安裝Theano問題

    這篇文章主要介紹了解決Ubuntu19 安裝Theano出現(xiàn)"No module named ‘theano.compat.six’"問題,需要的朋友可以參考下
    2019-12-12

最新評(píng)論

黔南| 樟树市| 大田县| 育儿| 临沂市| 金塔县| 呼伦贝尔市| 吐鲁番市| 泰顺县| 浦北县| 博白县| 郁南县| 琼结县| 新乡县| 景德镇市| 墨竹工卡县| 高平市| 大同市| 万山特区| 九龙坡区| 钟祥市| 买车| 科技| 犍为县| 南丰县| 双柏县| 乐陵市| 高邮市| 大邑县| 汾阳市| 梧州市| 宝坻区| 商城县| 金塔县| 滦平县| 太康县| 绥阳县| 娄烦县| 辽宁省| 江源县| 兰溪市|