Mlopt, a script to keep your servers updated

Hi everybody this is my first post.
I was tired of having to check and see if the mirrors are %100 complete, so I wrote this.
#!/usr/bin/env python2
#Sort by speed
#Then sort by score
#It will never append incomplete servers
#Will exit at the first sign of no internet, (saves CPU)
#sudo crontab -eu root
#@hourly /usr/bin/mlopt
import urllib2
import json
import os
from time import gmtime, strftime
server_info = {}
curr_servers = []
arch = "$repo/os/x86_64"
os.system("rankmirrors -n 5 /etc/pacman.d/mirrorlist.mlchk > /etc/pacman.d/mirrorlist.fast")
try:
mirrorlist = open("/etc/pacman.d/mirrorlist.fast").read().split("\n")
except:
exit(1)
for line in mirrorlist:
if line.startswith("#") or line == "":
continue
try:
t = line.split("Server = ")[-1]
curr_servers.append(t.split("/")[0] + "//" + t.split("/")[1] + t.split("/")[2])
except:
os.system('notify-send "Mirror-Update" "There is a error in your mirrorlist"')
exit(1)
try:
page = json.loads(urllib2.urlopen("http://www.archlinux.org/mirrors/status/json/").read())
except:
exit(1)
for segment in page['urls']:
for server in curr_servers:
if segment['url'].startswith(server): #Hax
if segment['completion_pct'] != 1.0: #Dont even append if its not %100
continue
else:
server_info["%s%s" % (segment['url'], arch)] = segment['score']
try:
new_list = open("/etc/pacman.d/mirrorlist", "w")
new_list.write("#"+strftime("%a, %d %b %Y %H:%M:%S +0000", gmtime())+"\n")
new_list.write("#Generated by mirror-list\n")
except:
exit(1)
for key, value in sorted(server_info.iteritems(), key=lambda (k,v): (v,k)): #http://www.saltycrane.com/blog/2007/09/how-to-sort-python-dictionary-by-keys/
new_list.write("Server = %s\n" % (key))
os.system('notify-send "Mirror-Update" "Mirrorlist updated"')
You will have to make a "/etc/pacman.d/mirrorlist.mlchk" which it will read from and generate a new list called "/etc/pacman.d/mirrorlist.fast".
Just run "sudo cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.mlchk"
It will sort them by score and create your new "/etc/pacman.d/mirrorlist". (It will not append the server if it not %100 complete)
I have mine under /usr/bin/mlopt
You will need the rankmirrors bash script and Python2.6.
Last edited by stealthy (2011-05-13 17:18:04)

An empty mirrorlist.mlchk will produce an empty mirrorlist (which will leave you unable to get new packages including pacman-mirrorlist).
Also, your script explicitly names the architecture in the mirrorlist file. Afaik it should just be $arch.
But it works and it's very handy, so thanks!
Regards,
mikar
Last edited by demian (2011-05-13 17:32:39)

