在Ubuntu服务器上安装软件包时出现内存不足问题 [英] out of memory issue in installing packages on Ubuntu server
问题描述
我使用的是有限的512MB RAM和20 GB硬盘的Ubuntu云服务器。它的450MB + RAM已被进程使用。
I am using a Ubuntu cloud server with limited 512MB RAM and 20 GB HDD. Its 450MB+ RAM is already used by processes.
我需要安装一个名为 lxml
的新程序包, Cpython
安装及其非常繁重的过程,因此它总是以错误退出gcc:内部编译器错误:Killed(程序cc1)
这是由于没有RAM可用于运行。
I need to install a new package called lxml
which gets complied using Cpython
while installation and its a very heavy process so it always exits with error gcc: internal compiler error: Killed (program cc1)
which is due to no RAM available for it to run.
升级机器是一个选择,但它有它自己的问题,很少有我的服务/网站从这个服务器本身。
Upgrading the machine is a choice but it has its own issues and few of my services/websites live from this server itself.
但是在我的本地机器上已经正确安装了 lxml
。由于我的需求仅仅是 lxml
,所以从本地机器的目录中选择所有有用的文件,然后复制到远程机器中是可能的?
But on my local machine lxml
is already installed properly. And since my need is lxml
only, so is it possible that pick all useful files from local machine's directory and copy then into remote machine?
它会以这种方式工作吗?如果是,如何提取包裹的所有文件?
Will it work that way? If yes, how to pick-up all files for a package?
问候
Regards
推荐答案
通过添加交换文件来扩展你的RAM:
http://www.cyberciti.biz/faq/linux-add-a-swap-file-howto/
Extend your RAM by adding a swap file: http://www.cyberciti.biz/faq/linux-add-a-swap-file-howto/
交换文件是存储在计算机硬盘驱动器上的文件,它使用
作为临时位置来存储目前不被计算机RAM使用的
的信息。通过使用交换文件,计算机具有
能够使用比物理安装在
中更多内存的能力计算机
http://www.computerhope.com/jargon/s/swapfile.htm
总之:
In Short:
- 以root身份登录:
su -
或执行前面带有sudo
的命令 -
dd if = / dev / zero of = / swapfile1 bs = 1024 count = 524288
-
mkswap / swapfile1
> -
chmod 0600 / swapfile1
li>
-
swapon / swapfile1
chown root:root / swapfile1
- Login as root:
su -
or execute the commands withsudo
in front dd if=/dev/zero of=/swapfile1 bs=1024 count=524288
mkswap /swapfile1
chown root:root /swapfile1
chmod 0600 /swapfile1
swapon /swapfile1
交换文件将被暂时激活,但在重启后会消失。
您应该有足够的RAM用于安装过程
Now the swap file will be activated temporarily, but will be gone after reboot. You should have enough RAM for your installing process
删除文件:
To Remove the File:
-
的swapoff -v / swapfile1
-
RM / swapfile1
swapoff -v /swapfile1
rm /swapfile1
这篇关于在Ubuntu服务器上安装软件包时出现内存不足问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!