Coder Social home page Coder Social logo

dozzie / yumbootstrap Goto Github PK

View Code? Open in Web Editor NEW
118.0 7.0 45.0 138 KB

Linux chroot installer for Yum-based distributions

Home Page: http://dozzie.jarowit.net/trac/wiki/yumbootstrap

License: GNU General Public License v3.0

Python 92.28% Shell 0.21% Makefile 3.17% Roff 4.33%

yumbootstrap's Introduction

yumbootstrap

yumbootstrap is a tool for installing Yum-based distributions (Red Hat, CentOS, Fedora) in a chroot directory. Idea behind it is stolen from Debian's debootstrap. It's planned for yumbootstrap to work along with templates for lxc-create.

There is another project of similar purpose called Rinse. yumbootstrap differs from Rinse as follows:

  • yumbootstrap uses Yum to resolve dependencies, so adding packages to installation list is easier (no need to track dependencies manually).
  • Using multiple Yum repositories for installation is supported.
  • yumbootstrap checks signatures on installed RPM packages.
  • yumbootstrap doesn't depend on Yum mirror to list directory contents, so it's less work to setup local mirror usable with yumbootstrap.

Examples of use

Listing available suites:

# /usr/sbin/yumbootstrap --list-suites
centos-5
centos-6
...
fedora-19
fedora-20

Installing centos-6 suite to /mnt/chroot/centos-6-chroot:

# /usr/sbin/yumbootstrap --verbose centos-6 /mnt/chroot/centos-6-chroot

Installing centos-6 suite, including some custom packages:

# /usr/sbin/yumbootstrap --verbose \
    --include=openssh-server --group=Core \
    centos-6 /mnt/chroot/centos-6-chroot

Installing centos-6 suite, installing custom packages by hand from parent OS:

# CHROOT=/mnt/chroot/centos-6-chroot
# /usr/sbin/yumbootstrap --verbose --no-scripts centos-6 $CHROOT
# yum --installroot=$CHROOT -c $CHROOT/yumbootstrap/yum.conf install ...
# /usr/sbin/yumbootstrap --verbose --just-scripts $CHROOT

Installing yumbootstrap

For Debian-based distributions, dpkg-dev, fakeroot, debhelper (9+), python, and python-setuptools. For installing the package, yum is also required.

dpkg-buildpackage -b -uc
dpkg -i ../yumbootstrap*.deb

For Red Hat derivatives you need rpm-build.

