Kickstart install error - Cannot find a valid baseurl for repo: CentOS

General support questions
Post Reply
Zerc
Posts: 3
Joined: 2012/07/31 12:57:08

Kickstart install error - Cannot find a valid baseurl for repo: CentOS

Post by Zerc » 2012/08/01 11:58:22

I am trying to do a kickstart install of CentOS 6.2 as a VWware guest using the generated kickstart file from a successful install on another vmware guest and keep on getting the following error message "Unable to read package metadata from repository. This may be due to a missing repository directory. Please ensure that your repository has been correctly generated.- Cannot find a valid baseurl for repo: CentOS"

The CentOS image for the install has not been modified in any way and the command line I use to boot the kernel is "vmlinuz initd=initrd.img ks=nfs:192.168.0.5:/tmp/y.cfg ip=192.168.0.143 netmask=255.255.255.0"

The kickstart file has been copied to the server at 192.168.0.5 and has been made available via nfs

The install goes fine until just after the disk formatting steps and when the software installation starts I get the message above.

Any help in resolving this will be appreciated

My kickstart file is below -

# Kickstart file automatically generated by anaconda.

#version=DEVEL
install
cdrom
lang en_US.UTF-8
keyboard us
network --onboot yes --device eth0 --bootproto dhcp --noipv6
rootpw --iscrypted $6$osHACyXENLS.rm8i$dTk.sxHc1z5AuL8MXuycTUq0uId18.FFtZgqGI4kyhtnWJGNFgXqOqNG4AiJNuzAEEXEtGy//Auo1XkIgYfP31
firewall --service=ssh
authconfig --enableshadow --passalgo=sha512
selinux --enforcing
timezone --utc Africa/Johannesburg
bootloader --location=mbr --driveorder=sda --append=" rhgb crashkernel=auto quiet"
# The following is the partition information you requested
# Note that any partitions you deleted are not expressed
# here so unless you clear all partitions first, this is
# not guaranteed to work
clearpart --all --drives=sda

part /boot --fstype=ext4 --size=500
part pv.008002 --grow --size=1

volgroup vg_test01 --pesize=4096 pv.008002
logvol / --fstype=ext4 --name=lv_root --vgname=vg_test01 --grow --size=1024 --maxsize=51200
logvol swap --name=lv_swap --vgname=vg_test01 --grow --size=2016 --maxsize=4032

repo --name="CentOS" --baseurl=cdrom:sr0 --cost=100

%packages
@base
@client-mgmt-tools
@console-internet
@core
@debugging
@directory-client
@hardware-monitoring
@java-platform
@large-systems
@network-file-system-client
@performance
@perl-runtime
@server-platform
@server-policy
pax
oddjob
sgpio
certmonger
pam_krb5
krb5-workstation
perl-DBD-SQLite
%end

DouglasRyder
Posts: 62
Joined: 2012/08/02 13:53:01
Location: UK

Re: Kickstart install error - Cannot find a valid baseurl for repo: CentOS

Post by DouglasRyder » 2012/08/02 23:37:22

Can you clarify how you booted the VM into anaconda (i.e. from CD, USB, or PXE), and where your CentOS install image is located?

Your kickstart file is telling anaconda that the centos repodata is located on a CD in /dev/sr0, but anaconda is saying that it can't find the repodata. This usually means that /dev/sr0 doesn't exist, or that it doesn't contain the CentOS DVD. If you go to the console prompt in virtual terminal 2 when the installer stops, can you successfully mount /dev/sr0 and see the repodata folder?

Try removing the following line from your kickstart file:

repo --name="CentOS" --baseurl=cdrom:sr0 --cost=100

Anaconda should find the repodata without this line if the repodata is located on the CD that you just booted from.

Zerc
Posts: 3
Joined: 2012/07/31 12:57:08

Re: Kickstart install error - Cannot find a valid baseurl for repo: CentOS

Post by Zerc » 2012/08/03 06:02:40

Thanks Douglas, removing the repo line for the config line worked.

Any idea why the Kickstart config file would be created incorrectly ? If I use it to reinstall on the same virtual server as it was created on it still doesn't work properly. A couple of thing I noted -

A df from the console when the repo line was still in the config file shows df /dev/sr0 was mounted as /mnt/source. After booting with the repo line removed and the package installation in progress the df showed the same mounts so it appears to me that the repo line is at fault here

If I look at the output on the 3rd virtual console of a failed installation I get some debug messages mentioning that sr0 does not contain a disklabel, no type or existing type for sr0, bailing followed by a couple of info lines later stating found installation media on sr0, set mediaid of repo CentOS to: 1323560292.885204. I'm not sure if this has any relevance but I though it was worth mentioning

I would think that a kickstart file created during installation should work for a reinstallation on the same server without any changes. I will try the same exercise with 6.3 and if I get the same problems do you think I should report this as a bug?

