Modify a prepackaged image and Use YUM to install software
来源:互联网 发布:工业大数据 pdf 编辑:程序博客网 时间:2024/06/05 06:16
Modify a prepackaged image
Posted: Mon, 08/09/2010 - 05:26
Hi all,
I follow the instructions in the wiki about how to modify a prepackaged image to inall software.after
#mkdir temp-mnt
#losetup /dev/loop5 root.img
#unt /dev/loop5 temp-mnt
#chroot temp-mnt
I can not use yum or apt-get to install software. how can I use yum ro apt-get?
I need your help! Thank you!
cheers,
lisiyang
Login or register to post comments
tbednar (Offline)
try mounting proc
Posted: Mon, 08/09/2010 - 17:09
Hello,
Your chrooted environment is missing the proc file system. We will borrow that from the running host.
The image is very likely not configured for the correct name resolution, so we need to borrow /etc/resolv.conf
as well to be able to use literal IP addresses (domain names). To minimize changes to the image, you may try
to skip the resolv.conf first and see if you need it.
So ....
Just before executing the chroot command, you may wish to do the following:
mount -t proc /dev/proc temp-mnt/proc
cp /etc/resolve.conf temp-mnt/etc
You should be able to do networking etc. after you chroot. You may get some complaints from Perl about locale etc., which I choose to ignore ;-) (fixing those is another topic altogether).
I hope this helps.
A couple of voo-doo-ish tips (avoids weirdness):
1) to be safe, unmount the proc system after you exit from chroot and before unmounting the image itself. (umount /dev/proc)
2) type 'sync' at the command line before unmounting the image file (I had image file not to be updated after unmounting!)
3) when unmounting the image use 'unmount -d temp-mnt'. That will release the loopback device
cleanly and that device will be available the next time around ... otherwise you will need to change the device number every time
Tomas
Login or register to post comments
lisiyang (Offline)
No space left on device
Posted: Mon, 08/09/2010 - 23:40
hello,
thank you very much for your reply!
but i get a problem.
when i run
#mount -t proc /dev/proc temp-mnt/proc
#chroot temp-mnt
when i run ifconfig ,i can get the ip which is the same with the host machine.
but when i run yum update ,it says no space left on device
i think the file system has taken up the whole space .
Traceback (most recent call last):
File "/usr/bin/yum", line 29, in
yummain.user_main(sys.argv[1:], exit_code=True)
File "/usr/share/yum-cli/yummain.py", line 309, in user_main
errcode = main(args)
File "/usr/share/yum-cli/yummain.py", line 166, in main
base.doLock()
File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 1173, in doLock
while not self._lock(lockfile, mypid, 0644):
File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 1229, in _lock
os.write(fd, contents)
OSError: [Errno 28] No space left on device
Do you know how to resolve the problem? thank you!
cheers,
lisiyang
Login or register to post comments
lisiyang (Offline)
thank you very much ! i can
Posted: Tue, 08/10/2010 - 03:35
thank you very much !
i can usr yum to install software!
cheers,
lisiyang
Login or register to post comments
graziano (Offline)
Hello, thanks Tomas: I did
Posted: Fri, 08/27/2010 - 10:55
Hello,
thanks Tomas: I did integrate your comment into the wiki!
cheers
graziano
- Modify a prepackaged image and Use YUM to install software
- Creating a yum repository (repo) and Creating a yum group to install + kickstart
- How to use Git ,a magic software
- Use reflector to access and modify private parameter
- Modify 'make.conf' to improve ports download and install speed
- Xcode cannot find the software image to install this version
- How to install and use doxygen
- How to install and use selenium
- How To Install and Use Redis
- How To Install and Use Redis
- How to build & install GLFW 3 and use it in a Linux project
- Chinese version QQ—how to install it and use it to make a audio call and video call
- How to Install and Use JRebel with WebLogic and Eclipse
- Ubuntu install a software
- When and how to use a ThreadLocal
- How to Configure, Install and Use libnefilter_queue on Linux
- How to Configure, Install and Use libnefilter_queue on Linux
- How To Install and Use Memcache on Ubuntu 14.04
- RewriteRule-htaccess详细语法使用教程
- 开博了
- 飞鸽传书2007 目前可谓是盛行的时代
- PHP企业级应用缓存技术
- Ford-Fulkerson与Edmonds-Karp求解最大流
- Modify a prepackaged image and Use YUM to install software
- 例程 1602液晶操作
- NO.4 占位符
- oracle11g-----AWR报告介绍
- C++编译器的函数编译流程揭秘
- 大学生出去的说话技巧(转载)
- 我的注释等级
- 企业库Unit 报错
- Microsoft .Net Remoting系列专题之三:Remoting事件处理全接触