Installing Homebrew Apps With A Rooted Pre

If you have already rooted your pre and prefer to install apps from the command line, read on..

Prerequisites:
1) Access Linux on your Pre

2) Ipkg-opt & unprivileged user installed & configured

3) Dropbear/OpenSSH installed

4) Connect & Log Into the Pre (I'm very partial to using usbnet)

= Assumptions:= 1) You are using PuTTY to connect to the Pre

2) You will make a SSH connection to the Pre

Using USB Drive Mode
//Download the .ipk with your web browser and get it to your Pre// 1) Download the .ipk with your favorite web browser 2)  Connect your Pre with the USB cable 3) On the Pre, choose USB Drive mode 4)  Copy & Paste the .ipk to the Pre

//Back on the Pre, move the files to your home directory// 5) sudo mv /media/internal/homebrew_app.ipk ~

//Mount the filesystem writeable// 6) sudo mount -o remount,rw / //Use ipkg-opt to install the .ipk// 7)  sudo ipkg-opt install homebrew_app.ipk //Remount the filesystem read only// 8) sudo mount -o remount,ro / //Restart Luna (Phone GUI) to make the new app show up.  Your Pre's screen will freeze when Luna stops.  After the start command is issued, it will look like the Pre has rebooted but is only the GUI restarting.// 9 )  sudo /sbin/stop LunaSysMgr 10) sudo /sbin/start LunaSysMgr //Check out the Launcher to see if the app has been correctly installed.//

Quick example of installing "Snake" by Janni Kovacs
1) Follow steps 1-4 2)  sudo mv /media/internal/de.umass.snake_0.1.1_all.ipk ~ 3) sudo mount -o remount,rw / 4)  sudo ipkg-opt install de.umass.snake_0.1.1_all.ipk 5) sudo mount -o remount,ro / 6)  sudo /sbin/stop LunaSysMgr 7) sudo /sbin/start LunaSysMgr

Using wget
//Locate the link to the .ipk you wish to install and wget it// 1) wget http://www.domain.org/path/to/homebrew_app.ipk //Mount the filesystem writeable// 2)  sudo mount -o remount,rw / //Use ipkg-opt to install the .ipk// 3) sudo ipkg-opt install homebrew_app.ipk //Remount the filesystem read only// 4)  sudo mount -o remount,ro / //Restart Luna (Phone GUI) to make the new app show up. Your Pre's screen will freeze when Luna stops. After the start command is issued, it will look like the Pre has rebooted but is only the GUI restarting.// 5) sudo /sbin/stop LunaSysMgr 6)  sudo /sbin/start LunaSysMgr //Check out the Launcher to see if the app has been correctly installed.//

Quick example of installing "Snake" by Janni Kovacs
1) wget http://u-mass.de/software/de.umass.snake_0.1.1_all.ipk 2)  sudo mount -o remount,rw / 3) sudo ipkg-opt install de.umass.snake_0.1.1_all.ipk 4)  sudo mount -o remount,ro / 5) sudo /sbin/stop LunaSysMgr 6)  sudo /sbin/start LunaSysMgr

= Good Housekeeping™=

Some notes & recommendations for keeping your Pre nice and clean:

1) If you List Apps from the Launcher, anything you install **cannot** be removed from the GUI

2) Don't delete the source .ipk files

3) Make a subfolder in your home directory and move the .ipk files so you can uninstall later user@castle:~$ mkdir ipks user@castle:~$ mv *.ipk ipks

4) Remember to remove the old app before installing an updated app user@castle:~$ cd ipks user@castle:~/ipks$ sudo mount -o remount,rw / user@castle:~/ipks$ sudo ipkg-opt remove homebrew_app.ipk user@castle:~/ipks$ sudo mount -o remount,ro / user@castle:~/ipks$ sudo /sbin/stop LunaSysMgr user@castle:~/ipks$ sudo /sbin/start LunaSysMgr

= What if uninstall by .pkg name doesn't work?=

The solution is to list the installed packages, locate the simple name of the package, then uninstall. Assuming you kept the ipkg, derive the name of the package. If the package is de.umass.snake_0.1.1_all.ipk then search for the part leading up to the first underscore (de.umass.snake). For example: 1) sudo ipkg-opt list > list.txt 2) joe list.txt 3) press ctrl+k, f 4) type de.umass.snake & hit enter twice 5) if it finds the text, then you've verified the package name 6) press ctrl+c twice 7) sudo ipkg-opt remove de.umass.snake

You can use vi, nano, or whatever editor you have installed, the above example uses joe. If you can't find the package name, try shortening the search and be more general.

= Rationale=

These instructions are for those who have already rooted their Pre and don't want to set up the Emulation/SDK Environment for the Pre.

= Things to investigate:= 1) Is mounting / really necessary?

2) What happens if ipkg is used instead of ipkg-opt?  (can you remove the app from the launcher?)

3) What is safer?  start/stop LunaSysMgr or calling the rescan  function?