You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu Server 16.04安装imgmin后提示command not found求助

Troubleshooting "imgmin: command not found" After Compiling on Ubuntu 16.04 LTS

Let’s work through this issue step by step—this is a common hiccup after compiling software from source, and it’s usually straightforward to fix.

Step 1: Confirm if imgmin was actually installed

First, let’s check if the imgmin executable exists anywhere on your system. Run this search command:

sudo find / -name imgmin -type f
  • If the search returns a path like /usr/local/bin/imgmin, the binary was installed successfully, and the problem is likely with your shell’s PATH environment variable.
  • If no results show up, that means make install didn’t copy the binary to a system directory—even though it didn’t throw an explicit error.

Step 2: Fix PATH issues (if the binary exists)

Ubuntu 16.04 typically includes /usr/local/bin (the default install location for source-compiled tools) in bash’s default PATH, but this can sometimes get misconfigured. Let’s verify:

echo $PATH

Look for /usr/local/bin in the output. If it’s missing:

  • Temporary fix (works only for your current session):
    export PATH=$PATH:/usr/local/bin
    
    Try running imgmin original.jpg optimized.jpg again—this should work now.
  • Permanent fix (persists across reboots):
    Open your bash profile file in a text editor:
    nano ~/.bashrc
    
    Add this line at the bottom of the file:
    export PATH=$PATH:/usr/local/bin
    
    Save and exit (press Ctrl+O, hit Enter, then Ctrl+X), then reload the profile to apply changes:
    source ~/.bashrc
    

Step 3: Manually install the binary (if it wasn’t found)

If the find command didn’t locate imgmin, go back to the directory where you compiled the project:

cd imgmin/src

Check if the compiled binary exists here:

ls -l imgmin

If you see an executable file named imgmin, copy it manually to /usr/local/bin (the standard directory for user-compiled tools):

sudo cp imgmin /usr/local/bin/

Now test the imgmin command again—it should work as expected.

Bonus: Verify the install process (optional)

If you want to double-check the installation flow, re-run sudo make install and watch the output closely. You should see a line similar to:

installing imgmin to /usr/local/bin

If you don’t see this line, there might be a build configuration issue. Try re-running the configure step with an explicit prefix to enforce the install path:

./configure --prefix=/usr/local
make
sudo make install

内容的提问来源于stack exchange,提问作者Niranda

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.15 07:10:53