Monday, May 13, 2013

New to the commandline? Don't lose heart

Beginners, you are not alone! Many of us have tried to work through problems, only to be stymied when the steps to work through the problem don't work, and efforts to google those error messages yields nothing helpful. In fact, that's why I started this blog; not just to remind myself how to fix various problems, but to point the way to others who are trying to learn the way to CLI-foo.

A word to the wise who are trying to help beginners -- please don't leave out "obvious" steps!

I'll illustrate with a recent experience I had, trying to help a user work through a problem using Krusader.  A bit of googling told me that s/he wasn't alone; there are bugs filed on both launchpad[1] and bugs.kde.org[2]. First, kudos to the unnamed person for asking for help in IRC. That's an excellent place to get step-by-step help.

In the launchpad bug, a helpful person posted a series of step to fix the bug by building an updated version from source:
Made my own deb from 2.4.0.beta3 which solved the `krarc` problem.
How to:
0 Uninstall Krusader
1 download source from http://www.krusader.org/
2 cd krusader-2.4.0-beta3
3 cmake -DCMAKE_INSTALL_PREFIX=/usr/ -DQT_INCLUDES=/usr/share/qt4/include
4 make
5 sudo checkinstall
Don´t forget in step 5 to set version on 3 instead of beta3, only digits are allowed in versions in debs nowadays.
The unfortunate user came back into IRC, and posted this error message:
xy@xy-ubuntu:~/Downloads$ cmake -DCMAKE_INSTALL_PREFIX=/home/user/app/krusader-2.4.0-b3-2 -DQT_INCLUDES=/usr/share/qt4/include
CMake Error: The source directory "/home/jony/Downloads" does not appear to contain CMakeLists.txt.
Having struggled through this process myself, I see what's missing in the instructions. The person posting them didn't realize, I'm sure, that steps were being left out, because they have become automatic. To a beginner, they are bewildering.

Step zero, uninstall, is unambiguous. So far, so good.
Step one, download source, leaves out the best practice, which is to create a directory into which you want your source file! Probably not specified as people have their own schemes of organization, but in general, I advise a ~/kde folder into which I put all source files and builds (thank you for your advice on that, Myriam!)

So step one should be: a) open a konsole, and type or paste: mkdir kde && cd kde && mkdir krusader && cd krusader && wget http://downloads.sourceforge.net/krusader/krusader-2.4.0-beta3.tar.bz2
Then, step b) tar xf krusader-2.4.0-beta3.tar.bz2

Then, do step two, which is correctly stated as cd krusader-2.4.0-beta3

Step three is almost all there, with a missing note: be sure you have cmake installed! My bet is that my troubled user did not.

Cmake ran uneventfully, as did make, so steps three and four are perfect. Step five, however, does not work at all for me, because I don't have checkinstall installed. And I don't think I'll do that for the sake of finishing this blogpost! I don't need a deb file, when Krusader is available from source.

I hope our Kubuntu packagers will get the newest version packaged soon, and make it easy for my troubled user.

1. https://bugs.launchpad.net/ubuntu/+source/krusader/+bug/1065110
2. https://bugs.kde.org/show_bug.cgi?id=294542

No comments:

Post a Comment