[SOLVED] source ~/.bash_profile env :no such file or directory
Linux From ScratchThis Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
source ~/.bash_profile env :no such file or directory
i am building lfs 6.7-
------------------------------
i typed >>cat ~/.bashrc
if [ -f " /etc/bashrc" ]; then
source /etc/bashrc
fi
-----------------------------------
when i tried this
>>' source ~/.bash_profile'
result:: env TERM :no such file or directory'
any help???
thanks
-------------------------------------------
how can i get person mail id of linux qoestion.org users,this facility is there in linux forum(send mail to someone -option)
In seems to imply you are trying to use or set the TERM variable in your bashrc and the syntax around it is attempting to access a file that doesn't exist.
Type "grep TERM /etc/bashrc" and post the results here - we'll be better able to tell you what the issue is if we see what it tried to do.
You only mention that you are building LFS 6.7, but not the chapter and command(s) you are having problems with. You need to give more detailed information, otherwise we need to start guessing......
The content of ~/.bashrc you posted is not mentioned anywhere in the LFS documentation.
Quote:
how can i get person mail id of linux qoestion.org users,this facility is there in linux forum(send mail to someone -option)
Click on the name of the person, once you enter their profile page look for the Contact Info tab, the info you are looking for is in that tab. On some pages you are presented with a pull-down menu when you click on a persons name. The Send email to option is one of them.
But..... Not all LQ members have their PM and/or mail enabled (I for one only allow mail/pm's from moderators, not from normal users).
hi druuna(i am looking ur mail id,i can interact with easily,plz-bcz if i have any problem ,posting on forum which makes me wait for one day)
i am using lfslivecdx86-r2160,
-i made ext2 files system on dedicated partition(sda3):mke2fs -v /dev/sda3
1)first thing while building lfs 6.7 i didnt make any swap partition command: mkswap -v /dev/[yyy]-here [yyy]-is swap aprtition
i have done upto 4.3 in lfs 6.7 book everything is fine
-iam little bit confusing here @ 4.4. Setting Up the Environment---------
------------------------------------------------------------------------
on terminal i typed following
root [ ~ ]#su - lfs
on terminal its changed from 'root [ ~ ]# to 'lfs [ ~ ]$'
----------------------------------------------------------------------------------
2)on terminal- lfs [ ~ ]$ here i created two files
source the just-created user profile:
on terminal i tped following
5)lfs [ ~ ]$source ~/.bash_profile
result is like 'env: PS1: No such file or directory'
here do i need to expect any result other than this
hi druuna(i am looking ur mail id,i can interact with easily,plz-bcz if i have any problem ,posting on forum which makes me wait for one day)
Nope, I won't activate mail for normal users. Other people that visit LQ also need access to the answers given (be it that they have the same problem and are looking for a solution or they might have an answer to your problem) and I'm also not willing to do one-on-one, private trouble shooting sessions.
If you go to LQ's Edit Options page and look for the Default Thread Subscription Mode option, you can change that so you get an instant mail notification if someone has given an answer to one of your posted questions.
Quote:
i am using lfslivecdx86-r2160,
-i made ext2 files system on dedicated partition(sda3):mke2fs -v /dev/sda3
1)first thing while building lfs 6.7 i didnt make any swap partition command: mkswap -v /dev/[yyy]-here [yyy]-is swap aprtition
Although swap space might not be needed, I would include it. But in the end that is up to you.
Quote:
-iam little bit confusing here @ 4.4. Setting Up the Environment
The above (~/.bashrc) is not correct: The LFS_TGT part is not present in your .bashrc file.
Quote:
source the just-created user profile:
on terminal i tped following
5)lfs [ ~ ]$source ~/.bash_profile
result is like 'env: PS1: No such file or directory'
here do i need to expect any result other than this
That doesn't look correct. Please post the output of the following commands:
Code:
cat /home/lfs/.bashrc
cat /home/lfs/.bash_profile
Also: Are you using the LFS 6.7 Book or another version? You do need to use the book that goes with the LFS version you are building (using the LFS 6.3 book while building LFS 6.7 will _not_ work). I assume that this is the cause of your problem.
If you _are_ using the LFS 6.7 book, have a look at the rest, otherwise: Start over again.
Quote:
i typed on terminal folowing
6)root [ ~ ]#>>cat ~/.bashrc
result like following
if [ -f " /etc/bashrc" ]; then
source /etc/bashrc
fi
do i need to add any PATH here
-----------------------------------------------------------------
hi MensaWater
i typed on terminal following
7)root [ ~ ]#grep TERM /etc/bashrc"
result nothing ,its returning commnand line like 'root [ ~ ]#'(without any qoute)
You are looking at root's .bashrc and not the lfs users .bashr, why? This doesn't seem to be relevant.
Quote:
3qdo we need create this file now or can we create this file later aslo na,its temparary environ ment na
Which file are you talking about? If the book says you need to create a file, do so. Do not deviate from the book, if you do so it will get you into trouble later on (especially when you don't have any experience).
thanks for reply druuna
(i can understand ,but for kind enough can u give me ur mail id )
surely i am following lfsbook6.7 only,
1)----------------output------------------
lfs [ ~ ]#cat /home/lfs/.bashrc
following result appearing
cat: home/lfs/: Is a directory
set +h
umask 022
LFS=/mnt/lfs
PATH=/tools/bin: /bin: /usr/bin
export LFS LC_ALL PATH
2)--------------output--------------
lfs [ ~ ]#cat /home/lfs/.bash_profile
following result appearing
cat: /home/lfs/: Is a directory
exec env -i HOME=$HOME TERM=$TERM PS1='\u:\w\$ ' /bin/bash
-------------------------------------------------------
3)sorry ,yes u are right,i was looking that time root's .bashrc ,instead of lfs users.bashrc.
-------------------------------------------------------------------------------------------------
now i am giving result of lfs users .bashrc.
lfs [ ~ ]$grep TERM /etc/bashrc
result nothing ,means its returning on terminal as like 'lfs [ ~ ]#'
---------------------------------------------------------------------------
4)do we need to create this file now or can we create this file later aslo na,its temparary environment na
means above two files what i was mentioned(ie ~/.bashrc, ~/.bash_profile files)
5)i saw in ubuntu some where ie-`/.bash_history in home directory
(in terminal nautilus,ctl+l,u can see hidden files),is this (~/.bash_history)same like ~/.bash_profile
6)generally i am asking is this ~/.bashrc, /.bashrc both are same
7) what exactly mean of 'source ~/.bash_profile'
what i understood is, are we checking only path is set or not
8) i am bit doubt here,everytime when i start working for lfs building ,do i need to do again same procedure/method (what they mention in lfs book6.7 till 4.3 or shall i just login(after inserting lfslivecd) as 'su - lfs', i can start working on this(hp-desktop),(because,my lab working hours are till 8am-5 pm(india),
i cant keep the cd in system(hp -desktop)
i hope, u will give better explanation
thanku so much fast response,i can provide more info as if u want
(i can understand ,but for kind enough can u give me ur mail id )
I guess you don't understand. The answer is still no.
Quote:
1)----------------output------------------
lfs [ ~ ]#cat /home/lfs/.bashrc
following result appearing
cat: home/lfs/: Is a directory
set +h
umask 022
LFS=/mnt/lfs
PATH=/tools/bin: /bin: /usr/bin
export LFS LC_ALL PATH
That is incorrect:
1) cat: home/lfs/: Is a directory - Where does that come from? It should not be shown.
2) You are still missing LFS_TGT (as mentioned in my previous post).
3) LC_ALL=POSIX is missing.
Quote:
2)--------------output--------------
lfs [ ~ ]#cat /home/lfs/.bash_profile
following result appearing
cat: /home/lfs/: Is a directory
exec env -i HOME=$HOME TERM=$TERM PS1='\u:\w\$ ' /bin/bash
Again the at: /home/lfs/: Is a directory message. Shouldn't be shown. The rest looks ok.
Quote:
now i am giving result of lfs users .bashrc.
lfs [ ~ ]$grep TERM /etc/bashrc
result nothing ,means its returning on terminal as like 'lfs [ ~ ]#'
Not relevant.
Quote:
4)do we need to create this file now or can we create this file later aslo na,its temparary environment na
means above two files what i was mentioned(ie ~/.bashrc, ~/.bash_profile files)
You need to follow the book: So Yes you have to create it now. I doubt if you grasp the meaning of the tempoary environment used in LFS. Re-read that chapter and this one in particular: 1.1. How to Build an LFS System
Quote:
5)i saw in ubuntu some where ie-`/.bash_history in home directory
(in terminal nautilus,ctl+l,u can see hidden files),is this (~/.bash_history)same like ~/.bash_profile
No, and also not relevant (You cannot compare a graphical, fully installed Ubuntu with LFS, especially at this stage of the build).
Quote:
6)generally i am asking is this ~/.bashrc, /.bashrc both are same
No they are not (the second one doesn't make sense: /.bashrc does not exist).
Quote:
7) what exactly mean of 'source ~/.bash_profile'
what i understood is, are we checking only path is set or not
Incorrect: This command sets some environment variables (HOME, TERM and PS1). As explained in the book: This sets up a clean, sane working environment needed for the chapters that follow.
Quote:
8) i am bit doubt here,everytime when i start working for lfs building ,do i need to do again same procedure/method (what they mention in lfs book6.7 till 4.3 or shall i just login(after inserting lfslivecd) as 'su - lfs', i can start working on this(hp-desktop),(because,my lab working hours are till 8am-5 pm(india),
i cant keep the cd in system(hp -desktop)
If you can I would leave the machine up and running. If that is not possible you need to recreate certain parts (chapters 2.4, 4.3 and 4.4) when using the LFS liveCD
Quote:
i hope, u will give better explanation
Your knowledge is very basic (I'm being kind....) and I would suggest waiting with building an LFS system until you have a better understanding of Linux and how it works (at least how the basics work).
Hope this helps.
Last edited by druuna; 03-05-2011 at 03:46 AM.
Reason: Spelling
hi druuna (i understaand regarding mailid)
- i done this 'Edit Options'>the Default Thread Subscription Mode option>i changed to 'instant email notification '
-i got it result of what i expecting ( i think)
i extremely sorry ,i made small mistake (mistake is see no-2)
1)----------------output---is same as what i entered while creating /.bashrc----------------
lfs [ ~ ]#cat /home/lfs/.bash_profile
following result appearing
exec env -i HOME=$HOME TERM=$TERM PS1='\u:\w\$ ' /bin/bash
------------------------------------------------------------------------------------------------------------
2)--------------output-is same as what i entered while creating .bash_profile)-----
lfs [ ~ ]#cat /home/lfs/.bashrc
following result appearing
set +h
umask 022
LFS=/mnt/lfs
LC_ALL=POSIX
LFS_TGT=$(uname -m)-lfs-linux-gnu (mistake is i gave space between these(uname -m) -lfs_linux-gnu)
PATH=/tools/bin:/bin:/usr/bin
export LFS LC_ALL LFS_TGT PATH
EOF
------------------------------------------------------------------------------------------------------------
3)just for checking (no relevent for u)
lfs [ ~ ]$grep TERM /etc/bashrc
result nothing ,means its returning on terminal as like 'lfs [ ~ ]$'
-------------------------------------------------------------------------------------------------
4)i am giving result of 'source ~/.bash_profile'
lfs [ ~ ]$source ~/.bash_profile
following result appearing
'lfs:~$'(without quotes)
5)i cant keep the cd in system(hp-desktop)-in the night time power will go off) , when i start work for buildinglfs,i will do' recreate' certain parts (chapters 2.4, 4.3 and 4.4) when using the LFS liveCD,is there any other way to overcome this problem(means everytime recreating the -chapters 2.4, 4.3 and 4.4))
thanku i am very eager to learn this thing so ,plz encourage me
i will thanku in advance if u provide any basic material/info regarding this)
thanku so much
Last edited by janakiramulu; 03-05-2011 at 05:20 AM.
Reason: i forgot to put title
3)just for checking (no relevent for u)
lfs [ ~ ]$grep TERM /etc/bashrc
result nothing ,means its returning on terminal as like 'lfs [ ~ ]$'
It is also not relevant for you....
Why do you check if /etc/bashrc sets the TERM variable? It is part of your host, not the LFS build. Don't make it more complicated then it is.
Quote:
5) when using the LFS liveCD,is there any other way to overcome this problem(means everytime recreating the -chapters 2.4, 4.3 and 4.4))
IDK why this is marked as solved as no solution which could possibly solve this problem has been suggested. I was having this same problem on v 6.8 of LFS and I finally found out it was due to Windows EOL characters in the file because I was too lazy to type it out.
Also, the OP asked how to recover your position if you need to reboot. First of all, anything on the drive you are creating will be saved [ /mnt/lfs ] . This means most of your work can be restored just by mounting it again:
Code:
export LFS=/mnt/lfs
mkdir $LFS
mount -t ext3 /dev/(XXXX) $LFS
NOTE: Replace ext3 with the partition type you are using.
On this partition I've created a folder with some scripts, first "init_livecd":
Code:
#!/bin/bash
# This function allows you to skip or cancel commands
function RunCmd {
echo "> ${1}"
echo -n "? Execute the above command? [s = skip]: "
read
if [ "$REPLY" != "s" ]; then
./exec_cmd ${1}
fi
}
export LFS=/mnt/lfs
echo "> LFS=${LFS}"
RunCmd "ln -sv ${LFS}/tools /"
RunCmd "groupadd lfs"
RunCmd "useradd -s /bin/bash -g lfs -m -k /dev/null lfs"
RunCmd "passwd lfs"
RunCmd "chown -v lfs $LFS/tools"
RunCmd "chown -v lfs $LFS/sources"
RunCmd "cp ./lfs.bash_profile /home/lfs/bash_profile"
RunCmd "cp ./lfs.bashrc /home/lfs/.bashrc"
RunCmd "chown lfs:lfs /home/lfs/.bash*"
echo "You may want to also run these commands after you su - lfs:"
echo " export LFS=/mnt/lfs"
echo " export MAKEFLAGS='-j 2'"
echo " mv /home/lfs/bash_profile /home/lfs/.bash_profile"
and a little one called "exec_cmd" which is only used by the other script:
Code:
#!/bin/bash
# This script allows other scripts to run strings as
# commands even if the commands include redirects.
exec $@
Also, add your .bash_profile and .bashrc to the folder you put these scripts in and name them lfs.bash_profile and lfs.bashrc respectively.
I use a similar scheme for most of my scripts because it provides the ability to skip\ctrl+c each command so you can fix it if you see something messed up. If you prefer you could just type this stuff in exactly as you would from the command line and hope it is all OK.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.