Install mc (midnight commander)

From OpenFSG
Jump to: navigation, search

Contents

About GNU Midnight Commander (mc)

Being a text mode application, GNU Midnight Commander can be used locally or remotely, on the console or under X Window System. By using full screen space of the terminals, it provides an intuitive user interface to the operating system, aiming to be a useful tool for users with any level of experience, from a newbie to a guru.

Info

I have installed mc on the FSG with firmware 3.3.9 but it should work on other firmware versions as well.

Windows users: it is recommended to use the ssh client PuTTY found at [1] (or another advanced ssh client) to access the ssh server, due to it's colour support and it's mouse support. A cygwin ssh will not support colour or mouse.

Mac OS X users: you can use the built-in OS X terminal without a problem. Simply open your terminal and type "ssh -l admin [IP NUMBER]". The Mac OS X terminal does not support a mouse.

For more information then please look at the Wikipedia page.

Note: The helpfile in mc isn't included for some reason, but a workaround to download it is in the Issues section.

Installing Midnight Commander

Before starting, ssh onto the FSG, log in as root and install the Ipkg Installer first. (for more info see official ipkg bootstrap)

The following must be installed as root.

  1. Install Midnight Commander which also installs ncurses: "ipkg install mc"
  2. Install the GLib library of C routines: "ipkg install glib"
  3. If you are using a compatible ssh terminal (PuTTY, for example) then edit /etc/profile to set up your terminal settings. Add the following lines: "export TERMINFO=/opt/share/terminfo" and "export TERM=xterm-color". Use vi, nano (ipkg install nano) to edit and create these configuration files or the command line "cat >> /etc/profile" and a control-C to finish.
  4. If you install mc version 4.5.55-7 or higher you need to install EXT2 Filesystem Utilities with "ipkg install e2fsprogs" or else mc will exit with 'Error while loading shared libraries : libext2fs.so.2 can not open shared object file'
  5. Reboot the FSG: "reboot"
  6. Log in and check if the terminal settings have been added properly: "export"
  7. Start MC for the first time: "mc"
  8. If mc warns about missing files extfs.ini and sfs.ini in /opt/lib/mc/extfs create these files with
mkdir /opt/lib/mc/extfs
touch /opt/lib/mc/extfs/extfs.ini
touch /opt/lib/mc/extfs/sfs.ini

Midnight Commander should now work properly:

Mc-colour.jpg

Trick

Edit by Ben (Zanco) 9 april 2008:

If MC does not start but gives the message "mc: not found" try this: "/opt/bin/mc" that worked for me.

MC is installed in the /opt/bin folder and it seems to me that the FSG is assuming that all bin files are in /bin . This way I learned that more packages I installed are in the /opt/bin folder and actually DO work when starting them with /opt/bin "name" (like the nano editor) End of edit.


Example

/ # ipkg update
Downloading http://ipkg.nslu2-linux.org/feeds/optware/fsg3/cross/stable/Packages.gz
Inflating http://ipkg.nslu2-linux.org/feeds/optware/fsg3/cross/stable/Packages.gz
Updated list of available packages in /opt/lib/ipkg/lists/optware
Downloading http://ipkg.nslu2-linux.org/feeds/optware/fsg3/cross/stable/Packages.gz
Inflating http://ipkg.nslu2-linux.org/feeds/optware/fsg3/cross/stable/Packages.gz
Updated list of available packages in /opt/lib/ipkg/lists/cross
Successfully terminated.
/ # ipkg install glib
Installing glib (2.6.6-3) to /opt/...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/fsg3/cross/stable/glib_2.6.6-3_armeb.ipk
Configuring glib
Successfully terminated.
/ # ipkg install mc
Installing mc (4.5.55-6) to /opt/...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/fsg3/cross/stable/mc_4.5.55-6_armeb.ipk
Installing ncurses (5.6-1) to /opt/...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/fsg3/cross/stable/ncurses_5.6-1_armeb.ipk
Configuring mc
Configuring ncurses
Successfully terminated.
/tmp # cat /etc/profile
PATH=$PATH:/opt/bin:/opt/sbin
/tmp # cat >> /etc/profile
export TERMINFO=/opt/lib/terminfo
export TERM=xterm-pcolor

Note: Here I enter a Control-C to finish adding lines to a file

/tmp # cat /etc/profile
PATH=$PATH:/opt/bin:/opt/sbin
export TERMINFO=/opt/lib/terminfo
export TERM=xterm-pcolor


Usage

Issues

Cannot open file /opt/lib/mc/mc.hlp
No such file or directory (2)

If you want the help file (who wouldn't?) then visit the koder search engine and use the download button in the top left and place it onto your FSG in /opt/lib/mc/mc.hlp.

Mc-cygwin.jpg

For more up to date info look at the pages of NSLU2-Linux:


Credits to the guys at NSLU2 for their work and info!

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox