January 2009

Don’t Use Zypper to Upgrade OpenSuse

OpenSuse gecko

I installed OpenSuse on my work computer and I’ve been really happy with it so far. Recently, OpenSuse came out with a new version 11.1 so I figured I would upgrade. Since this was my first time updating, I turned to google and the first result for “upgrade opensuse 11.1” is this page about zypper on the OpenSuse site. It sure sounds easy, just run zypper and OpenSuse will upgrade in the background.

But after 5 hours of installation fun (Want me to fall back to /dev/mapper/...?) I just wanted to warn people that this is not the way to go. Somehow zypper decided that my computer would function just fine without supporting the harddrive (RAID0) but I was forced to disagree with this point when my computer became unbootable. Luckily the installation DVD (after finally downloading) was able to fix the problem.

So if you’re planning on upgrading your OpenSuse, I would say it’s definitely worth just downloading the DVD and updating from that (which actually went really smoothly).

Yes I do (now) realize the zypper upgrade page says:

This method is unsupported. The official method of upgrading to a new release is by using the latest DVD. To start the upgrade you boot from the DVD and start installation, at some point you will be prompted to either do a New Installation or Upgrade, at that point you select Upgrade and continue with the setup.

But I didn’t realize that translated to really really don’t use this method. Anyway live and learn and now I know it’s really easy to upgrade from the DVD.

Bash/UNIX
Programmer

Comments (5)

Permalink

Converting .eps to .png Easily

I end up generating a lot of postscript plots in R and other programs. Unfortunately, a lot of not so technical people have trouble opening postscript files so I end up having to convert these images to other formats pretty often. A really handy program for converting eps files to png (or jpg although that’s not really an optimal format for plots) is ImageMagick (available for all OSs I believe). ImageMagick lets you quickly convert (and create thumbnails, make B&W,…) from the command line without having to open up Photoshop.

For example, to convert an image named myPlot.eps to png you just need to enter convert myPlot.eps myPlot.png (convert is a program in the ImageMagick package) at the command prompt and you’ll get a png file in myPlot.png. If you want to adjust the resolution (the default resolution is 72 dpi) of the output image, you can add the -density option (e.g. for 200 dpi convert -density 200 myPlot.eps myPlot.png). Make sure you put the -density part before the input image name.

Converting many files at once is where ImageMagick really shines. The mogrify command is probably the quickest option. For example, to convert the files image01.eps, image02.eps and image03.eps to png, just use the command mogrify -format png image*.eps. In one shot, it will create image01.png, image02.png and image03.png.

Unfortunately, recent version of Imagemagick seem to be treating eps to png conversions oddly (see below) so mogrify isn’t cutting it on my files. If you have similar trouble (and you’re on Unix or Mac or Cygwin), you can just use a bit of Bash combined with the convert command to get around the problem like this:

[bash] for f in `ls *.eps`; do convert -density 100 $f -flatten ${f%.*}.png; done [/bash]

Black Background Problem

As I mentioned above, I started having trouble converting from eps to png after upgrading to ImageMagick 6.4. The transparent/white backgrounds in my eps files were being converted to black backgrounds and making the figures unreadable. I guess it must be some change in how transparency is handled but I’m not totally sure what changed. It took me a bit of googling before I found the solution, so I’ll repost it here. Adding -flatten to the command (e.g. convert myImage.eps -flatten myImage.png) should change the background back to white. My mogrify command doesn’t include the -flatten option so convert (like the example above) seems like the way to go.

Bash/UNIX
Programmer

Comments (17)

Permalink