Home > bash, ubuntu > Install Midnight Commander from source

Install Midnight Commander from source

Problem
I’ve already noticed that the Ubuntu repositories are sometimes very out-of-date. A good example for this is the “mc” package. There is a PPA for Midnight Commander that should solve this problem but it’s also very old. At the time of writing (August 10, 2011), the current stable release is 4.7.5.3 while the PPA contains the version 4.7.0.9 (updated on Sept. 15, 2010).

Solution
Since I wanted to use a fresh release of MC, I installed it from source. Steps to follow:

  • Download the latest stable source and unpack it.
  • For a successful compilation I had to install this package too: “sudo apt-get install libslang2-dev libglib2.0-dev”.
  • ./configure
  • make
  • If it was successful then you should have a binary “mc” file in the src/ folder. If it’s there, you can remove your current version with “sudo apt-get remove mc“.
  • Then install the new version with “sudo make install“.

I also had to modify my .bashrc a bit:

# old:
#alias mc='. /usr/share/mc/bin/mc-wrapper.sh'
# new:
alias mc='. /usr/local/libexec/mc/mc-wrapper.sh'

Update (20120505)
Installing mc from source is now integrated in jabbatron.

About these ads
Categories: bash, ubuntu Tags: , , ,
  1. Halitus
    November 23, 2011 at 00:38

    Cheers, Its nice to have mc with samba support.
    What does the .bashrc additions do? Mine seams to run with out doing that.

    • November 23, 2011 at 00:44

      With the .bashrc addition you can navigate to a directory and when you quit from mc, you will find yourself in that directory. Without the addition you are put back to the directory where you launched mc, which can be quite annoying.

  2. Halitus
    November 23, 2011 at 00:59

    Ah I wouldn’t have noticed that for a while and then had no idea.
    I dont see the old alias in the file. Should i be looking in ~/.bashrc ? or is there some master file? and if its not there should it just be added?

    thanks for the quick reply.

    Just a comment for other people new to compiling check the dependency list here: https://www.midnight-commander.org/wiki/doc/buildAndInstall/req
    and use ./configure -enable-vfs-smb before making to add samba support.

    cheers

    • November 23, 2011 at 01:04

      The old alias worked when I installed mc via apt-get. When I installed it from source, the location of mc-wrapper.sh changed. So if you installed mc from source, just use the last line. Anyway, the first three lines are just comments. Thanks for the remark on the Samba support.

  3. Halitus
    November 23, 2011 at 01:14

    I’m still a little unsure how to make this work. I am also getting “cannot save file /home/username/.mc/ini: Read-only file system (30) error”. Is this related?

    Also should I add the line to .bashrc in my homedir or should i add it to /etc/bash.bashrc?

    I seem to get the same behavior even if i run mc-wrapper directly, should this be the case?

  4. November 23, 2011 at 01:25

    Verify if you have write permissions on the directory .mc. Enter that directory in bash and try to create there a test file.

    Don’t hurt the global /etc/bash.bashrc file. Do your modifications in your local ~/.bashrc.

    Use mc-wrapper.sh via the alias that you added to .bashrc. After modifying .bashrc, either source it or simply close the terminal and open a new instance.

  1. No trackbacks yet.

Leave a Reply

Please log in using one of these methods to post your comment:

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

Follow

Get every new post delivered to your Inbox.

Join 73 other followers

%d bloggers like this: