Modify a prepackaged image and Use YUM to install software
2011-02-07 20:41
537 查看
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
![](http://open.eucalyptus.com/themes/eucalyptus/img/backtotop.png)
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
![](http://open.eucalyptus.com/themes/eucalyptus/img/backtotop.png)
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
![](http://open.eucalyptus.com/themes/eucalyptus/img/backtotop.png)
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
![](http://open.eucalyptus.com/themes/eucalyptus/img/backtotop.png)
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
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
![](http://open.eucalyptus.com/themes/eucalyptus/img/backtotop.png)
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
![](http://open.eucalyptus.com/themes/eucalyptus/img/backtotop.png)
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
![](http://open.eucalyptus.com/themes/eucalyptus/img/backtotop.png)
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
![](http://open.eucalyptus.com/themes/eucalyptus/img/backtotop.png)
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
相关文章推荐
- How to build & install GLFW 3 and use it in a Linux project
- Install and configure Gnupg & Use Gnupg to encrypt file in PHP
- Why And When To Use Pre-Update and Pre-Insert Triggers In Oracle Forms
- [React] Use React.cloneElement to Modify and Add Additional Properties to React Children
- Xcode cannot find the software image to install this version
- How to Install and Use JRebel with WebLogic and Eclipse
- Install and set up Gitlab CI Runner to use Docker
- Redhat enterprise linux 5 install and configration(Yum change to CentOS)
- 软工测试3 Learn to install and use Junit, Hamcrest and Eclemma
- Use reflector to access and modify private parameter
- java - How to install and use db4o for Android? - Stack Overflow
- How To Install and Use Redis
- How To Use ADO.NET to Retrieve and Modify Records in an Excel Workbook With Visual Basic .NET(利用Ado.net导出到Excel)
- use YUM to install the Destop Environment
- RHEL6 use yum to install or update
- How to install VXDIAG Honda, Toyota and JLR SDD software
- How to create and use SDCard image for Android emulator
- Ubuntu 14.04安装PostgreSQL How To Install and Use PostgreSQL on Ubuntu 14.04
- SimpleCV install and "You need the python image library to save by filehandle"
- How to Install and Use Python Pip on Ubuntu 14.04 and pip install pytz