I faced an error when building yocto after source SDK yocto :
$ source setup-environment build-imx8qxpc0/
Error: The OE SDK/ADT was detected as already being present in this shell environment. Please use a clean shell when sourcing this environment script.
Sometimes you have some error with the current shell environment but you don’t want to exit and open a new shell.
To renew the shell environment in linux you should follow two steps below:
- Check which shell are you using by command:
~$ echo $0 | sed -r 's/-//' bash ==> you are using 'bash' shell
~$ echo $0 | sed -r 's/-//' sh ==> you are using 'sh' shell
- Reset current shell (check from step 1) environment by command:
~$ env -i bash
~$ env -i sh
Or one command:
~$ env -i `echo $0 | sed -r 's/-//'`
I hope it helps you 🙂