尝试“yum -y update”无法分配内存

tom*_*aul 5 centos yum centos-7

我使用的是 512MB RAM 的 VPS。尝试一下yum -y update,这就是我得到的:

[root@cs09-prod ~]# yum -y update
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirror.sesp.northwestern.edu
 * epel: mirror.steadfast.net
 * extras: linux.cc.lehigh.edu
 * updates: mirror.team-cymru.org
Resolving Dependencies
--> Running transaction check
---> Package epel-release.noarch 0:7-9 will be updated
---> Package epel-release.noarch 0:7-11 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package                Arch             Version           Repository      Size
================================================================================
Updating:
 epel-release           noarch           7-11              epel            15 k

Transaction Summary
================================================================================
Upgrade  1 Package

Total download size: 15 k
Downloading packages:
Failed to download prestodelta for repository epel: [Errno 5] [Errno 12] Cannot allocate memory


Error downloading packages:
  epel-release-7-11.noarch: [Errno 5] [Errno 12] Cannot allocate memory

[root@cs09-prod ~]#
Run Code Online (Sandbox Code Playgroud)

除了购买内存更大的 VPS 之外,还有什么办法可以解决这个问题吗?

Nas*_*ley 2

您的 VPS 没有足够的可用内存。您可以通过运行以下命令查看有多少:

free -gh
Run Code Online (Sandbox Code Playgroud)

g图显示了可用内存量(以 GB 为单位),并h以人类可读的格式显示。mh如果您想以兆字节为单位查看它,则可以使用。

为了yum工作,您需要停止服务以释放内存。您可以使用该命令查看哪些进程正在使用多少内存ps