LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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, 01:43 AM   #1
iorih0304
LQ Newbie
 
Registered: Jul 2017
Posts: 26

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 02:16 AM.
 
Old 01-16-2018, 02:51 AM   #2
iorih0304
LQ Newbie
 
Registered: Jul 2017
Posts: 26

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



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 04:37 PM
Network install via Kickstart using a (created) local repository (F12-F14) Ronayn Fedora 3 01-06-2011 08:59 AM
Kickstart %post install from a USB Key Joust Linux - Newbie 2 07-28-2009 08:00 PM
rh9 kickstart post install help stockcowboy Linux - Newbie 1 12-05-2003 11:45 AM
Kickstart Post-install tasks TheRealDeal Linux - General 0 09-03-2003 01:13 AM

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

All times are GMT -5. The time now is 03:40 AM.

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
Open Source Consulting | Domain Registration