DouglasRyder
Posts: 62
Joined: 2012/08/02 13:53:01
Location: UK

Re: Kickstart install error - Cannot find a valid baseurl for repo: CentOS

Post by DouglasRyder » 2012/08/03 08:29:01

I can't explain what went wrong here. If anaconda successfully mounted /dev/sr0 as /mnt/source, I would expect the baseurl line in your kickstart file to work correctly. I always delete that line, so I can't say for sure. Maybe the messages about a missing disklabel are saying that the kernel is having difficulty determining the type of filesystem on the cdrom.

Zerc
Posts: 3
Joined: 2012/07/31 12:57:08

Re: Kickstart install error - Cannot find a valid baseurl for repo: CentOS

Post by Zerc » 2012/08/03 09:55:38

Just some additional info that may be of interest -
I changed the line to "repo --name="CentOS" --baseurl=file:///mnt/source" and the installation went through correctly as well
CentOS 6.3 exhibits the same problem as 6.2


I wonder if anybody else is getting this problem because I didn't seem to find any by doing a search via google

Anyhow I have a solution so I'm happy.

mtoal
Posts: 4
Joined: 2011/07/20 15:57:51

Kickstart install error - Cannot find a valid baseurl for re

Post by mtoal » 2012/08/03 19:03:20

I had this exact problem too. Here is what worked for me.

My issue, is I had downloaded the ISO's onto a Windows 7 box, and unpacked them using 7-zip 9.20 into a folder so I could do a network installation over ftp using filezilla server 0.9.41.

Check the files in your /repodata folder. See those files with huge long hex filenames? I'll bet they don't have any extensions. They should all be .xml, bz2, or .gz files.

For some reason, I don't think 7-zip 9.20 correctly unpacked these files.

Open the file TRANS.TBL in notepad. Review this and rename the files by hand according to what you find in TRANS.TBL.

C:\library\centos-6.3-i386\repodata>dir
Volume in drive C is OSDisk
Volume Serial Number is 3C77-1247

Directory of C:\library\centos-6.3-i386\repodata

08/03/2012 01:51 PM .
08/03/2012 01:51 PM ..
07/06/2012 03:46 PM 213,745 132b4a2ce392e31a86b8c8be8a4218ded8c3bc9ef1818e63105c1451a2a925ef-c6-i386-comps.xml.gz
07/07/2012 03:45 AM 1,173,070 151ad5b0a3056212a6012b429192adcabba8b37571ff12453d6a29bc5199c943-c6-i386-comps.xml
07/07/2012 03:45 AM 2,021,144 1c318d6b1d3c41d2c1442b069c021033a54c7b99878702b39004fe67d94acc28-primary.xml.gz
07/07/2012 03:45 AM 3,660,974 24ddd44faea2bd48c4573a41f6da383b5297e60b42775a66cdfa9e7ac47a4bc3-primary.sqlite.bz2
07/07/2012 03:45 AM 4,555,158 5c2b1050e53707e911f9bebf05a8eb8f571a0587ad1a3be23cab922ba6eb7eb8-filelists.xml.gz
07/07/2012 03:45 AM 5,036,184 7848ab8a2c86476f1fb1150740e6b2a214447afef38d892b0a4f0b0954894aab-filelists.sqlite.bz2
07/07/2012 03:45 AM 213,754 927d07de701834881986557a309fbdfefeac46e4d2a3435698d0aa6f63e43c18-c6-i386-comps.xml.gz
07/07/2012 03:45 AM 2,183,199 a21c6f15187cbd895104ae841d1daec015c17083d60ba850eed902da57a8c96a-other.xml.gz
07/07/2012 03:45 AM 2,012,110 a3093ce63063e4bf331f9ffd36ef11cc1ce71bf046960b9524c73d407a4f990e-other.sqlite.bz2
07/07/2012 03:45 AM 4,131 repomd.xml
07/07/2012 03:45 AM 2,868 TRANS.TBL
11 File(s) 21,076,337 bytes
2 Dir(s) 812,583,600,128 bytes free

DouglasRyder
Posts: 62
Joined: 2012/08/02 13:53:01
Location: UK

Re: Kickstart install error - Cannot find a valid baseurl for repo: CentOS

Post by DouglasRyder » 2012/08/04 12:26:13

Hi mtoal,

I think you'll find that this is a different problem that belongs in another post.

If you extract the contents of the DVD ISO using 7-Zip or WinZip, you are likely to get UDF filenames instead of ISO9660. It is better to mount the ISO image on a Linux system and then copy the files:

mount -o loop disk1.iso /mnt/cdrom
cp -rpd /mnt/cdrom /somewhere-else
umount /mnt/crom

This will give you the correct file ISO9660 names, and you won't need to edit TRANS.TBL.
If you need to extract the files on a Windows machine, try using IsoBuster instead of 7-Zip

Post Reply

Return to “CentOS 6 - General Support”