Forum

[HOW-TO] Updating PlayOnLinux on Backtrack 5 R3

How to update Wine and PlayOnLinux in Backtrack 5

Författare Svar
levi.tillie3 Saturday 25 August 2012 at 18:14
levi.tillie3Anonymous

How to Update Wine and PlayOnLinux on Backtrack 5 R3

WARNING: THIS ALSO ENABLES PLAYONLINUX TO RUN AS ROOT, WHICH IS NECESSARY!!!!!

Step 1: Adding Necessary Repositories

The first step to updating PlayOnLinux is to add what are considered "third-party" repositories to your installation, as the latest Wine and PlayOnLinux packages are not on the default repositories.

The first repository you will need to add is the WineHQ repository. All you need to do is open a terminal window, whether it is xterm, konsole, or some other, it doesn't matter. (If you are using Backtrack, you should be familiar with this procedure). Type this command or copy and paste it into your terminal window:

add-apt-repository ppa:ubuntu-wine/ppa

Next, add the PlayOnLinux repository by typing this:
wget -q "http://deb.playonlinux.com/public.gpg" -O- | apt-key add -
wget http://deb.playonlinux.com/playonlinux_lucid.list -O /etc/apt/sources.list.d/playonlinux.list

Step 2: Update Your Sources and Upgrade Already-Installed Packages

The next thing you will need to do is update your repositories and upgrade all packages. To do this all you need to do is type this in terminal:
apt-get update && apt-get dist-upgrade

Make sure you type 'Y' (without quotes) when asked.

If you already had PlayOnLinux installed, then you can skip to Step 4. If not or you don't know, then...

Step 3: Installing PlayOnLinux


This is extremely simple, just type this in terminal:
apt-get install playonlinux

Once again, remember to answer 'Y' when asked.


Step 4: Configuring PlayOnLinux to Run as Root


Unfortunately, allowing PlayOnLinux to run as root is completely necessary in order to use it on Backtrack. There are 2 options for using PlayOnLinux within Backtrack, the 1st I will not be explaining, as it is explained many places elsewhere and is fairly easy to look up, and that is to add a separate, non-root, user to your installation, then login and run PlayOnLinux via that user.

The second, which I will be showing you, will require the modification of 2 files in your POL installation. The 1st is located at /usr/share/playonlinux and is called sources

It can be modified like this:
nano /usr/share/playonlinux/sources


'nano' can, of course be replaced with any of your favorite text editors, like gedit, kwrite, vim, or your prefered IDE such as geany.


You will need to change the lines looking like this:
if [ "$(id -u)" = "0" ]
then
echo "PlayOnLinux is not supposed to be run as root. Sorry"
exit
fi


To look like this:
#if [ "$(id -u)" = "0" ]
#then
# echo "PlayOnLinux is not supposed to be run as root. Sorry"
# exit
#fi


Save it, and close is

The next file you will have to modify is located in /usr/share/playonlinux/python and is called mainwindow.py. You can start editing with this command:nano /usr/share/playonlinux/python/mainwindow.py


Once again, feel free to use whichever editor you like best.
You will need to change the lines that look like this:
#### Root uid check
if(os.popen("id -u").read() == "0\\n" or os.popen("id -u").read() == "0"):
wx.MessageBox(_("{0} is not supposed to be run as root. Sorry").format(os.environ["APPLICATION_TITLE"]),_("Error"))
os._exit(0)


To this:
#### Root uid check
#if(os.popen("id -u").read() == "0\\n" or os.popen("id -u").read() == "0"):
# wx.MessageBox(_("{0} is not supposed to be run as root. Sorry").format(os.environ["APPLICATION_TITLE"]),_("Error"))
# os._exit(0)


Save it and you're all done! NOTE: You will have to redo Step 4 after POL gets an update, when it does. Thanks for reading, hope it helped someone! Please comment if you have any questions or improvements!
petch Saturday 25 August 2012 at 21:36
petch


You can also create non-root users on Backtrack:
http://www.backtrack-linux.org/forums/showthread.php?t=1741
levi.tillie3 Saturday 25 August 2012 at 23:09
levi.tillie3Anonymous

Yes, I actually mentioned that if you read through Step 4.
levi.tillie3 Saturday 25 August 2012 at 23:11
levi.tillie3Anonymous

But, unfortunately, some would not want to bother with the creation of a separate user, just for the enjoyment of POL. I myself did that, but decided I did not like that route, so I pursued this, alternative, route.
petch Sunday 26 August 2012 at 0:07
petch

Everyone else out there does that, I can hear their shriek in pain from here.

Anyway, let's just say we won't give any support from people using a similar setup.

levi.tillie3 Sunday 26 August 2012 at 3:46
levi.tillie3Anonymous

I figured this post would receive a similar response, so I put the giant warning at the top.
oliver_me03 Tuesday 23 April 2013 at 16:41
oliver_me03Anonymous

For "Step 4: Configuring PlayOnLinux to Run as Root", 'sources' file is located in "/usr/share/playonlinux/lib" (PlayOnLinux 4.2.1).

When tried steps indicated, PlayOnLinux does not start at all. Since I don't know yet how to read that kind of stuff, I don't put '#' on message prompt, just customized it to a different message :D

Just put '#' on the exit commands :)

Thanks for this post :)
Ronin DUSETTE Tuesday 23 April 2013 at 18:23
Ronin DUSETTE

Well, this post was from Aug. last year, so it may not be up-to-date anymore. It is kind of a hack-and-slash way to get it working. Backtrack is for security and penetration testing. Im not sure which Windows programs would be used (or even wanted) in place of the huge plethora of Linux-based penetration testing tools.

Locking, as we really cannot support running POL as root.

Please:
Post debug logs & full computer specs in first post
No private messages for general help, use the forums
Read the wiki, Report broken scripts