A short guide to install Midnight Commander on Android

This is the first time for me using adb. I had no prior experience with using nor connecting adb to my SGS. I understood i could list the devices using “adb devices”, but i didn’t figure out more than that until i actually set down to play with it.

Basically, adb is a terminal client to your SGS. to make adb work, you must enable “USB debugging” under Settings->Applications->Development on your Android device. If your device pops up a dialog when you connect it to the computer, asking you to allow mounting the device, select “Don’t mount” (if you allow mounting, adb can’t work at the same time). Thats it. You are now ready to open a shell on your SGS using “adb shell”.

So now we’re in the SGS shell from our linux console. ‘ls’ works just fine, busybox, the works. but… its missing something. Midnight Commander! So lets install mc on the SGS. One note though – mc will work only on your adb shell, since it doesnt work with touch-screen.

Follow this commands (or copy&paste in your terminal) to install mc. Once it is installed execute it using /data/xbin/mc (you can add /data/xbin to your PATH for more comfort)

wget http://freeasabeer.byethost33.com/android/feed/common/mc_4.6.2-1_arm.ipk
wget http://freeasabeer.byethost33.com/android/feed/common/terminfo_5.6-1_arm.ipk
mkdir /tmp/mc
mkdir /tmp/terminfo
tar zxvf mc_4.6.2-1_arm.ipk -C /tmp/mc/
tar zxvf terminfo_5.6-1_arm.ipk -C /tmp/terminfo/
mv /tmp/mc/data.tar.gz /tmp/mc/mc.tar.gz
mv /tmp/terminfo/data.tar.gz /tmp/terminfo/terminfo.tar.gz
adb push /tmp/mc/mc.tar.gz /sdcard
adb push /tmp/terminfo/terminfo.tar.gz /sdcard
adb shell
su -
busybox mount -o remount,rw /system
busybox tar -xzvf /sdcard/mc.tar.gz -C /
busybox tar -xzvf /sdcard/terminfo.tar.gz -C /
rm /sdcard/mc.tar.gz
rm /sdcard/terminfo.tar.gz
busybox chmod -R 0755 /system/etc/terminfo
busybox chmod -R 0644 /system/etc/terminfo/?/*
busybox mount -o remount,ro /system
exit
exit
Advertisements

6 Comments

  1. I have a Flytouch3 tablet and have used these files to install MC onto it.
    I used dropbox and connectbot terminal rather than adb.
    Operation of MC on the tablet is a bit tricky without the function keys but possible.
    Thanks for the tutorial.

  2. the busybox i’ve downloaded , doesn’t work with tar command, but , i’ve made all teh work on the pc, and then pushed onto the phone, long, but works too

    1. since many idiots out there are “compiling” themselves busybox and spread it, many busybox binaries are lacking many applets (i even encountered a sh-less busybox), so sorry for that. i would recommend you replace your busybox all together, but glad to hear u worked out over it. kudos.

  3. Checked it on Ubuntu 12.04 + adb 1.0.31 + CyanogenMod 9

    It works with few small modifications:
    The two adb push commands were changed as follow:

    adb push /tmp/mc/mc.tar.gz /sdcard/mc.tar.gz
    adb push /tmp/terminfo/terminfo.tar.gz /sdcard/terminfo.tar.gz

    Otherwise, adb showed “failed to copy ‘/tmp/mc/mc.tar.gz’ to ‘/sdcard’: Is a directory”

  4. It you have a busybox tar, the commands are:
    tar -zxv -f mc_4.6.2-1_arm.ipk -C /tmp/mc/
    tar -zxv -f terminfo_5.6-1_arm.ipk -C /tmp/terminfo/

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s