Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Accidentally overwritten /etc/profile file...
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
willie_wang
Tux's lil' helper
Tux's lil' helper


Joined: 02 Apr 2008
Posts: 87
Location: Edinburgh, Scotland

PostPosted: Mon Apr 21, 2008 2:07 am    Post subject: [SOLVED] Accidentally overwritten /etc/profile file... Reply with quote

Yep, idiot here.

Anyone got any tips?

~ww


Last edited by willie_wang on Mon Apr 21, 2008 3:38 am; edited 1 time in total
Back to top
View user's profile Send private message
desultory
Bodhisattva
Bodhisattva


Joined: 04 Nov 2005
Posts: 9410

PostPosted: Mon Apr 21, 2008 2:24 am    Post subject: Reply with quote

If the link has been replaced with something invalid without modifying the contents of the profile, recreating the link should be all that is needed to rectify the problem. If the profile itself has been corrupted in addition, emerge --sync should fix that as well.
Back to top
View user's profile Send private message
willie_wang
Tux's lil' helper
Tux's lil' helper


Joined: 02 Apr 2008
Posts: 87
Location: Edinburgh, Scotland

PostPosted: Mon Apr 21, 2008 2:37 am    Post subject: Reply with quote

desultory wrote:
If the link has been replaced with something invalid without modifying the contents of the profile, recreating the link should be all that is needed to rectify the problem. If the profile itself has been corrupted in addition, emerge --sync should fix that as well.


ah. it's just the symlink that was overwritten. where does the symlink point to?

Thanks desultory
Back to top
View user's profile Send private message
desultory
Bodhisattva
Bodhisattva


Joined: 04 Nov 2005
Posts: 9410

PostPosted: Mon Apr 21, 2008 2:58 am    Post subject: Reply with quote

Just use eselect profile list, pick a profile then use eselect profile set $profile where $profile is the number associated with the desired profile in the output of the previous command.
Back to top
View user's profile Send private message
willie_wang
Tux's lil' helper
Tux's lil' helper


Joined: 02 Apr 2008
Posts: 87
Location: Edinburgh, Scotland

PostPosted: Mon Apr 21, 2008 3:05 am    Post subject: Reply with quote

hehe. gotta love this. i think that because the /etc/profile link was overwritten, it can't find the eselect command...

Code:
-bash-3.2# eselect profile list
-bash: eselect: command not found


oops :-\
Back to top
View user's profile Send private message
willie_wang
Tux's lil' helper
Tux's lil' helper


Joined: 02 Apr 2008
Posts: 87
Location: Edinburgh, Scotland

PostPosted: Mon Apr 21, 2008 3:35 am    Post subject: Reply with quote

ok. messy solution. i got the profile file from the stage 3 tarball and copied it over.

it'll have to do :) but thanks for the help anyhoo!

~ww
Back to top
View user's profile Send private message
desultory
Bodhisattva
Bodhisattva


Joined: 04 Nov 2005
Posts: 9410

PostPosted: Mon Apr 21, 2008 3:52 am    Post subject: Reply with quote

willie_w wrote:
Code:
-bash-3.2# eselect profile list
-bash: eselect: command not found
My apologies, I had thought eselect to be essentially ubiquitous. To install it just run emerge -avn app-admin/eselect. That and I was thinking of /etc/make.profile (the link which defines which profile the system is based on), as opposed to /etc/profile (the system wide bash configuration script).
Back to top
View user's profile Send private message
Veldrin
Veteran
Veteran


Joined: 27 Jul 2004
Posts: 1945
Location: Zurich, Switzerland

PostPosted: Mon Apr 21, 2008 6:38 am    Post subject: Reply with quote

Quote:
ok. messy solution. i got the profile file from the stage 3 tarball and copied it over.
messy indeed: /etc/profile is part of baselayout - you could emerge that the next time...

cheers
V.
Back to top
View user's profile Send private message
desultory
Bodhisattva
Bodhisattva


Joined: 04 Nov 2005
Posts: 9410

PostPosted: Mon Apr 21, 2008 7:28 am    Post subject: Reply with quote

Using buildpkg or, at least, buildsyspkg enabled in FEATURES in /etc/make.conf allows for significantly more rapid recovery of files, either by reinstalling the entire package or by recovering individual files as in this case.
Back to top
View user's profile Send private message
x22
Apprentice
Apprentice


Joined: 24 Apr 2006
Posts: 208

PostPosted: Mon Apr 21, 2008 9:15 am    Post subject: Reply with quote

eselect profile manages /etc/make.profile not /etc/profile.

/etc/profile can be recreated by env-update.
Back to top
View user's profile Send private message
desultory
Bodhisattva
Bodhisattva


Joined: 04 Nov 2005
Posts: 9410

PostPosted: Tue Apr 22, 2008 11:17 pm    Post subject: Reply with quote

Not exactly, etc-update regenerates /etc/profile.env, which is sourced by /etc/profile if it is present, /etc/profile is part of sys-apps/baselayout.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum