LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This 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

Reply
 
LinkBack Search this Thread
Old 03-03-2011, 05:06 AM   #1
janakiramulu
Member
 
Registered: Jan 2011
Location: mangalore
Distribution: ubuntu
Posts: 167

Rep: Reputation: 0
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)
 
Old 03-03-2011, 08:20 AM   #2
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 5,766
Blog Entries: 4

Rep: Reputation: 697Reputation: 697Reputation: 697Reputation: 697Reputation: 697Reputation: 697
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.
 
Old 03-03-2011, 11:04 AM   #3
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371
Hi,

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).
 
Old 03-04-2011, 12:34 AM   #4
janakiramulu
Member
 
Registered: Jan 2011
Location: mangalore
Distribution: ubuntu
Posts: 167

Original Poster
Rep: Reputation: 0
stuck:::source ~/.bash_profile

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

~/.bash_profile file(login shell) ,~/.bashrc file(non login shell)



3)------- for ~/.bash_profile file -----------

lfs [ ~ ]$ cat > ~/.bash_profile << "EOF"
exec env -i HOME=$HOME TERM=$TERM PS1='\u:\w\$ ' /bin/bash
EOF
----------------------------------------------

4)----- for ~/.bashrc file---------------
lfs [ ~ ]$cat > ~/.bashrc << "EOF"
set +h
umask 022
LFS=/mnt/lfs
LC_ALL=POSIX
PATH=/tools/bin:/bin:/usr/bin
export LFS LC_ALL PATH
EOF
////////////////////////////////////////////////////////////////////////////////////////////////////////////////

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

////////////////////////////////////////////////////////////////////////////////////////////////


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)

can u provide good help any notes( i gave the number for better unduer standing)

3qdo we need create this file now or can we create this file later aslo na,its temparary environ ment na
 
Old 03-04-2011, 02:09 AM   #5
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371
Hi,

Quote:
Originally Posted by janakiramulu View Post
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

3)------- for ~/.bash_profile file -----------

lfs [ ~ ]$ cat > ~/.bash_profile << "EOF"
exec env -i HOME=$HOME TERM=$TERM PS1='\u:\w\$ ' /bin/bash
EOF
----------------------------------------------

4)----- for ~/.bashrc file---------------
lfs [ ~ ]$cat > ~/.bashrc << "EOF"
set +h
umask 022
LFS=/mnt/lfs
LC_ALL=POSIX
PATH=/tools/bin:/bin:/usr/bin
export LFS LC_ALL PATH
EOF
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).
 
Old 03-04-2011, 02:37 AM   #6
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,598
Blog Entries: 29

Rep: Reputation: 880Reputation: 880Reputation: 880Reputation: 880Reputation: 880Reputation: 880Reputation: 880
druuna,
OFFTOPIC: Wow, Am I seeing things or you have actually enabled your reputation option??
 
Old 03-04-2011, 02:56 AM   #7
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371
Quote:
Originally Posted by Anisha Kaul View Post
druuna,
OFFTOPIC: Wow, Am I seeing things or you have actually enabled your reputation option??
Thanks for the heads up! I did have a more detailed look yesterday evening and forgot to turn it off again
 
Old 03-04-2011, 02:58 AM   #8
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,598
Blog Entries: 29

Rep: Reputation: 880Reputation: 880Reputation: 880Reputation: 880Reputation: 880Reputation: 880Reputation: 880
Quote:
Originally Posted by druuna View Post
Thanks for the heads up! I did have a more detailed look yesterday evening and forgot to turn it off again
I shouldn't have reminded you! I was surprised actually since I remember how dead against you were, w.r.t that rep option
 
Old 03-04-2011, 03:08 AM   #9
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371
Hi,
Quote:
Originally Posted by Anisha Kaul View Post
I shouldn't have reminded you!
I would have noticed eventually.....
Quote:
I was surprised actually since I remember how dead against you were, w.r.t that rep option
I still am

Back on topic.......
 
Old 03-04-2011, 05:08 AM   #10
janakiramulu
Member
 
Registered: Jan 2011
Location: mangalore
Distribution: ubuntu
Posts: 167

Original Poster
Rep: Reputation: 0
struck:::source ~/.bash_profile

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
 
Old 03-04-2011, 10:50 AM   #11
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371
Hi,
Quote:
Originally Posted by janakiramulu View Post
(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
 
Old 03-04-2011, 11:51 AM   #12
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: Ubuntu 12.04/12.10/13.04/LFS/Centos6.3/Debain/PCBSD/Mageia 3
Posts: 1,611
Blog Entries: 1

Rep: Reputation: 226Reputation: 226Reputation: 226
Another option you could copy and paste some of the commands in just a thought
 
Old 03-05-2011, 05:04 AM   #13
janakiramulu
Member
 
Registered: Jan 2011
Location: mangalore
Distribution: ubuntu
Posts: 167

Original Poster
Rep: Reputation: 0
stuck:::source ~/.bash_profile

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
 
Old 03-05-2011, 05:59 AM   #14
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371
Hi,
Quote:
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))
Nope, not when you use the liveCD.

Hope this helps.
 
Old 08-01-2011, 07:42 PM   #15
KRowe
LQ Newbie
 
Registered: Jun 2007
Posts: 2

Rep: Reputation: 0
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.
 
  


Reply

Tags
lfs


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need shell script to source an env file and open a kde konsole terminal jdlandry_ohio Linux - Newbie 2 01-27-2011 08:41 AM
HTTPD error_log filled with sh: /env: No such file or directory TravisP Linux - Server 4 04-27-2010 10:41 AM
gnome: Fedora/CentOS source .bash_profile but Ubuntu/Debian source .bashrc centguy Linux - Software 6 01-17-2010 08:35 PM
bash_profile file doesn't run in home directory spaceman spiff Slackware - Installation 3 01-13-2009 11:59 PM
chroot: cannot run command `/tools/bin/env': No such file or directory Basel Linux From Scratch 5 06-30-2006 03:00 AM


All times are GMT -5. The time now is 08:54 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration