Linux_Linux 修改 /etc/profile 导致 command 找不到解决方案

本文介绍了如何正确配置Linux系统的$PATH环境变量,避免因错误配置而导致的命令未找到的问题。通过正确的步骤,确保了系统能够识别自定义路径下的命令。


大家平时总会去修改 /etc/profile , 这个时候有时候会修改 $PATH 变量, 向变量后面追加内容。

但是如果原来的路径$PATH 如果没有加上 就会 导致命令找不到的情况 :


原因分析:$PATH 目录加载了各种命令执行的路径,错误的配置会导致命令找不到



如下面的错误配置:

#python

export PYTHON_HOME=$MZ_HOME/python-2.7.12

export PATH=$PYTHON_HOME/bin


解决方法如下:

第一步:

命令: /usr/bin/vim /etc/profile


第二步:

修改文件为:

#python

export PYTHON_HOME=$MZ_HOME/python-2.7.12

export PATH=$PYTHON_HOME/bin:$PATH


保存退出 :wq


第三步:

在终端输入

export PATH=/usr/bin:/usr/sbin:/bin:/sbin


第四步

source /etc/profile  使环境变量生效


complete !! 大功告成



深度参考文章:

http://blog.youkuaiyun.com/u010003835/article/details/52105874




install -d -m0755 /ge550v1/qca_95xx_12_2/bin/targets/ipq95xx/generic/packages /ge550v1/qca_95xx_12_2/scripts/ipkg-build -c -o 0 -g 0 /ge550v1/qca_95xx_12_2/build_dir/target-aarch64/linux-ipq95xx_generic/base-files/ipkg-aarch64_cortex-a73_neon-vfpv4/base-files /ge550v1/qca_95xx_12_2/bin/targets/ipq95xx/generic/packages /ge550v1/qca_95xx_12_2/staging_dir/host/bin/find: '/ge550v1/qca_95xx_12_2/build_dir/target-aarch64/linux-ipq95xx_generic/base-files/ipkg-aarch64_cortex-a73_neon-vfpv4/base-files/etc/config/network': No such file or directory /ge550v1/qca_95xx_12_2/staging_dir/host/bin/find: '/ge550v1/qca_95xx_12_2/build_dir/target-aarch64/linux-ipq95xx_generic/base-files/ipkg-aarch64_cortex-a73_neon-vfpv4/base-files/etc/config/system': No such file or directory /ge550v1/qca_95xx_12_2/staging_dir/host/bin/find: '/ge550v1/qca_95xx_12_2/build_dir/target-aarch64/linux-ipq95xx_generic/base-files/ipkg-aarch64_cortex-a73_neon-vfpv4/base-files/etc/dropbear/': No such file or directory /ge550v1/qca_95xx_12_2/staging_dir/host/bin/find: '/ge550v1/qca_95xx_12_2/build_dir/target-aarch64/linux-ipq95xx_generic/base-files/ipkg-aarch64_cortex-a73_neon-vfpv4/base-files/etc/profile.d': No such file or directory Packaged contents of /ge550v1/qca_95xx_12_2/build_dir/target-aarch64/linux-ipq95xx_generic/base-files/ipkg-aarch64_cortex-a73_neon-vfpv4/base-files into /ge550v1/qca_95xx_12_2/bin/targets/ipq95xx/generic/packages/base-files_204.4-12.02.2392_aarch64_cortex-a73_neon-vfpv4.ipk echo "base-files" >> /ge550v1/qca_95xx_12_2/staging_dir/target-aarch64/pkginfo/base-files.default.install make[4]: Leaving directory `/ge550v1/qca_95xx_12_2/package/base-files' time: package/base-files/compile#0.45#0.08#0.55 make[4]: Entering directory `/ge550v1/qca_95xx_12_2/package/boot/uboot-envtools' mkdir -p /ge550v1/qca_95xx_12_2/dl SHELL= flock /ge550v1/qca_95xx_12_2/tmp/.u-boot-2022.01.tar.bz2.flock -c ' /ge550v1/qca_95xx_12_2/scripts/download.pl "/ge550v1/qca_95xx_12_2/dl" "u-boot-2022.01.tar.bz2" "81b4543227db228c03f8a1bf5ddbc813b0bb8f6555ce46064ef721a6fc680413" "" "https://ftp.denx.de/pub/u-boot" ' touch /ge550v1/qca_95xx_12_2/build_dir/target-aarch64/u-boot-2022.01/.prepared_37da1ec8733136d808e634953c70acb0_6664517399ebbbc92a37c5bb081b5c53_check . /ge550v1/qca_95xx_12_2/include/shell.sh; bzcat /ge550v1/qca_95xx_12_2/dl/u-boot-2022.01.tar.bz2 | tar -C /ge550v1/qca_95xx_12_2/build_dir/target-aarch64/u-boot-2022.01/.. -xf - [ ! -d ./src/ ] || cp -fpR ./src/. /ge550v1/qca_95xx_12_2/build_dir/target-aarch64/u-boot-2022.01 Applying ./patches/001-compile.patch using plaintext: patching file tools/env/Makefile Hunk #1 succeeded at 8 with fuzz 2. Applying ./patches/303-fix-bad-block-present-calculation.patch using plaintext: patching file tools/env/fw_env.c Hunk #1 succeeded at 885 (offset 2 lines). Hunk #2 succeeded at 910 with fuzz 2 (offset 2 lines). Hunk #3 succeeded at 930 with fuzz 2 (offset 2 lines). Hunk #4 succeeded at 951 with fuzz 2 (offset 2 lines). Hunk #5 succeeded at 1022 (offset -27 lines). Hunk #6 succeeded at 1042 (offset -27 lines). Hunk #7 succeeded at 1123 (offset -27 lines). Applying ./patches/304-fix_default_bootcmd.patch using plaintext: patching file tools/env/fw_env_private.h Hunk #1 succeeded at 41 (offset -1 lines). Hunk #2 succeeded at 53 (offset -1 lines). touch /ge550v1/qca_95xx_12_2/build_dir/target-aarch64/u-boot-2022.01/.prepared_37da1ec8733136d808e634953c70acb0_6664517399ebbbc92a37c5bb081b5c53 if [[ "" == *'s'* ]]; then [[ -f "/ge550v1/qca_95xx_12_2/scripts/fossid.sh" ]] && /ge550v1/qca_95xx_12_2/scripts/fossid.sh --build_scan "ipq95xx" "generic" "/ge550v1/qca_95xx_12_2/build_dir/target-aarch64/u-boot-2022.01" "/ge550v1/qca_95xx_12_2/build_dir/target-aarch64" "" || echo "/ge550v1/qca_95xx_12_2/scripts/fossid.sh is missing"; fi rm -f /ge550v1/qca_95xx_12_2/build_dir/target-aarch64/u-boot-2022.01/.configured_* rm -f /ge550v1/qca_95xx_12_2/staging_dir/target-aarch64/stamp/.uboot-envtools_installed touch /ge550v1/qca_95xx_12_2/build_dir/target-aarch64/u-boot-2022.01/include/config.h mkdir -p /ge550v1/qca_95xx_12_2/build_dir/target-aarch64/u-boot-2022.01/include/config touch /ge550v1/qca_95xx_12_2/build_dir/target-aarch64/u-boot-2022.01/include/config/auto.conf mkdir -p /ge550v1/qca_95xx_12_2/build_dir/target-aarch64/u-boot-2022.01/include/generated touch /ge550v1/qca_95xx_12_2/build_dir/target-aarch64/u-boot-2022.01/include/generated/autoconf.h touch /ge550v1/qca_95xx_12_2/build_dir/target-aarch64/u-boot-2022.01/.configured_68b329da9893e34099c7d8ad5cb9c940 rm -f /ge550v1/qca_95xx_12_2/build_dir/target-aarch64/u-boot-2022.01/.built touch /ge550v1/qca_95xx_12_2/build_dir/target-aarch64/u-boot-2022.01/.built_check CFLAGS="-Os -pipe -march=armv8-a -mcpu=cortex-a73+crypto -fno-caller-saves -fno-plt -Wa,--noexecstack -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -iremap/ge550v1/qca_95xx_12_2/build_dir/target-aarch64/u-boot-2022.01:u-boot-2022.01 -Wformat -Werror=format-security -fPIC -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wl,-z,now -Wl,-z,relro -I/ge550v1/qca_95xx_12_2/staging_dir/target-aarch64/usr/include -I/ge550v1/qca_95xx_12_2/staging_dir/target-aarch64/include -I/ge550v1/qca_95xx_12_2/staging_dir/toolchain-aarch64/usr/include -I/ge550v1/qca_95xx_12_2/staging_dir/toolchain-aarch64/include/fortify -I/ge550v1/qca_95xx_12_2/staging_dir/toolchain-aarch64/include " CXXFLAGS="-Os -pipe -march=armv8-a -mcpu=cortex-a73+crypto -fno-caller-saves -fno-plt -Wa,--noexecstack -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -iremap/ge550v1/qca_95xx_12_2/build_dir/target-aarch64/u-boot-2022.01:u-boot-2022.01 -Wformat -Werror=format-security -fPIC -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wl,-z,now -Wl,-z,relro -I/ge550v1/qca_95xx_12_2/staging_dir/target-aarch64/usr/include -I/ge550v1/qca_95xx_12_2/staging_dir/target-aarch64/include -I/ge550v1/qca_95xx_12_2/staging_dir/toolchain-aarch64/usr/include -I/ge550v1/qca_95xx_12_2/staging_dir/toolchain-aarch64/include/fortify -I/ge550v1/qca_95xx_12_2/staging_dir/toolchain-aarch64/include " LDFLAGS="-L/ge550v1/qca_95xx_12_2/staging_dir/target-aarch64/usr/lib -L/ge550v1/qca_95xx_12_2/staging_dir/target-aarch64/lib -L/ge550v1/qca_95xx_12_2/staging_dir/toolchain-aarch64/usr/lib -L/ge550v1/qca_95xx_12_2/staging_dir/toolchain-aarch64/lib -fPIC -specs=/ge550v1/qca_95xx_12_2/include/hardened-ld-pie.specs -znow -zrelro " make -C /ge550v1/qca_95xx_12_2/build_dir/target-aarch64/u-boot-2022.01/. AR="aarch64-openwrt-linux-musl-gcc-ar" AS="aarch64-openwrt-linux-musl-gcc -c -Os -pipe -march=armv8-a -mcpu=cortex-a73+crypto -fno-caller-saves -fno-plt -Wa,--noexecstack -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -iremap/ge550v1/qca_95xx_12_2/build_dir/target-aarch64/u-boot-2022.01:u-boot-2022.01 -Wformat -Werror=format-security -fPIC -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wl,-z,now -Wl,-z,relro" LD=aarch64-openwrt-linux-musl-ld NM="aarch64-openwrt-linux-musl-gcc-nm" CC="aarch64-openwrt-linux-musl-gcc" GCC="aarch64-openwrt-linux-musl-gcc" CXX="aarch64-openwrt-linux-musl-g++" RANLIB="aarch64-openwrt-linux-musl-gcc-ranlib" STRIP=aarch64-openwrt-linux-musl-strip OBJCOPY=aarch64-openwrt-linux-musl-objcopy OBJDUMP=aarch64-openwrt-linux-musl-objdump SIZE=aarch64-openwrt-linux-musl-size CROSS="aarch64-openwrt-linux-musl-" ARCH="aarch64" TARGET_CFLAGS="-Os -pipe -march=armv8-a -mcpu=cortex-a73+crypto -fno-caller-saves -fno-plt -Wa,--noexecstack -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -iremap/ge550v1/qca_95xx_12_2/build_dir/target-aarch64/u-boot-2022.01:u-boot-2022.01 -Wformat -Werror=format-security -fPIC -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wl,-z,now -Wl,-z,relro" TARGET_LDFLAGS="-L/ge550v1/qca_95xx_12_2/staging_dir/target-aarch64/usr/lib -L/ge550v1/qca_95xx_12_2/staging_dir/target-aarch64/lib -L/ge550v1/qca_95xx_12_2/staging_dir/toolchain-aarch64/usr/lib -L/ge550v1/qca_95xx_12_2/staging_dir/toolchain-aarch64/lib -fPIC -specs=/ge550v1/qca_95xx_12_2/include/hardened-ld-pie.specs -znow -zrelro" no-dot-config-targets=envtools envtools ; make[5]: Entering directory `/ge550v1/qca_95xx_12_2/build_dir/target-aarch64/u-boot-2022.01' Makefile:40: *** missing separator. Stop. make[5]: Leaving directory `/ge550v1/qca_95xx_12_2/build_dir/target-aarch64/u-boot-2022.01' make[4]: *** [/ge550v1/qca_95xx_12_2/build_dir/target-aarch64/u-boot-2022.01/.built] Error 2 make[4]: Leaving directory `/ge550v1/qca_95xx_12_2/package/boot/uboot-envtools' time: package/boot/uboot-envtools/compile#2.08#0.43#2.31 make[3]: *** [package/boot/uboot-envtools/compile] Error 2 make[3]: Leaving directory `/ge550v1/qca_95xx_12_2' make[2]: *** [/ge550v1/qca_95xx_12_2/staging_dir/target-aarch64/stamp/.package_compile] Error 2 make[2]: Leaving directory `/ge550v1/qca_95xx_12_2' make[1]: *** [world] Error 2 make[1]: Leaving directory `/ge550v1/qca_95xx_12_2' make: *** [sdk] Error 2 huaxi@fd4bb9d5f3ca:/ge550v1/Iplatform/build$ cat ./patches/304-fix_default_bootcmd.patch | grep "Makefile" cat: ./patches/304-fix_default_bootcmd.patch: No such file or directory huaxi@fd4bb9d5f3ca:/ge550v1/Iplatform/build$
最新发布
09-04
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值