Centos

VPS yum 更新文件系統…殺死

  • March 6, 2022

我有一個 HostGator 1 級 VPS - 基本上是一個 CentOS 5。我有完全的 root 訪問權限來執行我想要的任何東西。

無論如何,在最近的維護檢查中,我執行yum -y update了 ,但是在通常的 Yum 消息之後,它在“執行事務測試”之後失敗並顯示消息“已殺死”。

這裡的人說,問題是特定於一個包的,所以我開始自己更新每個包(yum install packagename)。這幫助我確定了主要問題;導致問題的是包“文件系統”。

這是一個完整的 CLI 轉儲:

[root@cov ~]# yum -v update filesystem
Loading "fastestmirror" plugin
Config time: 0.109
Yum Version: 3.2.22
Setting up Package Sacks
Loading mirror speeds from cached hostfile
* base: mirror.nexcess.net
* epel: mirror.utexas.edu
* extras: mirrors.adams.net
* ius: pancks.sothatswhy.org.uk
* rpmforge: fr2.rpmfind.net
* updates: mirror.raystedman.net
pkgsack time: 0.077
rpmdb time: 0.000
Setting up Update Process
Building updates object
up:Obs Init time: 0.629
up:simple updates time: 0.170
up:obs time: 0.006
up:condense time: 0.000
updates time: 3.142
Resolving Dependencies
There are unfinished transactions remaining. You might consider running yum-complete-transaction first to finish them.
--> Running transaction check
Checking deps for filesystem.x86_64 0-2.4.0-3.el5 - None
---> Package filesystem.x86_64 0:2.4.0-3.el5.centos set to be updated
Checking deps for filesystem.x86_64 0-2.4.0-3.el5.centos - u
--> Finished Dependency Resolution
Dependency Process ending
Depsolve time: 0.650

Dependencies Resolved

==========================================================================
Package          Arch          Version               Repository   Size
==========================================================================
Updating:
filesystem      x86_64         2.4.0-3.el5.centos    updates      1.0 M

Transaction Summary
==========================================================================
Install       0 Package(s)
Upgrade       1 Package(s)

Total size: 1.0 M
Is this ok [y/N]: y
Downloading Packages:
using local copy of filesystem-2.4.0-3.el5.centos.x86_64
Running rpm_check_debug
Member: filesystem.x86_64 0-2.4.0-3.el5.centos - u
Adding Package filesystem-2.4.0-3.el5.centos.x86_64 in mode u
Member: filesystem.x86_64 0-2.4.0-3.el5 - None
rpm_check_debug time: 0.213
Running Transaction Test
Member: filesystem.x86_64 0-2.4.0-3.el5.centos - u
Adding Package filesystem-2.4.0-3.el5.centos.x86_64 in mode u
Member: filesystem.x86_64 0-2.4.0-3.el5 - None
Killed
[root@cov ~]#

注意: yum-complete-transaction根本沒有幫助。

**編輯1:**正如@BMDMan 建議的那樣:

[root@cov ~]# wget ftp://ftp.muug.mb.ca/mirror/centos/5.6/updates/x86_64/RPMS/filesystem-2.4.0-3.el5.centos.x86_64.rpm
--2011-05-16 18:00:40--  ftp://ftp.muug.mb.ca/mirror/centos/5.6/updates/x86_64/RPMS/filesystem-2.4.0-3.el5.centos.x86_64.rpm
          => `filesystem-2.4.0-3.el5.centos.x86_64.rpm'
Resolving ftp.muug.mb.ca... 130.179.31.46
Connecting to ftp.muug.mb.ca|130.179.31.46|:21... connected.
Logging in as anonymous ... Logged in!
==> SYST ... done.    ==> PWD ... done.
==> TYPE I ... done.  ==> CWD /mirror/centos/5.6/updates/x86_64/RPMS ... done.
==> SIZE filesystem-2.4.0-3.el5.centos.x86_64.rpm ... 1038514
==> PASV ... done.    ==> RETR filesystem-2.4.0-3.el5.centos.x86_64.rpm ... done.
Length: 1038514 (1014K)

100%[============================================================>] 1,038,514   58.2K/s   in 82s

2011-05-16 18:02:03 (12.4 KB/s) - `filesystem-2.4.0-3.el5.centos.x86_64.rpm' saved [1038514]

[root@cov ~]# rpm -Uvh filesystem-2.4.0-3.el5.centos.x86_64.rpm
Preparing...                Killed

**編輯 2:**我htop在嘗試更新時一直在監視交換、cpu 和記憶體,每個儀表都飛到了最大、最大記憶體、最大 cpu 和最大交換。這正常嗎?另外,我的記憶體目前是 384mb,是不是 RPM 不喜歡這麼低?

**編輯 3:**我有一個想法,我停用了很多 Web 服務(郵件、http、mysql 和保管箱守護程序)並再次嘗試了 RPM。這次它沒有被殺死(還沒有?),但它似乎被卡住如下:

[root@cov ~]# rpm -Uvh filesystem-2.4.0-3.el5.centos.x86_64.rpm
Preparing...                ########################################### [100%]
  1:filesystem             ########################################### [100%]

**編輯 4:**嗯,它似乎卡住了,在 30 分鐘內沒有讓步。

問題確實與記憶體有關。

我已經說服 HostGator 在他們自己表演時暫時增加記憶體yum update,現在它已經修復了。

臨時創建一個Linux交換文件,1GB足夠“yum update -y” https://linuxize.com/post/create-a-linux-swap-file/

引用自:https://serverfault.com/questions/270369