The following is a how-to for setting up WinBUGS on the latest version of Ubuntu 10.04 LTS Lucid Lynx.
1. Install wine-1.0 not wine-1.2 (wine-1.2 will seg fault!)
sudo apt-get install wine-1.0
2. Download WinBUGS from here.
3. Navigate to the directory where you downloaded WinBUGS, I’ll assume it was /home/user/Downloads, and run the following:
wine WinBUGS14.exe
4. Launch WinBUGS
wine ~/.wine/drive_c/Program Files/WinBUGS14/WinBUGS14.exe
5. Patch WinBUGS with the following patch – available here. Apply that patch as described on the WinBUGS website. Then close WinBUGS and launch it again as previously described.
6. Add the immortality key – available here. Apply it the same way you did the patch!
7. Launch R and install R2WinBUGS
R
install.packages("R2WinBUGS")
8. Load R2WinBUGS and run the Gelman example to check that it worked
library(R2WinBUGS)
model.file <- system.file(package="R2WinBUGS","model",
"schools.txt")
data(schools)
J <- nrow(schools)
y <- schools$estimate
sigma.y <- schools$sd
data <- list ("J", "y", "sigma.y")
inits <- function(){
list(theta=rnorm(J, 0, 100), mu.theta=rnorm(1, 0, 100),
sigma.theta=runif(1, 0, 100))
}
parameters <- c("theta", "mu.theta", "sigma.theta")
schools.sim <- bugs(data, inits, parameters, model.file, n.chains=3, n.iter=5000)
print(schools.sim)
plot(schools.sim)
You will get a couple of messages from Wine, but I believe you can ignore these. I have not thoroughly tested this but I can corroborate that it gives similar estimates to R2WinBUGS from Windows (see below gnome-terminal vs. Windows XP in VirtualBox). I still recommend JAGS but if you need to use WinBUGS here is how.
Also this should work on any Linux distribution or Mac OS X provided that you can get Wine 1.0 as the latest Wine versions do not work with WinBUGS. Let me know if you have troubles.

9. Add a desktop launcher (OPTIONAL)
Right Click gnome-panel
Click 'Add to Panel ...'
Click 'Custom Application Launcher'
Add the following to the Name field
WinBUGS14
Add the following to the Command field (do include the quotes!)
wine '/home/USER/.wine/drive_c/Program Files/WinBUGS14/WinBUGS14.exe'
Finally, if you want to add the WinBUGS icon, click here. Right click the image and select:
Save image as ...
Save it to /home/user/Downloads/ and then add it by clicking the Wine icon, navigating to the directory where you downloaded it and finally selecting the icon. Then close the Custom Application Launcher dialog box by clicking Close.