[SOLVED] Use wget in kickstart

Issues related to applications and software problems
Post Reply
User avatar
warron.french
Posts: 616
Joined: 2014/03/27 20:21:58

[SOLVED] Use wget in kickstart

Post by warron.french » 2015/02/24 17:13:38

I have seen on another server, here at my workplace the use of wget (without full path) being used in a kickstart file successfully, on CentOS-6.2 installations.

I wanted to do the same thing in my kickstart script for CentOS-6.6, but it is not working. The command wget is not being recognized after the partitions and logical volumes are created.

Here is what was displayed on the screen:

Running anaconda 13.21.229, the CentOS system installer - please wait.

The following error was found while parsing the kickstart configuration:

The following problem occured on line 291 of the kickstart file:

Unknown command: wget

Tripialos posted something similar and discovered that he should not be running with --nochroot on the %post line. Albeit my wget command is in that section, but I am not doing anything on the %post line execept --interpreter /usr/bin/bash.

Here is my wget command:
cd /root
wget -O dt-harden.sh http://192.168.40.21/Security/dt-harden.sh


Please help
Last edited by warron.french on 2015/02/25 20:49:23, edited 1 time in total.
Thanks,
War

aks
Posts: 3073
Joined: 2014/09/20 11:22:14

Re: Use wget in kickstart

Post by aks » 2015/02/24 17:26:25

wget is not installed by default (as RH generally uses curl). Either use curl or install wget BEFORE you want to use it.

User avatar
warron.french
Posts: 616
Joined: 2014/03/27 20:21:58

Re: Use wget in kickstart

Post by warron.french » 2015/02/24 18:50:36

aks, thanks, but does that mean I need to explicitly add it to my %packages section?

The reason I ask is because, if I remove that 1 line with wget, the system gets built, and then wget is on the newly installed OS.

Thanks,
War
Thanks,
War

User avatar
TrevorH
Site Admin
Posts: 33221
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Use wget in kickstart

Post by TrevorH » 2015/02/24 18:53:20

When you're running the installer you are dependent on the packages that are available in the installer and wget is not one of them. As others have said, curl is there and works. Otherwise you'll have to chroot into your newly installed system in the post script and then you can run the wget you just installed... but that depends on the installation finishing.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

User avatar
warron.french
Posts: 616
Joined: 2014/03/27 20:21:58

Re: Use wget in kickstart

Post by warron.french » 2015/02/24 20:34:33

OK, so now the problem is Unknown command: curl.

What do I need to do to get curl, the basic tool recognized?

I just did:

curl -o /root/file1 http://192.168.40.21/file1
Thanks,
War

aks
Posts: 3073
Joined: 2014/09/20 11:22:14

Re: Use wget in kickstart

Post by aks » 2015/02/25 16:54:14

Yes just add it to the %packages section (I used %packages --nobase).
Works fine for me.

User avatar
warron.french
Posts: 616
Joined: 2014/03/27 20:21:58

Re: Use wget in kickstart

Post by warron.french » 2015/02/25 18:17:43

OK, I will try that, thanks -- aks.

I am really looking forward to being done with this project.
Thanks,
War

User avatar
warron.french
Posts: 616
Joined: 2014/03/27 20:21:58

Re: Use wget in kickstart

Post by warron.french » 2015/02/25 20:06:55

All, I think I found my resolution...

it would help if I had seen that the %post section was already closed out with a %end line, and after that I had put my curl commands. STUPID ME! Silly little mistakes keep killing me.

But, the good news is I am learning an awful lot. :-)

More to come if I figure this out.
Thanks,
War

User avatar
warron.french
Posts: 616
Joined: 2014/03/27 20:21:58

Re: [SOLVED] Use wget in kickstart

Post by warron.french » 2015/02/25 20:49:02

Yep! That was it, I needed to move the '%end' to the very last line of the file and that solved all of my problems.

Problem solved.
Thanks,
War

Post Reply