Tips on downgrading applications

By Rob Griffiths, Macworld.com |  Software, applications Add a new comment

Recently, after swapping a couple of machines (I sent my first-generation Intel-based Mac mini back to the Macworld offices, and we bought an iMac for the kids and general use), I realized that I had inadvertently also disabled my locally-hosted Web sites: I used to use the mini as a local Web server, and it served out copies of the Mac OS X Hints site, as well as the various family sites I maintain. I didn't really want to keep the iMac running all the time just to have the Web server running, so I decided to move the server to my Mac Pro.

While OS X ships with a built-in Web server, it doesn't ship with MySQL, the database engine that enables sites such as macosxhints.com to work. Installing it is relatively straightforward--there are OS X installer versions available on the MySQL site. About the only trick comes in choosing which version of MySQL to install--some content management systems only work with certain versions. In my case, I wanted MySQL 4.1 for compatibility with the macosxhints.com site. Unfortunately, I managed to download and install version 5.0 without noticing. As soon as I noticed the problem, I downloaded the 4.1 package, and attempted to install it. The installer, however, refused to proceed, telling me there was already a newer version of MySQL installed.

Since the installer didn't want to install due to the presence of the newer version of MySQL, I thought I'd first get rid of that newer version. In the case of MySQL, all the code lives in the /usr/local/mysql directory, which is actually a symbolic link (like an alias in the Finder) to a directory with a much longer name. So in Terminal, I issued a sudo rm -r /usr/local/mysql-long-directory-name to remove all the MySQL code. Note that this command will delete all of your MySQL databases in addition to MySQL itself! In my case, I didn't care, because I hadn't yet migrated the databases over to the Mac Pro.

I then tried to run the installer again, but it still failed, saying a newer version was installed. After some thinking, I remembered the /Library/Receipts folder--this is where installers write out records of what they did. Perhaps, I thought, the MySQL installer is looking at the Receipts folder, seeing the MySQL 5.0 receipt, and using that as the basis for stopping the install.

In Terminal, I did cd /Library/Receipts, and then ls -d mysql* to see what was there. Sure enough, I found a receipt for the MySQL 5 installation, named something like mysql-standard-5.0.67-apple-darwin8.5.1-i686.pkg. I deleted that directory (sudo rm -r mysql-standard...), and then ran the 4.1 installer again. Success! The 4.1 install ran fine, I then moved over my databases, and had the internal web server up and running again a few minutes later. OK, so it was several hours later; it just seemed like a few minutes!

Generalizing from my experiences with MySQL, here's the process I would follow to downgrade a program that was installed with Apple's installer:

1. Run the installer for the new version again. If you're lucky, they'll be an uninstall option. If so, use that, then install the old version. Also look for an uninstaller hiding in the application's folder, if it has one.

2. If there's no uninstaller, remove all traces of the new program from your machine. Start by looking at the program's receipts folder in /Library/Receipts in Terminal. You should see a top-level receipts folder, which you can cd into.

From there, use ls and cd until you find a file whose name ends in .bom. This file will usually (but not always) reside in the Contents folder and be named Archive.bom. Once you've found the file, type lsbom Archive.bom | more and press Return. This will show you exactly which files the installer wrote to your system.

In most cases, it will also show you the full path to those files. Use this data to delete all traces of the newer program from your system. In the case of MySQL, unfortunately, this file isn't much help, as it doesn't show the final install path. If that's the case for your program, too, you'll have to resort to searching your system (or Google searching for help) to find and eliminate all the parts.

3. After removing all the program's parts, remove the actual receipts folder from the /Library/Receipts folder. You'll need to use sudo rm -r receipts_folder_name, as changes to this directory require admin authorization.

4. Once you've removed all the parts and the receipts file, run the installer for the older version of the program, and it should work just fine.

Of course, there's a big bold caution that goes with these instructions: when you're messing around with removing installed versions of programs, you can damage things--you could inadvertently remove a system-owned file, for instance, or miss a piece of the code that then messes up your downgrade. Proceed at your own risk.

Perhaps at some point in the future, OS X will have easy snapshots and restore points, as has been possible on Windows for quite a while now. Until then, though, downgrading will be something of a trial-and-error process.

    Add a comment

    Post a comment using one of these accounts
    Or join now
    At least 6 characters

    Note: Comment will appear soon after you have activated your account.
    Obscene/spam comments will be removed and accounts suspended.
    The information you submit is subject to our Privacy Policy and Terms of Service.

    ITworld LIVE

    SoftwareWhite Papers & Webcasts

    White Paper

    Best Practices Guide: Microsoft Exchange 2010 on VMware

    This guide provides best practice guidelines for deploying Exchange Server 2010 on vSphere.

    White Paper

    Free Trial: vRanger, the Powerful VMware Recovery Solution

    When disaster strikes, don't waste hours and dollars recovering critical data. vRanger delivers blazing-fast speed and granular recovery for your VMware applications and data. Get your free trial today.

    White Paper

    Executive Guide to Business and Software Requirements

    This paper is designed as an executive briefing on the issues surrounding business and software requirements. It features a wealth of statistics and tactics to help you get requirements right, and includes a tear-out single page summary.

    White Paper

    How to Launch a Successful IT Automation Initiative

    Corporations across all industries are under increasing pressure to cut costs and work more efficiently. In the race to meet both of these requirements, many organizations turn to technology, often purchasing and installing disparate pieces of software in hopes of achieving efficiencies not afforded by manual systems.

    White Paper

    Why Corporations Need to Automate IT Systems Management

    With corporate budgets being slashed and leaders expecting more out of their employees, companies are forced to do more with less, yet are still expected to provide the highest quality experience to customers. This is pushing them to make better use of their IT assets without breaking the budget. Companies are under more pressure than ever, thanks to data management regulations; increasingly complex security threats; and growing demand from management and end users for 24/7 uptime and high performance. These hurdles require a strategic investment in technologies that boost efficiency, save money and position IT as an integral part of the entire firm's operations. IT systems management is helping corporations fill these gaps.

    See more White Papers | Webcasts

    Ask a question

    Ask a Question