LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS
User Name
Password
CentOS This forum is for the discussion of CentOS Linux. Note: This forum does not have any official participation.

Notices


Reply
  Search this Thread
Old 01-16-2018, 02:43 AM   #1
iorih0304
LQ Newbie
 
Registered: Jul 2017
Posts: 19

Rep: Reputation: Disabled
How can I use local repository in %post with kickstart to do auto-install?


As title, I want to install CentOS 7 automatically with kickstart.
And, I also want to yum install with local repository in %post stage.
What I do are:
1. createrepo
2. Create /etc/yum.repos.d/local.repo

However, I command "yum install somepackages" in %post stage, the error is:
Code:
One of the configured repositories failed (Unknown),
 and yum doesn't have enough cached data to continue. At this point the only
 safe thing yum can do is fail. There are a few ways to work "fix" this:

     1. Contact the upstream for the repository and get them to fix the problem.

     2. Reconfigure the baseurl/etc. for the repository, to point to a working
        upstream. This is most often useful if you are using a newer
        distribution release than is supported by the repository (and the
        packages for the previous distribution release still work).

     3. Run the command with the repository temporarily disabled
            yum --disablerepo=<repoid> ...

     4. Disable the repository permanently, so yum won't use it by default. Yum
        will then just ignore the repository until you permanently enable it
        again or use --enablerepo for temporary usage:

            yum-config-manager --disable <repoid>
        or
            subscription-manager repos --disable=<repoid>

     5. Configure the failing repository to be skipped, if it is unavailable.
        Note that yum will try to contact the repo. when it runs most commands,
        so will have to try and fail each time (and thus. yum will be be much
        slower). If it is a very temporary problem though, this is often a nice
        compromise:

            yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true

Cannot find a valid baseurl for repo: base/7/x86_64
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"
I think the keyword is "Cannot find a valid baseurl for repo: base/7/x86_64", because there is no network in %post stage, right?
But I have no idea how to solve the problems.
In addition, I command "yum install vim" in %post stage, the error is also as above.
Do anyone has any advice?
Thanks a lot.

Last edited by iorih0304; 01-16-2018 at 03:16 AM.
 
Old 01-16-2018, 03:51 AM   #2
iorih0304
LQ Newbie
 
Registered: Jul 2017
Posts: 19

Original Poster
Rep: Reputation: Disabled
I solve this problem.

There is no network in %post stage, and then it can't find online repository
Therefore, I move all origin repository (/etc/yum.repos.d/) to another path.
And then, I command yum install local-packages.
It installs successfully without errors.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Kickstart post install script gw1500se Linux - Server 4 12-27-2014 05:37 PM
Network install via Kickstart using a (created) local repository (F12-F14) Ronayn Fedora 3 01-06-2011 09:59 AM
Kickstart %post install from a USB Key Joust Linux - Newbie 2 07-28-2009 09:00 PM
rh9 kickstart post install help stockcowboy Linux - Newbie 1 12-05-2003 12:45 PM
Kickstart Post-install tasks TheRealDeal Linux - General 0 09-03-2003 02:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS

All times are GMT -5. The time now is 09:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration