Need a script that does the following:
Greetings,
I cannot get 'yum update' on a CentOS 5 box to work through our proxy server at work, and am now looking for a workaround. I am thinking that a script (bash, perl, etc) to do: 1. Take the output of 'yum check-update' and parse out everything but the package name. 2. Take the list of packages and retrieve them to a local directory with wget. 3. Update the box with 'yum localinstall' 4. Delete the updates after successful install. I am working on a script, but thought would check here in case someone has done this already, or can bang something together quicker than I can. Thanks, Hackhound |
Quote:
Quote:
Quote:
|
Quote:
[Errno -1] Header is not complete. Quote:
Quote:
#!/bin/bash cd yum-updates yum check-update > update.log sed '1,5d' update.log > yum1.log awk '{print $1}' yum1.log > yum2.log for i in $( cat yum2.log ); do echo $i done Next steps would be to replace the 'echo $i' with the wget command, then run yum localinstall, then delete the file. Like I said, not the nicest looking code, but I'm not an expert, and what I have so far is working. Hackhound |
Quote:
Quote:
|
Quote:
Quote:
|
Hmm. There apparently are no mirrors providing HTTPS but definately Rsync and FTP. Tried using "ftp://mirror.pacific.net.au/linux/fedora/linux" instead of "http://mirror.pacific.net.au/linux/fedora/linux" style URI's in your .repo file?
|
Quote:
Could not retrieve mirrorlist ftp://mirrorlist.centos.org/?release...h=i386&repo=os error was [Errno 14] HTTP Error 502: Bad Gateway Error: Cannot find a valid baseurl for repo: base I don't have any problem getting the mirrorlist, the problem occurs when yum tries to grab a package from one of the sites in the mirrorlist. Hackhound |
Quote:
|
Quote:
|
I don't know what you're doing but "ftp://mirrorlist.centos.org/?release=5&arch=i386&repo=os" does not exist. Next to that I think help should be a two-way street and since you haven't exactly been forthcoming with details. Here's a script: remember YMMV(VM).
Code:
#!/bin/sh - |
Quote:
Quote:
Quote:
|
NP, you're welcome. If you ever find a fix though I'd appreciate you posting a follow-up.
|
All times are GMT -5. The time now is 10:07 AM. |