Ubuntu系统编译crosstool-ng时提示Tag command not found问题求助
Hey, let's sort out that "tag command not found" error you're seeing while building crosstool-ng. I've dealt with similar kconfig-related build hiccups before, so here are the most reliable fixes to try:
1. Install All Required Dependencies First
Chances are you're missing some core build tools that crosstool-ng (and its kconfig module) relies on. Run these commands to install the full set of dependencies on Ubuntu:
sudo apt update sudo apt install build-essential bison flex texinfo help2man libtool libtool-bin autoconf automake libncurses5-dev libncursesw5-dev git
The bison and flex packages are critical here—they're used to build the kconfig tools, and missing them can trigger weird "command not found" errors that don't directly point to the real issue.
2. Check for Missing Submodules or Executable Permissions
Sometimes the tag script in the kconfig directory might be missing (if you didn't pull submodules) or lack execute permissions. Let's verify:
cd /home/rahul/crosstool-ng/kconfig ls -l tag
If the script exists but isn't executable, fix that with:
chmod +x tag
If the tag file is nowhere to be found, you probably missed cloning the submodules. Run this from the root crosstool-ng directory to fetch them:
cd /home/rahul/crosstool-ng git submodule update --init --recursive
Crosstool-ng uses submodules for some components like kconfig, so skipping this step can leave essential files missing.
3. Bypass Tag Generation (If Needed)
If you just need to get the build working and don't care about generating code tags, you can disable that part of the build entirely by passing a flag to make:
cd /home/rahul/crosstool-ng make NO_TAG=1 all-recursive
This tells the build system to skip running the tag command entirely, which should get past the error.
4. Double-Check Your Build Environment
If none of the above works, make sure your PATH is correctly set and that you're not running the build in a restricted environment (like a chroot that's missing basic tools). You can verify your PATH with echo $PATH to ensure standard bin directories (like /usr/bin, /bin) are included.
Once you've tried one of these methods, re-run make and the error should be gone.
内容的提问来源于stack exchange,提问作者Rahul Shah

