www.centos.org Forum Index CentOS 5 - Software Support Can yum be used to update a directory instead of the running system?
|
Bottom Previous Topic Next Topic |
|
| |
|
|
|---|
| Poster | Thread |
|---|
|
Re: Can yum be used to update a directory instead of the running system? | #2 |
|
|---|---|---|---|
|
Moderator
![]()
Joined: 2006/12/13
From Tidewater, Virginia, North America
Posts: 18773
|
Why not create a Local Mirror? As more direct answer is "man yum" and look for
|
||
|
_________________
Phil Recommended reading: FAQ & Readme first ; Search hint: google "your topic site:centos.org"; Smart Questions |
|||
Posted on: 2012/3/1 1:50
|
|||
|
Re: Can yum be used to update a directory instead of the running system? | #3 |
|
|---|---|---|---|
|
Moderator
![]()
Joined: 2009/9/24
From Brighton, UK
Posts: 6322
|
How about the yum-downloadonly package?
It'll go through all the steps of doing the download and then exit without doing the update, leaving all the rpms in /var/cache/yum Actually, depending on what you want to do, just creating your own yum repo might be a better bet. I expect the wiki has articles on it but you basically just rsync a CentOS mirror and do some stuff (tm) to it then make it available over http to your clients. |
||
|
_________________
Linux/VoIP Systems Administrator |
|||
Posted on: 2012/3/1 2:26
|
|||
|
Re: Can yum be used to update a directory instead of the running system? | #4 |
|
|---|---|---|---|
|
Moderator
![]()
Joined: 2006/12/13
From Tidewater, Virginia, North America
Posts: 18773
|
Quote:
That's not going to work reliably unless all systems are identical, and still needs a way to distribute the packages and create metadata. Quote:
A Wiki search for Mirror will turn up several including the one I provided a link for above. |
||
|
_________________
Phil Recommended reading: FAQ & Readme first ; Search hint: google "your topic site:centos.org"; Smart Questions |
|||
Posted on: 2012/3/1 14:30
|
|||
|
Re: Can yum be used to update a directory instead of the running system? | #5 |
|
|---|---|---|---|
|
Peeking in the Member Window
![]()
Joined: 2012/3/1
From
Posts: 13
|
Thank you all!
Unfortunately I have already looked into these options and none of them is a solution for me. To answer to your recommendations: - Having a local repository means that I will solve the problem if all the systems that need updates will be able to communicate with this local repo. This is not my case. - --installroot option has nothing to do with the location used by yum to determine what rpm packages need updates - I already use the --downloadonly --downloaddir=/some/path in order to store all the new rpms in a certain location but this is not what I need, it's just part of a possible solution. - I have been using man yum, of course, and many other resources before asking this here I will try to explain my problem a little better: I need to update systems that are not under my control and which are located in many places, in many companies. My company is using a fairly standard rhel/centos distro as a base for a product and it needs to keep its clients up to date with OS updates. The machines running in our clients infrastructures, most of the time has no access to internet, and even if they would have, would not solve the problem due to other reasons (mainly security stuff...). What yum does when I ask it to update a system, it to look for all the rpms installed in the running system and than go to a repository to find updates for each of those rpms. What I need it to do is to look into a certain location on the local hard disk (maybe a network drive, ftp/http/nfs server etc., but it has to be a location of my choosing NOT the running system only) instead of into the rpms installed in the running system and then go to the repo and find updates. If I cannot do that, basically I would need an exact replica of each of the running systems we have at our clients in order to use yum to get the new rpms and then build some kind of a patch and deliver it to the client. This would be impossible. Any other ideas on how to do do this? Thank you! |
||
Posted on: 2012/3/1 19:20
|
|||
|
Re: Can yum be used to update a directory instead of the running system? | #6 |
|
|---|---|---|---|
|
Moderator
![]()
Joined: 2006/12/13
From Tidewater, Virginia, North America
Posts: 18773
|
A yum repo can be on the local filesystem, or on removable media, such as DVD. See Creating Update Media for the DVD approach. Below is a sample CentOS-Base.repo file that uses a local filesystem that can be either on a local hard disk or NFS-mounted:
|
||
|
_________________
Phil Recommended reading: FAQ & Readme first ; Search hint: google "your topic site:centos.org"; Smart Questions |
|||
Posted on: 2012/3/1 19:31
|
|||
|
Re: Can yum be used to update a directory instead of the running system? | #7 |
|
|---|---|---|---|
|
Peeking in the Member Window
![]()
Joined: 2012/3/1
From
Posts: 13
|
Phil,
Thanks for your detailed reply. I understand that a repo can be local but this will only give me a local resource for the source of the new versions of the rpms. What I need is to chose the source of the OLD rpms that yum should look into and then go to the repo and fetch the new versions if there are new versions. So how can I tell yum: "THIS is the system I need you to update"? and by THIS I mean a local storage point of some kind where I can put the OLD rpms. |
||
Posted on: 2012/3/1 19:55
|
|||
|
Re: Can yum be used to update a directory instead of the running system? | #8 |
|
|---|---|---|---|
|
Moderator
![]()
Joined: 2009/9/24
From Brighton, UK
Posts: 6322
|
We are suggesting that you create a local mirror of ALL of the RPMs.
|
||
|
_________________
Linux/VoIP Systems Administrator |
|||
Posted on: 2012/3/1 20:49
|
|||
|
Re: Can yum be used to update a directory instead of the running system? | #9 |
|
|---|---|---|---|
|
Peeking in the Member Window
![]()
Joined: 2012/3/1
From
Posts: 13
|
Thanks, but how would this help me instruct yum what to update?
I really think no one yet understands what I am asking. I'll try one more time: On a centos system (call it SYS-A) yum is run and it looks at the local running system (the one we call SYS-A) and compares what it finds with what is available on whatever repo is configured - as a result yum comes up with a list of new packages that should be installed to update the old packages found on SYS-A. This is how I update SYS-A. If I want to update SYS-B and I cannot run yum on it I need a set of rpms to install on SYS-B with rpm -Uvh most probably. On SYS-A, I have a list of what packages are currently installed on SYS-B (I can also have all these packages in a directory on SYS-A) and I need yum, which I will run on SYS-A, to look into this list/directory representing SYS-B but located on SYS-A and come up with the list of packages that I need to install on SYS-B to update it. Can I do this with yum or in any other way? Thanks, I really hope I made myself clear as I am not trying to waste anyone's time here. |
||
Posted on: 2012/3/1 21:21
|
|||
|
Re: Can yum be used to update a directory instead of the running system? | #10 |
|
|---|---|---|---|
|
Moderator
![]()
Joined: 2006/12/13
From Tidewater, Virginia, North America
Posts: 18773
|
Seem to me that you are not quite grasping the nature of the problem and the feasibility of potential solutions. The easiest (and perhaps the only) way to make sure you cover all the bases is to create and maintain a mirror of all CentOS repos you use - as a minimum probably base, updates, and extras. Anything else is going to be a maintenance nightmare, or just plain impossible. There is no way (that I know of) to anticipate what updates any particular system will need in advance. You need to run "yum update" against the current metadata. You also cannot anticipate what additional packages might need to be installed on any particular system. Creating a full local mirror of the repos you need is the only way I can suggest to work the problem you have laid out for non-uniform systems. You can sync the repos over the network with rsync, using systems that do have Internet access, or use an external hard disk, or a USB stick with sufficient capacity to hold the repos.
For an idea of the space requirements: |
||
|
_________________
Phil Recommended reading: FAQ & Readme first ; Search hint: google "your topic site:centos.org"; Smart Questions |
|||
Posted on: 2012/3/1 21:30
|
|||
|
Re: Can yum be used to update a directory instead of the running system? | #11 |
|
|---|---|---|---|
|
Peeking in the Member Window
![]()
Joined: 2012/3/1
From
Posts: 13
|
Phil, I understand what you are saying but what I am trying to do has nothing to do with the repos.
Let's say you have a centOS system which does not have yum installed and you do not want it installed. How would you update it? I would update it with rpm -Uvh providing that I have all the rpms that I need (for dependencies etc.). To have all the rpms that I need, I would use yum as it can figure out reliably and fast what rpms are newer and what dependencies are there and how to solve those dependencies. The problem is I cannot use yum on the system that I need to update as yum is not installed and it won't be. So I need to use it on another system but make it aware of the fact that I am not trying to update the system on which it is installed but another one which can be represented by a directory with rpm files, for example. It's like when you use a linux 64 bit machine and compile a program for a linux 32 bit machine and for AIX, for example... |
||
Posted on: 2012/3/1 21:50
|
|||
|
Re: Can yum be used to update a directory instead of the running system? | #12 |
|
|---|---|---|---|
|
Moderator
![]()
Joined: 2006/12/13
From Tidewater, Virginia, North America
Posts: 18773
|
Quote:
I would not choose to do it the hard way. |
||
|
_________________
Phil Recommended reading: FAQ & Readme first ; Search hint: google "your topic site:centos.org"; Smart Questions |
|||
Posted on: 2012/3/1 21:53
|
|||
|
Re: Can yum be used to update a directory instead of the running system? | #13 |
|
|---|---|---|---|
|
Peeking in the Member Window
![]()
Joined: 2012/3/1
From
Posts: 13
|
I was not my choice either but having yum on our appliance that gets delivered to a client is getting me more problems then it solves as the client, as always, thinks he knows better and start updating the system when he should not and things would break and I have to fix them.
Unfortunately, that's how it is. People here have been doing this for a few years and it works but now I am taking over the process and I need to automate it as much as possible... having yum on the appliance at the client it's not a solution; we have to get them the patches to update the platform/OS and our application... I have a solution but it's not pretty or elegant and it is more time consuming than I would like: I will make a storage full of VMs created from ISO images for all the versions of our appliance that we are still supporting and so I will use scripting and ssh to start them, enable yum, use it to download the new rpms, and use these rpms to create the patches that will be shipped to the clients and applied there "offline".... Thanks anyway for your time and help. |
||
Posted on: 2012/3/1 22:16
|
|||
|
Re: Can yum be used to update a directory instead of the running system? | #14 |
|
|---|---|---|---|
|
Moderator
![]()
Joined: 2006/12/13
From Tidewater, Virginia, North America
Posts: 18773
|
That's additional information you did not previously reveal. If the problem is the clients messing with yum then there are options that would protect them from themselves while allowing you to use the optimal tools to manage the systems:
1. Just give them sudo access with a limited set of commands. 2. Create a script that disables yum by moving the executable, moving it off the standard path, etc. Create another script the reverse the process when you want to update. 3. Create scripts to remove yum and dependencies, and to reinstall them when you need them. Obviously any technically savvy client can bypass any of the above, but there's no perfect solution to stop a sufficiently determined and knowledgeable person. One could hope that such an individual would be sufficiently cluefull not to break the system without malicious intent. |
||
|
_________________
Phil Recommended reading: FAQ & Readme first ; Search hint: google "your topic site:centos.org"; Smart Questions |
|||
Posted on: 2012/3/1 22:33
|
|||
|
Re: Can yum be used to update a directory instead of the running system? | #15 |
|
|---|---|---|---|
|
Peeking in the Member Window
![]()
Joined: 2012/3/1
From
Posts: 13
|
You are right and your suggestions are good. We actually have a custom interface for the administration of that appliance. However, they are still going in via other ways and get a shell. I would not go so far to change so many things in a system to make it nearly impossible to get a shell as this will bring the same problems of maintenance.
A "sufficiently cluefull" individual as you nicely put it is actually a little bit more dangerous than a clueless one (that also realizes his cluelessness) or than a really cluefull one that would be wise enough to stay away from customized stuff that he has no idea about. These are usually the individuals that believe they can play with anything but we have a proprietary, modified, customized etc. system (not as much on the OS part as on some of the services that runs on it) which will behave as expected only if you know its particularities. That's the part they don't really get.... but this is another story. And also, I still need to supply patches for the systems that are not connected to Internet. I can't ask someone from DoD (for example) to get internet on our appliance, in their "super" secure environment because it needs to be updated.... |
||
Posted on: 2012/3/1 22:58
|
|||
|
Re: Can yum be used to update a directory instead of the running system? | #16 |
|
|---|---|---|---|
|
Moderator
![]()
Joined: 2006/12/13
From Tidewater, Virginia, North America
Posts: 18773
|
DoD also does not like removable media such as USB keys. Not sure what exceptions there may be. Makes life a lot harder.
|
||
|
_________________
Phil Recommended reading: FAQ & Readme first ; Search hint: google "your topic site:centos.org"; Smart Questions |
|||
Posted on: 2012/3/1 23:12
|
|||
|
Re: Can yum be used to update a directory instead of the running system? | #17 |
|
|---|---|---|---|
|
Moderator
![]()
Joined: 2009/9/24
From Brighton, UK
Posts: 6322
|
I think we're back to yum-downloadonly on your copy of the system. If you maintain a VM image of what you shipped to the client then it should match what they have and the RPMS that are downloaded can then be copied to a CD/DVD.
|
||
|
_________________
Linux/VoIP Systems Administrator |
|||
Posted on: 2012/3/2 0:03
|
|||
|
Re: Can yum be used to update a directory instead of the running system? | #18 |
|
|---|---|---|---|
|
Peeking in the Member Window
![]()
Joined: 2012/3/1
From
Posts: 13
|
Yes, that is true, but this is what was trying to avoid by having, as I said, a way to convince yum to check a directory that contains the rpms that the client's OS would contain and give me the updates for those.
|
||
Posted on: 2012/3/2 4:17
|
|||
|
Re: Can yum be used to update a directory instead of the running system? | #19 |
|
|---|---|---|---|
|
Moderator
![]()
Joined: 2009/9/24
From Brighton, UK
Posts: 6322
|
Yum doesn't check a directory but perhaps you could do "clever" tricks with substituting different /var/lib/rpm directories though this sounds somewhat dangerous and unpredictable to me.
|
||
|
_________________
Linux/VoIP Systems Administrator |
|||
Posted on: 2012/3/2 9:10
|
|||
|
Re: Can yum be used to update a directory instead of the running system? | #20 |
|
|---|---|---|---|
|
Peeking in the Member Window
![]()
Joined: 2012/3/1
From
Posts: 13
|
Can you please point me some documentation about how yum works, as deep as possible?
I suppose I can look into the source code but I would like to avoid that if there any kind of higher-level description of the logic/actions that yum implements. Thanks, Adi |
||
Posted on: 2012/3/6 22:42
|
|||
Top Previous Topic Next Topic |
|
|



Topic options
Print Topic
Threaded
Newest First
cadi




You cannot start a new topic.
You can view topic.