can't "make menuconfig" as non-root, ncurses not found
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
can't "make menuconfig" as non-root, ncurses not found
I tried googling and searching the forums but didn't find anything relevant, my apologies if this is a duplicate.
When I do this
Code:
# cd /usr/src/linux-2.6.18.8/
# make menuconfig
...
this works no problem (as root)
But the following happens
Code:
$ cd /usr/src/linux-2.6.18.8/
$ make menuconfig
*** Unable to find the ncurses libraries.
*** make menuconfig require the ncurses libraries
***
*** Install ncurses (ncurses-devel) and try again
***
make[2]: *** [scripts/kconfig/lxdialog/dochecklxdialog] Error 1
make[1]: *** [menuconfig] Error 2
make: *** [menuconfig] Error 2
as a regular user, I can however just "make config".
Distro: Slackware 11 (slackware-current actually); I tried reinstalling the distro provided package ncurses-5.6-i486-1.tgz to no avail.
I've only recently learned that it's not kosher to build the kernel as root, haven't had any catastrophes from the process (that's ok, wouldn't be the first time I nuked my system) but seems that the 'legit' way is not working.
Any ideas?
P.S. Should this maybe be posted in my distro's forum instead??
Yeah, I think this might be more of a Slackware issue than a kernel issue. You aren't really getting an error building the kernel as such, your system is just failing to find the correct library.
That is definitely an odd problem. Unless your user account somehow has it's PATH variables screwed up, I don't see how this could happen. I assume other ncurses programs fail with the same error?
I can't say about slack, but on Debian we need: libncurses5-dev. You might try make clean and/or make mrproper as root and then try make menuconfig again as a user. You might need to add "src" to the user's groups.
There is only one ncurses package in Slackware (which he has the proper version of), and no "src" group. He shouldn't have to do anything special to run menuconfig, if ncurses is installed it should work for any user.
Hmm this seems to have fixed the problem (not sure why I haven't tried it before hmm...)
Code:
# cd /usr/src/linux-2.6.18.8/
# cp ./.config ../kernel.2.6.18.8.config
# make clean
# make mrproper
# cp ../kernel.2.6.18.8.config ./.config
(I don't know how many times I've forgotten to backup the config heh...)
Also I recursively chgrp'ed /usr/linux-2.6.18.6 to "users" (was group=root) and give (recursive) rw access to the group. (am I a bad person in any way for doing this last step?)
"Also I recursively chgrp'ed /usr/linux-2.6.18.6 to "users" (was group=root) and give (recursive) rw access to the group. (am I a bad person in any way for doing this last step?)"
YES. One hundred lashes with a wet noodle for your transgression! Seriously, though, I've borked things up in the past to the point that I had to do a chown -R to fix them. I'm not so sure that it's a good idea to give rw access to the group for everything. OTOH, what does it matter in the real world?
For the Slackware kernel packages, it's actually most kosher to do stuff as root in the /usr/src directory. When you snatch a kernel on your own, it's your choice, but Linus likes people unpacking the kernel into their home directory and building there.
There's already been a big long thread about this, but I personally dislike Linus' approach and prefer the Slackware way because I hate having the kernel linking into my home directory, I feel it should be in a more generic place. Once you've built, installed, and run the kernel, you can never delete the sources to clean things up, because out-of-tree kernel modules depend on the sources sticking around.
The reason for this error is the process tries to determine the location
of 'ncurses.h' by compiling a short program inline. The Makefile for
menuconfig invokes '/usr/src/linux-source-2.6.26/scripts/kconfig/lxdialog/check-lxdialog.sh', which contains the following:
Code:
# Check if we can link to ncurses
check() {
$cc -xc - -o $tmp 2>/dev/null <<'EOF'
#include CURSES_LOC
main() {}
EOF
if [ $? != 0 ]; then
echo " *** Unable to find the ncurses libraries or the" 1>&2
echo " *** required header files." 1>&2
echo " *** 'make menuconfig' requires the ncurses libraries." 1>&2
echo " *** " 1>&2
echo " *** Install ncurses (ncurses-devel) and try again." 1>&2
echo " *** " 1>&2
exit 1
fi
}
Because the normal permissions for every subdirectory under '/usr/src' are root owned and read only for non-root, the compile fails and the
error message is issued.
As already advised, that's a permissions error. That aside, YDIW. Don't alter the kernel sources provided with Slackware. Copy them to somewhere else, then do a "chown -R youruser:users" on that directory.
Okej I know is an old thread but if someone read this now like me..
I wanna share what I found. This is also my first post on LQ.
I found that the ncurses-5.9-x86_64-1.txz package installed
libncursesw.so.5.9 and libncurses.so.5.9 in /lib64 .
the header /usr/include/ncurses/ncurses.h don't handle the path for the lib files I mentioned above. the make script did in isdn4k-utils.v3.1pre1 and linux
3.0.40 had it fix withe the fixdep script.
I did symlinks in /lib from /lib64's libncurses files and the make config i isdn4k-utils work so it can be good ide to look how the checking for the lib files is done in makefile or so to...
Now I don't know how to fix this properly. Because I'm writhing my first slackbuild script and don't want to mess up the system but keep it clean and simple.
the packages is recommended from Linus in his dependencies list. I will use the isdn on this machine.
The real issue, as I see it, is within the kbuild/scripts/kconfig/lxdialog/check-lxdialog.sh shell script:
[...]
# Temp file, try to clean up after us
tmp=.lxdialog.tmp <--- HERE !!
trap "rm -f $tmp" 0 1 2 3 15
# Check if we can link to ncurses
check() {
$cc -xc - -o $tmp 2>/dev/null <<'EOF'
#include CURSES_LOC
main() {}
EOF
if [ $? != 0 ]; then
echo " *** Unable to find the ncurses libraries or the" 1>&2
echo " *** required header files." 1>&2
echo " *** 'make menuconfig' requires the ncurses libraries." 1>&2
echo " *** " 1>&2
echo " *** Install ncurses (ncurses-devel) and try again." 1>&2
echo " *** " 1>&2
exit 1
fi
}
[...]
The 'tmp' file location (for the temporary C source file), is possibly in a root-only writeable location (like /usr/src);
as GamerX has already pointed out in fact.
So, I just change the variable like so:
## KaiwanNB: make the 'tmp' C code in a world-writeable location; else, only
## when root does it show success (as the kbuild/ folder may be in a root-only
## writeable location (like /usr/...).
tmp=/tmp/.lxdialog.tmp
Now it works! -even / esp when you attempt to compile as non-root.
GamerX - I think you would benefit greatly from reading Alien Bob's (Eric's) slackdoc on kernel building located --- H E R E --- .
I realize the hardcore GUI haters begrudgingly accede to make menuconfig but if one really wants to understand kernel options make xconfig offers lessons in the form of having a 3-boxed window so one can see the header, the option, and the specific help content in most cases. Not only does the help file inform you of safe decisions, it often explains what that option is for and if it needs other options activated or deactivated.
The above linked blog also notes performance boosters and simplifications that you will likely find interesting and useful.
Not only does the help file inform you of safe decisions, it often explains what that option is for and if it needs other options activated or deactivated.
Not that I'm questioning the benefits of using xconfig, but under menuconfig, doesn't the help menu under the item provide the same explanation that xconfig does? It just requires going to another screen, which may not be as simple as viewing it in another panel.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.