make srpm
rpmbuild --rebuild yumbootstrap-*.src.rpm
yum localinstall --nogpgcheck /usr/src/redhat/RPMS/*/yumbootstrap-*.rpm

Contact and License

yumbootstrap is written by Stanislaw Klekot . The primary distribution point is http://dozzie.jarowit.net/.

yumbootstrap is distributed under GNU GPL v3 license. See LICENSE file for details.

yumbootstrap's People

Contributors

dozzie avatar earlchew avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

yumbootstrap's Issues

bootstrap centos-7 fails with an error:

yumbootstrap centos-7 ./centos7
After all packages installed I'm getting this error and after that yum and rpm are broken
...

Complete!
error: Failed to initialize NSS library
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib64/python2.7/site-packages/rpm/init.py", line 10, in
from rpm.transaction import *
File "/usr/lib64/python2.7/site-packages/rpm/transaction.py", line 5, in
from rpm._rpm import ts as TransactionSetCore
ImportError: cannot import name ts
Traceback (most recent call last):
File "/etc/yumbootstrap/suites/scripts/fix_rpmdb.py", line 27, in
yum.fix_rpmdb()
File "/usr/lib/pymodules/python2.7/yumbootstrap/yum.py", line 157, in fix_rpmdb
env = self.yum_conf.env,
File "/usr/lib/pymodules/python2.7/yumbootstrap/sh.py", line 90, in run
check_error(command[0], proc.returncode)
File "/usr/lib/pymodules/python2.7/yumbootstrap/sh.py", line 16, in check_error
raise YBError('"%s" exited with code %d', cmd, code, exit = 1)
yumbootstrap.exceptions.YBError: "python" exited with code 1

Here is RH7 issue which looks exactly the same https://access.redhat.com/solutions/3134931

Failed to mount /sysroot centos7

Let me explain my scenario in detail below are commands and script I have used to create a centos-7 image using yumbootstrap .Here is procedure how I bootstrap centos-7 on an ubuntu 14.04 and create a qcow2 image to run in kvm .

sudo mkdir -p /tmp/centos
/usr/sbin/yumbootstrap --verbose centos-7 /tmp/centos
sudo mount proc /tmp/centos/proc -t proc
sudo mount sysfs /tmp/centos/sys -t sysfs
Installation scripts installing yum packages , configurations etc
create-users
sudo bash -c 'tar cf - . | sudo pigz > /tmp/centos.tar.gz'
cp ~/centos.dcso.tar.gz /tmp
./define-domain.sh centos 1024 1 # it is a script which will create centos.xml file for domain defination
sudo qemu-img create -f raw /tmp/centos 30G
sudo mkfs.ext3 -F /tmp/centos
sudo mount -o loop /tmp/centos /mnt
sudo tar -C /mnt -zxf /tmp/centos.dcso.tar.gz
sudo umount /mnt
sudo qemu-img convert -O qcow2 /tmp/centos /var/lib/libvirt/images/centos.qcow2
virsh start centos

FYI I am not installing grub in the image and trying direct kernel boot method to run kvm instance as

<os>
<type arch='x86_64' machine='pc-i440fx-1.4'>hvm</type>
<kernel>/boot/vmlinuz_redhat</kernel>
<initrd>/boot/initramfs_redhat.img</initrd>
<cmdline>root=/dev/vda</cmdline>
</os>

After all this when I have started vm I am getting this issue which is strange to me
2error

Installation of centos-7: fails with "ERROR You need to update rpm to handle: [..]".

sudo /usr/sbin/yumbootstrap centos-7 /var/tmp/centos-7-root
[..]
Running transaction check
ERROR You need to update rpm to handle:
rpmlib(BuiltinLuaScripts) <= 4.2.2-1 is needed by bash-4.2.46-12.el7.x86_64
rpmlib(BuiltinLuaScripts) <= 4.2.2-1 is needed by setup-2.8.71-5.el7.noarch
rpmlib(FileCaps) <= 4.6.1-1 is needed by iputils-20121221-6.el7.x86_64
rpmlib(BuiltinLuaScripts) <= 4.2.2-1 is needed by glibc-common-2.17-78.el7.x86_64
rpmlib(BuiltinLuaScripts) <= 4.2.2-1 is needed by filesystem-3.2-18.el7.x86_64
rpmlib(BuiltinLuaScripts) <= 4.2.2-1 is needed by glibc-2.17-78.el7.x86_64
rpmlib(BuiltinLuaScripts) <= 4.2.2-1 is needed by libgcc-4.8.3-9.el7.x86_64
rpmlib(BuiltinLuaScripts) <= 4.2.2-1 is needed by systemd-208-20.el7_1.3.x86_64
rpmlib(FileCaps) <= 4.6.1-1 is needed by systemd-208-20.el7_1.3.x86_64
RPM needs to be updated
 You could try running: rpm -Va --nofiles --nodigest
Your transaction was saved, rerun it with:
 yum load-transaction /tmp/yum_save_tx.2015-05-16.02-16.f3hzPv.yumtx
"/usr/bin/yum" exited with code 1

Similar output for fedora-19:

# sudo /usr/sbin/yumbootstrap fedora-19 /var/tmp/fedora-19
[..]
Running transaction check
ERROR You need to update rpm to handle:
rpmlib(FileCaps) <= 4.6.1-1 is needed by iputils-20121221-2.fc19.x86_64
rpmlib(BuiltinLuaScripts) <= 4.2.2-1 is needed by filesystem-3.2-13.fc19.x86_64
rpmlib(BuiltinLuaScripts) <= 4.2.2-1 is needed by glibc-2.17-21.fc19.x86_64
rpmlib(BuiltinLuaScripts) <= 4.2.2-1 is needed by systemd-204-21.fc19.x86_64
rpmlib(FileCaps) <= 4.6.1-1 is needed by systemd-204-21.fc19.x86_64
rpmlib(BuiltinLuaScripts) <= 4.2.2-1 is needed by setup-2.8.71-1.fc19.noarch
rpmlib(BuiltinLuaScripts) <= 4.2.2-1 is needed by bash-4.2.53-1.fc19.x86_64
rpmlib(BuiltinLuaScripts) <= 4.2.2-1 is needed by libgcc-4.8.3-7.fc19.x86_64
rpmlib(BuiltinLuaScripts) <= 4.2.2-1 is needed by glibc-common-2.17-21.fc19.x86_64
RPM needs to be updated
 You could try running: rpm -Va --nofiles --nodigest
Your transaction was saved, rerun it with:
 yum load-transaction /tmp/yum_save_tx.2015-05-16.02-32.w0wvUO.yumtx
"/usr/bin/yum" exited with code 1

My host rpm is at version 4.12.0.1.

build failure with 'AttributeError: 'NoneType' object has no attribute 'ensure_finalized''

Copying lib/yumbootstrap.egg-info to /root/rpmbuild/BUILDROOT/yumbootstrap-0.0.3-1.el7.x86_64/usr/lib/python2.7/site-packages/yumbootstrap-0.0.3-py2.7.egg-info
running install_scripts
Traceback (most recent call last):
File "setup.py", line 12, in
package_dir = { "": "lib" },
File "/usr/lib64/python2.7/distutils/core.py", line 152, in setup
dist.run_commands()
File "/usr/lib64/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/lib64/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/usr/lib/python2.7/site-packages/setuptools/command/install.py", line 61, in run
return orig.install.run(self)
File "/usr/lib64/python2.7/distutils/command/install.py", line 575, in run
self.run_command(cmd_name)
File "/usr/lib64/python2.7/distutils/cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "/usr/lib64/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/usr/lib/python2.7/site-packages/setuptools/command/install_scripts.py", line 33, in run
bs_cmd = (self.get_finalized_command('build_scripts', create=False) or
File "/usr/lib64/python2.7/distutils/cmd.py", line 312, in get_finalized_command
cmd_obj.ensure_finalized()
AttributeError: 'NoneType' object has no attribute 'ensure_finalized'
error: Bad exit status from /var/tmp/rpm-tmp.2G0Cvk (%install)

RPM DB Corrupt

Hi

I tried to use yumbootstrap to create a docker image.

Everything works fine but the rpm db is corrupt. If I boot the image I get:

bash-4.1# yum list
rpmdb: /var/lib/rpm/Name: unexpected file type or format
error: cannot open Name index using db3 - Invalid argument (22)
rpmdb: /var/lib/rpm/Providename: unexpected file type or format
error: cannot open Providename index using db3 - Invalid argument (22)
rpmdb: /var/lib/rpm/Name: unexpected file type or format
Installed Packages

I have to do the following to fix this:

rm /var/lib/rpm/__db*
rpm --rebuilddb

I use the following suite:

name = Red Hat
release = 6.4

gpg_key = gpg/RPM-GPG-KEY-redhat-6

packages = packages/redhat-6.list

[post_install]
finalize = scripts/fix_rpmdb.py
finalize = scripts/clean_yumbootstrap.py

[repositories]
; TODO: adjust the URL ("http://repo.example.net/rhel/" part)
; NOTE: you only need one of the two
redhat-server      = http://path/to/our/repo/

[environment]
;PYTHONPATH=...
;PYTHONPATH
;SUDO_*

; vim:ft=dosini

Any hints?

network.service - LSB: Bring up/down networking

I am trying to run a centos7 image which I have created with yumbootstrap . I have done this to bring a minimal centos sysytem ,

Now when I try to run it all the services are starting successfully except network services and when i check the status of service it give me this

network.service - LSB: Bring up/down networking
 Loaded: loaded (/etc/rc.d/init.d/network; bad; vendor preset: disabled)
 Active: failed (Result: exit-code) since Thu 2017-02-09 14:23:40 UTC; 3min 59s ago
 Docs: man:systemd-sysv-generator(8)
 Process: 427 ExecStart=/etc/rc.d/init.d/network start (code=exited, status=6)

Feb 09 14:23:39 centos systemd[1]: Starting LSB: Bring up/down networking...
Feb 09 14:23:40 centos systemd[1]: network.service: control process exit...=6
Feb 09 14:23:40 centos systemd[1]: Failed to start LSB: Bring up/down ne...g.
Feb 09 14:23:40 centos systemd[1]: Unit network.service entered failed state.
Feb 09 14:23:40 centos systemd[1]: network.service failed.
Hint: Some lines were ellipsized, use -l to show in full.

Installation of centos-7: "Public key for acl-2.2.51-12.el7.x86_64.rpm is not installed"

During installation of centos-7 I spot this output:

# sudo /usr/sbin/yumbootstrap centos-7 /var/tmp/centos-7-root
[..]
Downloading packages:
warning: /var/tmp/centos-7-root/yumbootstrap/cache/centos/packages/acl-2.2.51-12.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Public key for acl-2.2.51-12.el7.x86_64.rpm is not installed
[..]

With fedora-19, I spot similar output:

# sudo /usr/sbin/yumbootstrap fedora-19 /var/tmp/fedora-19
[..]
Downloading packages:
warning: /var/tmp/portage/fedora-19/yumbootstrap/cache/fedora/packages/basesystem-10.0-8.fc19.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID fb4b18e6: NOKEY
Public key for basesystem-10.0-8.fc19.noarch.rpm is not installed
(1/147): basesystem-10.0-8.fc19.noarch.rpm     
Public key for audit-libs-2.3.7-1.fc19.x86_64.rpm is not installed
[..]

I wonder why that condition does not make yumbootstrap abort with failure. I also wonder, why that key is not included or why it's different from the other files.

Failed to start services at boot time centos7

I have created a centos7 image with yumbootstrap . When I have tried to run this image with kvm I have found that there are some services which are failed to start on boot time some of services are systemd-logind.service, dmesg and network-services one of the error message is given below other services have same type of error

Failed to start Dump dmesg to /var/log/dmesg 
see ' systemctl status rhel-dmesg.service' for details
rhel-dmesg[407]: /usr/lib/systemd/rhel-dmesg: line 3: /var/log/dmesg Read-only File system

But it allow me to login as single user mode . There I have run this command

systemctl status rhel-dmesg.service

and found that issue
failed to get D-bus connection No such file or directory

I have checked that systemd is installed in centos, I dont know what else I am missing . May be there is configuration or some thing else . Thanks in advance

Limitations/known issues

"Fedora guest under Debian Squeeze host"

It'll succeed if you add python-lzma to the "Depends".

Config error: releasever not given and can not be detected from the installroot.

When I try to use yumbootstrap on a fedora 22 host, the yumbootstrap formulas run into dnf vs. yum conflicts:

mkdir /chroot
yumbootstrap --verbose fedora-20 /chroot
[17:56:51] installing Fedora (release 20) to /chroot
[17:56:51] preparing empty /etc/fstab and /etc/mtab
[17:56:51] using built-in repositories
[17:56:51] adding GPG keys
[17:56:51] installing default packages for Fedora 20
[17:56:51] /chroot/yumbootstrap/yum.conf doesn't exist, creating one
[17:56:51] GPG keys defined, adding them to repository configs
Yum command has been deprecated, redirecting to '/usr/bin/dnf -c /chroot/yumbootstrap/yum.conf --installroot /chroot -y -e 1 -d 2 install coreutils bash grep gawk basesystem rpm initscripts iproute less make mktemp vim-minimal yum chkconfig plymouth rootfiles fedora-release /usr/bin/db_load'.
See 'man dnf' and 'man yum2dnf' for more information.
To transfer transaction metadata from yum to DNF, run:
'dnf install python-dnf-plugins-extras-migrate && dnf-2 migrate'

Config error: releasever not given and can not be detected from the installroot.
"/usr/bin/yum" exited with code 1

Some public key (8e1431d5?) missing for Fedora 22?

I saw these errors:

warning: /tmp/tmp.HABvtio8aE/fedora-22-root/yumbootstrap/cache/fedora-updates/packages/rpm-build-libs-4.12.0.1-10.fc22.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 8e1431d5: NOKEY.0 B/s |    0 B  --:--:-- ETA 
Public key for rpm-build-libs-4.12.0.1-10.fc22.x86_64.rpm is not installed

warning: /tmp/tmp.HABvtio8aE/fedora-22-root/yumbootstrap/cache/fedora-updates/packages/rpm-plugin-systemd-inhibit-4.12.0.1-10.fc22.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 8e1431d5: NOKEY kB  --:--:-- ETA 
Public key for rpm-plugin-systemd-inhibit-4.12.0.1-10.fc22.x86_64.rpm is not installed

Maybe this is an evil mirror or someone playing man-in-the-middle, I don't know.
Any ideas?

Pulling in rpms newer than those needed?

When trying to install fedora-22, a version of rpm is installed that is too to mee other the requirements of other packages, it seems.

A version "<= 4.2.2-1" seems to be needed:

# time sudo http_proxy=http://127.0.0.1:8123/ yumbootstrap fedora-22 fedora-22-root
[..]
Running transaction check
ERROR You need to update rpm to handle:
rpmlib(BuiltinLuaScripts) <= 4.2.2-1 is needed by glibc-2.21-5.fc22.x86_64
rpmlib(BuiltinLuaScripts) <= 4.2.2-1 is needed by glibc-common-2.21-5.fc22.x86_64
rpmlib(BuiltinLuaScripts) <= 4.2.2-1 is needed by libgcc-5.1.1-3.fc22.x86_64
rpmlib(FileCaps) <= 4.6.1-1 is needed by iputils-20140519-4.fc22.x86_64
rpmlib(BuiltinLuaScripts) <= 4.2.2-1 is needed by bash-4.3.39-1.fc22.x86_64
rpmlib(BuiltinLuaScripts) <= 4.2.2-1 is needed by filesystem-3.2-32.fc22.x86_64
rpmlib(BuiltinLuaScripts) <= 4.2.2-1 is needed by setup-2.9.6-1.fc22.noarch
RPM needs to be updated
[..]

But version 4.12.0.1 seems to be downloaded and installed:

# find fedora-22-root/ -type f -name 'rpm*' | xargs -n1 basename
rpm-libs-4.12.0.1-10.fc22.x86_64.rpm
rpm-python-4.12.0.1-10.fc22.x86_64.rpm
rpm-plugin-systemd-inhibit-4.12.0.1-10.fc22.x86_64.rpm
rpm-plugin-selinux-4.12.0.1-10.fc22.x86_64.rpm
rpm-build-libs-4.12.0.1-10.fc22.x86_64.rpm
rpm-4.12.0.1-10.fc22.x86_64.rpm

How come?

Could it be that mirrors different fedora releases are mixed or something?

issue with python package installation

in chroot environment when i try to install python packages I am getting this issue
`Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-build-UFsQuw/positional/setup.py", line 20, in
import multiprocessing # noqa
File "/usr/lib64/python2.7/multiprocessing/init.py", line 64, in
from multiprocessing.process import Process, current_process, active_children
File "/usr/lib64/python2.7/multiprocessing/process.py", line 312, in
_current_process = _MainProcess()
File "/usr/lib64/python2.7/multiprocessing/process.py", line 309, in init
self._authkey = AuthenticationString(os.urandom(32))
NotImplementedError: /dev/urandom (or equivalent) not found

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-UFsQuw/positional/
`
I have try to update python setuptools but still having this issue

Use python2 hashbangs instead of "python" in scripts

Yumbootstrap works well on Arch Linux and I have created an Arch package: https://aur.archlinux.org/packages/yumbootstrap-git/

I'm required to replace the "#!/usr/bin/python" hashbangs with "#!/usr/bin/python2" in order to exist on a modern python3 system. Since yumbootstrap requries python2, its best to use a "python2" hashbang for systems with both versions of python installed. An even better hashbang would be "#!/usr/bin/env python2" to allow for python2 installations that are installed in a non-standard directory.

Thanks again for your work on this very useful tool! It works very well with the "arch-chroot" script from the arch install scripts.

Edit: I had to change setup.py, bin/yumbootstrap and distros/scripts/*.py

Error downloading packages' when building fedora-20

Could we add more mirrors to the fedora-20 and older scripts? I think the packages have moved to archival since fedora 22 was released.

mkdir /chroot && \
yumbootstrap --verbose fedora-20 /chroot
...
Error downloading packages:
  kpartx-0.4.9-56.fc20.1.x86_64: [Errno 256] No more mirrors to try.
  libxml2-2.9.1-4.fc20.x86_64: [Errno 256] No more mirrors to try.
  nss-sysinit-3.18.0-1.fc20.x86_64: [Errno 256] No more mirrors to try.

"/usr/bin/yum" exited with code 1

yumbootstrap fails under ubuntu (xenial and yaketty) because of module import issues

Following the instructions in the README creates a .deb that will install python modules under /usr/lib/python2.7/site-packages

Those are not found in ubuntu by default. Adding

export PYTHONPATH=/usr/lib/python2.7/site-packages

does something, but running still fails in the fix_rpms.py script.

Doing sudo ln -s for f in /usr/lib/python2.7/site-packages/*; do sudo ln -s $f /usr/lib/python2.7/dist-packages/; done makes it work.

Support for Fedora 21?

Hi!

Fedora 21 does not seem to be supported. Are there plans to add support for it?

Best, Sebastian

yum "Error performing checksum" on CentOS 5

Hi!. I am trying to install a CentOS 6 chroot on a CentOS 5 system, and I get:

http://mirror.centos.org/centos/6/os/x86_64/repodata/9a3a8909e656c27cd85c75a2d53b491040effa3f170b0369172433843e1829d7-primary.sqlite.bz2: [Errno -3] Error performing checksum
Trying other mirror.

Until I get:

Error: failure: repodata/9a3a8909e656c27cd85c75a2d53b491040effa3f170b0369172433843e1829d7-primary.sqlite.bz2 from centos: [Errno 256] No more mirrors to try.
"/usr/bin/yum" exited with code 1

Any ideas? thanks!

add new distribution

please rapid add centos 8

fedora 23, 24, 25, 26, 27, 28, 29, 30, 31 and 32

it is very important that the distribution list is kept up to date

without this your project has practically no use a by centos 6 and 7 all the other distribution you provide are obsolete

Issue Building Centos7 on ubuntu

I am creating a centos7 image with yumbootstrap method on a ubuntu 14.04 and when i try to run this image as kvm i am getting this issue
Failed to mount sysroot
Dependency failed for Intird Root File System
So debug this issue step by step and found that during bootstrap procedure yumbootstrap copy contents of /proc/self/mounts and /etcmtab of ubuntu and copy those file in centos7 rootfile system and FYI centos7 using xfx file sysytem and ubuntu is using ext3. I have try to replace these files but i am unable to do that becuase these files are readonly even for root user.

Stream Output

Can you make yumbootstrap output optional compatible with tars input stream format? This would be great to create yum based docker images in a single step.

$ yumbootstrap --verbose --tar-stream centos-6 - | docker import - <image_name>

build fedora failed.

I have successfully built CendOS 6, thanks a lot.

It broke when I was intending to build a Fedora 22, initially I found the url in 'fedora.suited' was not available anymore, after set it the workable archive, it failed as below, I am not sure if this is caused by
Fedora has put all packages to alphabetically ordered directory instead of put them all together as CentOS does, does anyone know this?

Workable URL:
http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/22/Everything/x86_64/os/Packages/

Error message:
Unable to detect release version (use '--releasever' to specify release version)
No match for argument: coreutils
No match for argument: bash
No match for argument: grep
No match for argument: gawk
No match for argument: basesystem
No match for argument: rpm
No match for argument: initscripts
No match for argument: iproute
No match for argument: openssh-server
No match for argument: less
No match for argument: make
No match for argument: mktemp
No match for argument: vim-minimal
No match for argument: yum
No match for argument: chkconfig
No match for argument: plymouth
No match for argument: rootfiles
No match for argument: fedora-release
No match for argument: /usr/bin/db_load
Error: Unable to find a match

Dealing with very old fedora release

Hiya,

So firstly, yumbootstrap is a cracking tool - I'm using it to help create a docker base image for resurrecting a very old build environment for an old project that needs to be built on Fedora 8 so I'm sure this is almost certainly going to be an obscure / non issue for most people :-)

As per the usage example in README.md, I'm doing :

yumbootstrap --verbose --no-scripts fedora-8 ${CHROOT}
yum --installroot=${CHROOT} -c ${CHROOT}/yumbootstrap/yum.conf install ...
yumbootstrap --verbose --just-scripts ${CHROOT}

The last command fails however with :

root@zed:/opt/docker/src#   yumbootstrap --verbose --just-scripts ${CHROOT}
[19:57:45] executing post-install scripts
[19:57:45] running finalize
[19:57:45] fixing RPM database for guest
[19:57:45] converting "Packages" file
[19:57:53] removing all the files except "Packages"
[19:57:53] running `rpm --rebuilddb'
rpmdb: /var/lib/rpm/Packages: unsupported hash version: 9
error: cannot open Packages index using db3 - Invalid argument (22)
Traceback (most recent call last):
  File "/etc/yumbootstrap/suites/scripts/fix_rpmdb.py", line 27, in <module>
    yum.fix_rpmdb()
  File "/usr/lib/python2.7/dist-packages/yumbootstrap/yum.py", line 192, in fix_rpmdb
    env = self.yum_conf.env,
  File "/usr/lib/python2.7/dist-packages/yumbootstrap/sh.py", line 80, in run
    check_error(command[0], proc.returncode)
  File "/usr/lib/python2.7/dist-packages/yumbootstrap/sh.py", line 16, in check_error
    raise YBError('"%s" exited with code %d', cmd, code, exit = 1)
yumbootstrap.exceptions.YBError: "rpm" exited with code 1
"/etc/yumbootstrap/suites/scripts/fix_rpmdb.py" exited with code 1

This looks to be because the ${CHROOT}/var/lib/rpm/Packages has been created with a version of rpm that isn't backwards compatible.

Luckily it seems to be the last operation so I can repair the Packages file by building bdb v4.2.52 and using it :

mv ${CHROOT}/var/lib/rpm/Packages ${CHROOT}/var/lib/rpm/Packages.orig
db_dump  ${CHROOT}/var/lib/rpm/Packages.orig | /opt/ptx/bin/db_load42 ${CHROOT}/var/lib/rpm/Packages

I'm scratching my head though to see if there's clean way to fix this? Im also wondering if its even worth bothering as Im not sure if anyone else would be interested in this as its a spot obscure?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.