View previous topic :: View next topic |
Author |
Message |
willie_wang Tux's lil' helper
Joined: 02 Apr 2008 Posts: 87 Location: Edinburgh, Scotland
|
Posted: Mon Apr 21, 2008 2:07 am Post subject: [SOLVED] Accidentally overwritten /etc/profile file... |
|
|
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 |
|
|
desultory Bodhisattva
Joined: 04 Nov 2005 Posts: 9410
|
Posted: Mon Apr 21, 2008 2:24 am Post subject: |
|
|
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 |
|
|
willie_wang Tux's lil' helper
Joined: 02 Apr 2008 Posts: 87 Location: Edinburgh, Scotland
|
Posted: Mon Apr 21, 2008 2:37 am Post subject: |
|
|
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 |
|
|
desultory Bodhisattva
Joined: 04 Nov 2005 Posts: 9410
|
Posted: Mon Apr 21, 2008 2:58 am Post subject: |
|
|
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 |
|
|
willie_wang Tux's lil' helper
Joined: 02 Apr 2008 Posts: 87 Location: Edinburgh, Scotland
|
Posted: Mon Apr 21, 2008 3:05 am Post subject: |
|
|
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 |
|
|
willie_wang Tux's lil' helper
Joined: 02 Apr 2008 Posts: 87 Location: Edinburgh, Scotland
|
Posted: Mon Apr 21, 2008 3:35 am Post subject: |
|
|
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 |
|
|
desultory Bodhisattva
Joined: 04 Nov 2005 Posts: 9410
|
Posted: Mon Apr 21, 2008 3:52 am Post subject: |
|
|
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 |
|
|
Veldrin Veteran
Joined: 27 Jul 2004 Posts: 1945 Location: Zurich, Switzerland
|
Posted: Mon Apr 21, 2008 6:38 am Post subject: |
|
|
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 |
|
|
desultory Bodhisattva
Joined: 04 Nov 2005 Posts: 9410
|
Posted: Mon Apr 21, 2008 7:28 am Post subject: |
|
|
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 |
|
|
x22 Apprentice
Joined: 24 Apr 2006 Posts: 208
|
Posted: Mon Apr 21, 2008 9:15 am Post subject: |
|
|
eselect profile manages /etc/make.profile not /etc/profile.
/etc/profile can be recreated by env-update. |
|
Back to top |
|
|
desultory Bodhisattva
Joined: 04 Nov 2005 Posts: 9410
|
Posted: Tue Apr 22, 2008 11:17 pm Post subject: |
|
|
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 |
|
|
|