Similar Messages

  • Keeping your servers up-to-date with patches

    Hello All,
    Please note that this is NOT a WSUS question. I have that installed in our environment and I know how to use it, or at least I like to think I do. I am a System Admin of a completely virtualized environment. As our company grows, more and more servers have
    been built and keeping up with the latest patches has become a challenge. So I am looking for some advice from users who have more experience here than I do.
    Up to this point, we have been updating the virtual machines as we do the ESX(i) hosts. This was okay when there were fewer machines. Now, if there are 20 or more VMs on a single host, it is just too time consuming. Also, as we add more hosts, we fall behind
    with the updates. So, I am thinking we can keep on top of it better if I can separate the ESX(i) updates from the Windows Updates. So perhaps I can update a different group of VMs each day. Production VMs will need to wait until the weekend of course. I am
    thinking I will create a new group in WSUS that has all of the latest updates approved and then move the VMs into that group as I am ready to do each machine. I manually approve the updates but I can probably auto-approve critical updates. 
    Anyway, for those of you who who work in larger environments and keep on top of Windows updates for servers, how do you do it? What are your best practices? All of our desktop computers automatically install updates in the late-night hours but we obviously
    cannot do that with servers. Let me know if you have any questions or need more information. Thanks for the help.
    -Adam

    Yeah it's a tricky balance. Well you could always choose option 2 to simply notify that there are updates awaiting installation, so they don't get downloaded until you tell a machine to update. Obviously the downside to that is having to wait while a potentially
    large download happens (though if it's over the local network it shouldn't take too long). So you centrally control what is deployed to the servers, and get all the servers retrieving the data over the local network rather than having to download the updates
    over the internet, but keep the actual download and install part as a manual process.
    For desktop machines I tend to allow auto-approval and installation since the risk of a user doing something bad with an unpatched machine is higher than the risk of the update having issues. For servers though I never auto-approve, and prefer to manually
    go through approving the latest updates for the servers once I've had a chance to confirm there are no reports of issues with the updates. Even then I tend to stagger rolling out the updates minimise any issues, and where possible test them first on staging
    servers or servers which aren't as critical. I tend to look at it in terms of the two risks. The risk of the vulnerability being exploited vs the risk to the server if something went wrong. For a public facing / user facing server then the risk tends to sway
    towards installing earlier, where as backend servers that are never directly connected to are less at risk. Additionally, things like IE updates while critical on a desktop really aren't important on a server, so can safely wait for a while. Any sysadmin that
    goes surfing from a server shouldn't be in the job.
    Thank you again. But a similar problem remains with the second option of the notification without the download. A user will still be notified that updates are ready to be downloaded and then choose to do so. So at that point it's probably better to have
    the updates downloaded and ready to install. All of our servers report to WSUS so none of them hit the internet which makes sense considering most of the workstations are on the same LAN as the WSUS server so it's pretty quick. 
    As of run now, I don't schedule the synchronizations continually. I manually run them, update each group of computers in WSUS until all are green, and then run the synchronization again and repeat. An obvious disadvantage to this is that we won't have the
    latest updates available until I get through all of the groups and run the synchronization again! So that leaves us vulnerable. I also manually approve each update. People sometimes call me crazy but I have seen WSUS auto-approve updates in the past which
    I did not want pushed out, so I play it safe. 
    Thank you for all of the help!

  • On a single app subscription on muse cc you gotta keep your plan updated so your website can stay up

    God bless. I got a Single plan on Muse i'm planing to creat my own website. My question can i still keep my website up if i still pay my monthly payment on creative cloud? or is there another way to do this/ thx .. or what plan you'll recommend? i like using other apps too. i like using Photoshop, After effect and muse.

    Hi
    With Muse subscription , you can create site and publish on Adobe servers.
    The subscription includes one site free count , so you can use that and upload your site , the published site would be in web hosting site plan.
    Unless you are changing your site plan, you wont have to pay anything extra.
    Please contact support directly for more details as they can provide you more details on your account.
    Thanks,
    Sanjit

  • My 3.6.14 keeps trying to update and gives this error message:"The update could not be installed. Please make sure there are no other copies of Firefox running on your computer, and then restart Firefox to try again."

    My OS is Windows XP version service pack 3. I even tried to install FF4 but it never get installed. As I mentioned my FF keeps trying to update itself but it gives the error message I provided in title. Now I don't have access to my FF browser and my life is stopped because I have all my passwords saved on FF. I restarted my notebook but it stills try to update itself giving the same error message. I can not also upgrade my Adobe reader 7.0.7 to 10 I have tried more than 10 times but it never gets upgraded. I had this Adobe problem since long time ago.

    Run the Firefox program once as Administrator (right-click: Run as Administrator).<br />
    If that doesn't help then do a clean reinstall.
    Do a clean (re-)install:
    * Download a fresh Firefox copy and save the file to the desktop.
    * http://www.mozilla.com/firefox/all.html
    * Uninstall your current Firefox version and remove the Firefox program folder before installing that copy of the Firefox installer.
    * Don't remove personal data if you uninstall the current version.
    * It is important to delete the Firefox program folder to remove all the files and make sure that there are no problems with files that were leftover after uninstalling.
    Your bookmarks and other profile data are stored elsewhere (not in the Firefox program folder) and won't be affected by a reinstall, but make sure that you do not select to remove personal data if you uninstall Firefox.

  • Beware latest itunes update will not let you keep your old password.

    updates are stupid. The letest apple itunes update will not let you keep your old password.
    Probably pertains to those of us who have kept same password for apple id since inception. New rules make you do all sorts of stupid characters instead of keeping it simple.

    sam it sounds like ur password has a low level of security and new update wants to to make it stronger
    when it askes to to make ur password just put ur old one back in but replace some letters with caps and numbers
    i got them same thing when i updated mine to the new version

  • What is the best way to keep your macbook pro in tip top condition. performance wise

    What is the best way to keep the performance of a macbook pro in tip top shape.  Over the years my computer seems to act like a pc with all of its hicups and lockups.
    I am running mountain lion and this computer is approx 2 years old.
    Not sure if there is some sort of software that will help with this or is there something else I can do.
    Thanks
    GAJ

    How to maintain a Mac
    1. Make redundant backups, keeping at least one off site at all times. One backup is not enough. Don’t back up your backups; all should be made directly from the original data. Don’t rely completely on any single backup method, such as Time Machine. If you get an indication that a backup has failed, don't ignore it.
    2. Keep your software up to date. In the App Store or Software Update preference pane (depending on the OS version), you can configure automatic notifications of updates to OS X and other Mac App Store products. Some third-party applications from other sources have a similar feature, if you don’t mind letting them phone home. Otherwise you have to check yourself on a regular basis.
    Keeping up to date is especially important for complex software that modifies the operating system, such as device drivers. Before installing any Apple update, you must check that all such modifications that you use are compatible. Incompatibility with third-party software is by far the most common cause of trouble with system updates.
    3. Don't install crapware, such as “themes,” "haxies," “add-ons,” “toolbars,” “enhancers," “optimizers,” “accelerators,” "boosters," “extenders,” “cleaners,” "doctors," "tune-ups," “defragmenters,” “firewalls,” "barriers," “guardians,” “defenders,” “protectors,” most “plugins,” commercial "virus scanners,” "disk tools," or "utilities." With very few exceptions, such stuff is useless or worse than useless. Above all, avoid any software that purports to change the look and feel of the user interface.
    It's not much of an exaggeration to say that the whole "utility" software industry for the Mac is a fraud on consumers. The most extreme examples are the "CleanMyMac" and “MacKeeper” scams, but there are many others.
    As a rule, the only software you should install is that which directly enables you to do the things you use a computer for, and doesn't change the way other software works.
    Safari extensions, and perhaps the equivalent for other web browsers, are a partial exception to the above rule. Most are safe, and they're easy to get rid of if they don't work. Some may cause the browser to crash or otherwise malfunction.  Some are malicious. Use with caution, and install only well-known extensions from relatively trustworthy sources, such as the Safari Extensions Gallery.
    Never install any third-party software unless you know how to uninstall it. Otherwise you may create problems that are very hard to solve. Do not rely on "utilities" such as "AppCleaner" and the like that purport to remove software.
    4. Don't install bad, conflicting, or unnecessary fonts. Whenever you install new fonts, use the validation feature of the built-in Font Book application to make sure the fonts aren't defective and don't conflict with each other or with others that you already have. See the built-in help and this support article for instructions. Deactivate or remove fonts that you don't really need to speed up application launching.
    5. Avoid malware. Malware is malicious software that circulates on the Internet. This kind of attack on OS X was once so rare that it was hardly a concern, but malware is now increasingly common, and increasingly dangerous.
    There is some built-in protection against downloading malware, but you can’t rely on it — the attackers are always at least one day ahead of the defense. You can’t rely on third-party protection either. What you can rely on is common-sense awareness — not paranoia, which only makes you more vulnerable.
    Never install software from an untrustworthy or unknown source. If in doubt, do some research. Any website that prompts you to install a “codec” or “plugin” that comes from the same site, or an unknown site, is untrustworthy. Software with a corporate brand, such as Adobe Flash Player, must come directly from the developer's website. No intermediary is acceptable, and don’t trust links unless you know how to parse them. Any file that is automatically downloaded from the web, without your having requested it, should go straight into the Trash. A web page that tells you that your computer has a “virus,” or that anything else is wrong with it, is a scam.
    In OS X 10.7.5 or later, downloaded applications and Installer packages that have not been digitally signed by a developer registered with Apple are blocked from loading by default. The block can be overridden, but think carefully before you do so.
    Because of recurring security issues in Java, it’s best to disable it in your web browsers, if it’s installed. Few websites have Java content nowadays, so you won’t be missing much. This action is mandatory if you’re running any version of OS X older than 10.6.8 with the latest Java update. Note: Java has nothing to do with JavaScript, despite the similar names. Don't install Java unless you're sure you need it. Most people don't.
    6. Don't fill up your boot volume. A common mistake is adding more and more large files to your home folder until you start to get warnings that you're out of space, which may be followed in short order by a boot failure. This is more prone to happen on the newer Macs that come with an internal SSD instead of the traditional hard drive. The drive can be very nearly full before you become aware of the problem.
    While it's not true that you should or must keep any particular percentage of space free, you should monitor your storage use and make sure you're not in immediate danger of using it up. According to Apple documentation, you need at least 9 GB of free space on the startup volume for normal operation.
    If storage space is running low, use a tool such as OmniDiskSweeper to explore the volume and find out what's taking up the most space. Move seldom-used large files to secondary storage.
    7. Relax, don’t do it. Besides the above, no routine maintenance is necessary or beneficial for the vast majority of users; specifically not “cleaning caches,” “zapping the PRAM,” "resetting the SMC," “rebuilding the directory,” "defragmenting the drive," “running periodic scripts,” “dumping logs,” "deleting temp files," “scanning for viruses,” "purging memory," "checking for bad blocks," "testing the hardware," or “repairing permissions.” Such measures are either completely pointless or are useful only for solving problems, not for prevention.
    To use a Mac effectively, you have to free yourself from the Windows mindset that every computer needs regular downtime maintenance such as "defragging" and "registry cleaning." Those concepts do not apply to the Mac platform. A computing device is not something you should have to think about very much. It should be an almost transparent medium through which you communicate, work, and play. If you want a machine that is always whining for your attention like a neurotic dog, use a PC.
    The very height of futility is running an expensive third-party application called “Disk Warrior” when nothing is wrong, or even when something is wrong and you have backups, which you must have. Disk Warrior is a data-salvage tool, not a maintenance tool, and you will never need it if your backups are adequate. Don’t waste money on it or anything like it.

  • HT201210 keeps saying "ipod update server could not be contacted or is temporarily unavailable" when i try and restore my ipod touch..any ideas?

    keeps saying "ipod update server could not be contacted or is temporarily unavailable" when i try and restore my ipod touch..any ideas?

    Try:
    - Powering off and then back on your router.
    - iTunes for Windows: iTunes cannot contact the iPhone, iPad, or iPod software update server
    - Change the DNS to either Google's or Open DNS servers
    Public DNS — Google Developers
    OpenDNS IP Addresses
    - Try on another computer/network
    - Wait if it is an Apple problem

  • Keeping your mac healthy

    How can i know if my mac is healthy and how can i keep track on how its doing?

    How to maintain a Mac
    1. Make redundant backups, keeping at least one off site at all times. One backup is not enough. Don’t back up your backups; make them independent of each other. Don’t rely completely on any single backup method, such as Time Machine. If you get an indication that a backup has failed, don't ignore it.
    2. Keep your software up to date. In the Software Update preference pane, you can configure automatic notifications of updates to OS X and other Mac App Store products. Some third-party applications from other sources have a similar feature, if you don’t mind letting them phone home. Otherwise you have to check yourself on a regular basis. This is especially important for complex software that modifies the operating system, such as device drivers. Before installing any Apple update, you must check that all such modifications that you use are compatible.
    3. Don't install crapware, such as “themes,” "haxies," “add-ons,” “toolbars,” “enhancers," “optimizers,” “accelerators,” “extenders,” “cleaners,” "tune-ups," “defragmenters,” “firewalls,” "barriers," “guardians,” “defenders,” “protectors,” most “plugins,” commercial "virus scanners,” "disk tools," or "utilities." With very few exceptions, this sort of stuff is useless, or worse than useless.
    The more actively promoted the product, the more likely it is to be garbage. The most extreme example is the “MacKeeper” scam.
    As a rule, the only software you should install is that which directly enables you to do the things you use a computer for — such as creating, communicating, and playing — and does not modify the way other software works. Never install any third-party software unless you know how to uninstall it.
    The free anti-malware application ClamXav is not crap, and although it’s not routinely needed, it may be useful in some environments, such as a mixed Mac-Windows enterprise network.
    4. Beware of trojans. A trojan is malicious software (“malware”) that the user is duped into installing voluntarily. Such attacks were rare on the Mac platform until sometime in 2011, but are now increasingly common, and increasingly dangerous.
    There is some built-in protection against downloading malware, but you can’t rely on it — the attackers are always at least one day ahead of the defense. You can’t rely on third-party protection either. What you can rely on is common-sense awareness — not paranoia, which only makes you more vulnerable.
    Never install software from an untrustworthy or unknown source. If in doubt, do some research. Any website that prompts you to install a “codec” or “plugin” that comes from the same site, or an unknown site, is untrustworthy. Software with a corporate brand, such as Adobe Flash Player, must be acquired directly from the developer. No intermediary is acceptable, and don’t trust links unless you know how to parse them. Any file that is automatically downloaded from a web page without your having requested it should go straight into the Trash. A website that claims you have a “virus,” or that anything else is wrong with your computer, is rogue.
    In OS X 10.7.5 or later, downloaded applications that have not been digitally signed by a developer registered with Apple are blocked from loading by default. The block can be overridden, but think carefully before you do so.
    Because of recurring security issues in Java, it’s best to disable it in your web browsers, if it’s installed. Few websites have Java content nowadays, so you won’t be missing much. This action is mandatory if you’re running any version of OS X older than 10.6.8 with the latest Java update. Note: Java has nothing to do with JavaScript, despite the similar names. Don't install Java unless you're sure you need it. Most users don't.
    5. Don't fill up your boot volume. A common mistake is adding more and more large files to your home folder until you start to get warnings that you're out of space, which may be followed in short order by a boot failure. This is more prone to happen on the newer Mac notebooks that come with an internal SSD instead of the traditional hard drive. The drive can be very nearly full before you become aware of the problem. While it's not true that you should or must keep any particular percentage of space free, you should monitor your storage consumption and make sure you're not in immediate danger of using it up. According to Apple documentation, you need at least 9 GB of free space on the startup volume for normal operation.
    Use a tool such as the free application OmniDiskSweeper to explore your volume and find out what's taking up the most space. Move rarely-used large files to secondary storage.
    6. Relax, don’t do it. Besides the above, no routine maintenance is necessary or beneficial for the vast majority of users; specifically not “cleaning caches,” “zapping the PRAM,” "resetting the SMC," “rebuilding the directory,” “running periodic scripts,” “deleting log files,” “scanning for viruses,” or “repairing permissions.” Such measures are for solving problems as they arise, not for maintenance.
    The very height of futility is running an expensive third-party application called “Disk Warrior” when nothing is wrong, or even when something is wrong and you have backups, which you must have. Disk Warrior is a data-salvage tool, not a maintenance tool, and you will never need it if your backups are adequate. Don’t waste money on it or anything like it.

  • Safari keeps dropping servers

    What is up with Safari? It keeps dropping servers that I am currently connected too! Looks like a change to firefox if apple cannot get it's act together.

    If you are running v10.4.10 as your profile suggests, you need to update your system software.
    Use the v10.4.11 combo update for PowerPC.
    http://support.apple.com/downloads/Mac_OS_X_10_4_11_Combo_Update__PPC_

  • How can you keep your iPhone 4 (using it as my car's iPod) staying on the Audible app?  When I leave the car and return to continue hearing a book, it has switched to iTunes.

    How can you keep your iPhone 4 (using it as my car's iPod) staying on the Audible app?  When I leave the car and return to continue hearing a book, it has switched to iTunes.

    The first time an iPhone is connected to iTunes that is used to sync with another iPhone or iOS device, you are prompted to transfer the backup for the other iPhone or iOS device or to set up the iPhone as a new iPhone.
    The former does as provided - it transfers the backup for the other iPhone or iOS device to the iPhone replacing all data on the iPhone that is included with the backup being transferred. The latter does nothing allowing you to make your various selections for the iPhone sync preferences with iTunes.
    This is designed to be done right away with a new iPhone.
    If you don't have a backup for the iPhone with iTunes on your computer and don't have an iCloud backup that hasn't been updated since choosing to transfer the backup for your iPod Touch to the iPhone, the data that was on the iPhone is gone.

  • Keep your Firefox in Sync

    The page on this:
    https://support.mozilla.org/en-US/kb/how-do-i-set-up-firefox-sync?esab=a&s=Keep+your+Firefox+in+Sync&r=7&as=s
    is lame.
    It does not state, let alone clarify, whether the sync is one way or two way.
    In other words. Does this sync my primary firefox use, on my primary computer, with other devices, so that they see what I have done on my primary computer (what I want)
    OR
    Does it sync what I do on either device with the other?
    OR
    Can you choose which of these happens?
    NOTHING of this is mentioned on the page.
    AND there is no link to further information or settings.
    I guess I will stick with XMarks (in which all this is clearly stated)
    (To add to my disapointment here, there is no option to select to ensure being notified of responses!?)

    Sorry, the Firefox Sync service isn't available for new signups for the Sync service on versions of Firefox prior to Firefox 29, the latest release. Sync is available to current users of Sync, who have older versions of Firefox for a few more months - but my guess is that by the time Firefox 33 is out and the new ESR version is completely released, that compatibility period will end. Also, all device have be using the "old" or new version of Sync; once a Firefox Account is updated to the new Sync version it won;t connect to devices still using the old Sync version.
    As far as what Sync actually "synchronizes", the various types of data are user selectable per device - but overall the goal is to have all Firefox installations be a mirror of the other installations. Certain types of data sync ''(like tab and browsing history)'' is truncated on mobile devices, though.

  • How do you keep your purchased apps if you are forced to change your Apple ID?

    How do you keep your purchased apps if you are forced to change your Apple ID? A good example is if you are forced to change your email, which you use as your Apple ID.  what if it is a security app and you lose a lot of data if you lose the app? Why are the apps tied to the Apple ID rather than the user? Why is it impossible to globally change the Apple I D?

    All content is tied to the account, but you can change the primary email address on an account e.g. you can log into your account via the Store > View Account on your computer's iTunes and there should be an Edit button to the right of your account id on your account's page, or similarly on your iPad try tapping on your id in Settings > iTunes & App Store and view your account. Or you can update it by logging into it via this page http://appleid.apple.com . You shouldn't lose any content on the account if you update it.
    After updating the account you may need to log out of your iPad by tapping on your id in Settings > iTunes & App Store and then log back in with the updated version for it to be 'refreshed' on it

  • Macbook pro - iPhoto keep prompting to update after Yosemite update. Error message when trying to update -This update is not available for this Apple ID either because it was bought by a different user or the item was cancelled

    macbook pro - iPhoto keep prompting to update after Yosemite update. Error message when trying to update -This update is not available for this Apple ID either because it was bought by a different user or the item was refunded or cancelled. 

    I only have 1 apple ID and the same was used to set up this early 2011 macbook pro and iPhoto app. I don't want to loose out on any photos. I tried logging out of app store and back in but no luck. PLEEAASEE HELPP!!!
    This problem has been reported by quite a few forum members, who skipped the update to iPhoto 9.5.1 while running Mavericks. In that case try to purchase iPhoto again instead of updating.
    After making your backup try the following:
    Uninstall iPhoto by deleting it from the applications folder, but do not empty the Trash.
    Launch the App Store, click the "Store" menu, and sign in with your AppleID.
    Open the main page of the App Store and search for iPhoto.
    If iPhoto is listed as "Free", click the "Free" button to buy it with your current AppleID.
    If it is not showing as free, there is no help but contacting the App Store Support, as Niel pointed out: http://www.apple.com/support/mac/app-store/contact/

  • My adobe air desktop app keeps trying to update unsuccessfully

    my free adobe air desktop app keeps trying to update unsuccessfully
    whatever shall i do?
    thanks
    system
    Hardware Overview:
      Model Name: Mac Pro
      Model Identifier: MacPro3,1
      Processor Name: Quad-Core Intel Xeon
      Processor Speed: 2.8 GHz
      Number Of Processors: 2
      Total Number Of Cores: 8
      L2 Cache (per processor): 12 MB
      Memory: 10 GB

    Hello,
    I'm sorry you're having trouble. I'm fairly certain this problem is occurring on the Air side and not on the Acrobat.com side of things. Please try reposting your question in the Air forums.
    Good luck!
    Michelle

  • ...desperating trying to install itunes 10.7, but it asked me to install Mac OS X 10.6.8.  I did, but then it said that I needed to install Java for Mac OS x 10.6.  I did that and now it keeps saying 'this update requires Mac OS X version 10.6??

    ....desperating trying to install itunes 10.7, but it asked me to install Mac OS X 10.6.8.  I did, but then it said that I needed to install Java for Mac OS x 10.6.  I did that and now it keeps saying 'this update requires Mac OS X version 10.6??

    Upgrading to Snow Leopard
    You must purchase Snow Leopard through the Apple Store: Mac OS X 10.6 Snow Leopard - Apple Store (U.S.). The price is $19.99 plus tax. You will be sent physical media by mail after placing your order.
    After you install Snow Leopard you will have to download and install the Mac OS X 10.6.8 Update Combo v1.1 to update Snow Leopard to 10.6.8 and give you access to the App Store. Access to the App Store enables you to download Mountain Lion if your computer meets the requirements.
         Snow Leopard General Requirements
           1. Mac computer with an Intel processor
           2. 1GB of memory
           3. 5GB of available disk space
           4. DVD drive for installation
           5. Some features require a compatible Internet service provider;
               fees may apply.
           6. Some features require Apple’s MobileMe service; fees and
               terms apply.
    Actually, you cannot download Snow Leopard. You downloaded a Snow Leopard updater.

Maybe you are looking for