[Linux] clean shell environment Linux

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:

  1. Check which shell are you using by command:
     ~$ echo $0 | sed -r 's/-//'
      bash
     ==> you are using 'bash' shell
    

    or

     ~$ echo $0 | sed -r 's/-//'
     sh
     ==> you are using 'sh' shell
    
  2. Reset current shell (check from step 1) environment by command:
     ~$ env -i bash

    or

     ~$ env -i sh

Or one command:

 ~$ env -i `echo $0 | sed -r 's/-//'`

I hope it helps you 🙂

51 Comments

  1. Hey there just wanted to give you a quick heads up.
    The text in your post seem to be running off the screen in Safari.
    I’m not sure if this is a formatting issue or something to do with web
    browser compatibility but I thought I’d post to let you know.
    The design look great though! Hope you get the issue solved soon. Kudos

Leave a Reply

Your email address will not be published. Required fields are marked *