/[gentoo]/xml/htdocs/proj/en/portage/doc/manually-fixing-portage.xml
Gentoo

Contents of /xml/htdocs/proj/en/portage/doc/manually-fixing-portage.xml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.19 - (hide annotations) (download) (as text)
Mon Mar 14 19:17:54 2011 UTC (3 years, 5 months ago) by zmedico
Branch: MAIN
Changes since 1.18: +2 -2 lines
File MIME type: application/xml
Bump stable_version to 2.1.9.42.

1 genone 1.1 <?xml version='1.0' encoding="UTF-8"?>
2 zmedico 1.19 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/proj/en/portage/doc/manually-fixing-portage.xml,v 1.18 2010/12/20 18:02:15 zmedico Exp $ -->
3 zmedico 1.18 <!DOCTYPE guide SYSTEM "/dtd/guide.dtd" [
4 zmedico 1.19 <!ENTITY stable_version "2.1.9.42">
5 zmedico 1.18 ]>
6 rane 1.6
7 genone 1.1 <guide link="/proj/en/portage/doc/manually-fixing-portage.xml">
8 rane 1.6
9 genone 1.1 <title>Manually fixing broken portage installations</title>
10 rane 1.6
11 genone 1.1 <author>
12     <mail link="genone@gentoo.org">Marius Mauch</mail>
13     </author>
14    
15     <abstract>
16 rane 1.6 This document attempts to help people to manually fix a broken sys-apps/portage
17 genone 1.1 installation.
18     </abstract>
19    
20 rane 1.6 <!-- The content of this document is licensed under the CC-BY-SA license -->
21     <!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
22 genone 1.1 <license/>
23    
24 genone 1.7 <version>0.3</version>
25     <date>2007-05-31</date>
26 genone 1.1
27     <chapter>
28     <title>Manually fixing portage</title>
29     <section>
30     <title>Purpose</title>
31     <body>
32 rane 1.6
33     <p>
34     This section will tell you how to manually update/fix your portage installation
35     in case you can't run <c>emerge sys-apps/portage</c>. While not hard it is
36     still to be done with great care, so please follow the listed steps exactly
37     (but apply common sense when necessary).
38     </p>
39    
40 genone 1.1 </body>
41     </section>
42     <section>
43     <title>Getting a portage tarball</title>
44     <body>
45 rane 1.6
46     <p>
47     The first step to do is to get the tarball of a current portage version. In the
48 zmedico 1.18 following text we will use <e>portage-&stable_version;</e> as an example (as this is the
49 rane 1.6 current stable version at the time of this writing), please replace that with a
50 genone 1.10 version present in the tree if possible.
51 rane 1.6 </p>
52 zmedico 1.16
53     <table>
54     <tr><th>Python Version</th><th>Portage Version</th></tr>
55     <tr>
56     <ti>&lt;= Python 2.5</ti>
57     <ti>
58     <uri link="http://distfiles.gentoo.org/distfiles/portage-2.1.6.tar.bz2">
59     portage-2.1.6.tar.bz2
60     </uri>
61     </ti>
62     </tr>
63     <tr>
64     <ti>&gt;= Python 2.6</ti>
65     <ti>
66 zmedico 1.18 <uri link="http://distfiles.gentoo.org/distfiles/portage-&stable_version;.tar.bz2">
67     portage-&stable_version;.tar.bz2
68 zmedico 1.16 </uri>
69     </ti>
70     </tr>
71     </table>
72    
73 genone 1.10 <warn>
74     If your currently installed version of python reported by <c>python -V</c>
75 zmedico 1.14 is less than 2.6 then you must choose a version of portage that is compatible with
76 zmedico 1.18 it. If you have at least python 2.6 then use <e>portage-&stable_version;.tar.bz2</e>. If
77 zmedico 1.14 you have python 2.4 or 2.5 then use <e>portage-2.1.6.tar.bz2</e>.
78 genone 1.10 </warn>
79 rane 1.6
80     <p>
81     Depending on the exact reason portage doesn't work for you anymore it may still
82 genone 1.1 be possible to use it to fetch the tarball for you, so as a first step please
83 rane 1.6 try to run <c>emerge --fetchonly sys-apps/portage</c>, only if that doesn't
84     work you have to manually fetch the tarball with:
85     </p>
86    
87     <pre caption="Fetching portage tarball with wget">
88 zmedico 1.18 # <i>wget -P /usr/portage/distfiles http://distfiles.gentoo.org/distfiles/portage-&stable_version;.tar.bz2</i>
89 genone 1.1 </pre>
90 rane 1.6
91     <p>
92     After that you should have the tarball available as
93 zmedico 1.18 <path>/usr/portage/distfiles/portage-&stable_version;.tar.bz2</path>.
94 rane 1.6 </p>
95    
96 genone 1.1 </body>
97     </section>
98     <section>
99     <title>Replacing the installed version</title>
100     <body>
101 rane 1.6
102     <p>
103     The next step is to unpack the tarball to a temporary location, using
104     <path>/root/portage-recover</path> as example the commands to do that are:
105     </p>
106    
107     <pre caption="Unpacking portage tarball">
108     # <i>cd /root</i>
109     # <i>mkdir portage-recover</i>
110     # <i>cd portage-recover</i>
111 zmedico 1.18 # <i>tar xfj /usr/portage/distfiles/portage-&stable_version;.tar.bz2</i>
112 genone 1.1 </pre>
113 rane 1.6
114     <p>
115     After you have done this it's just a matter of replacing the python and bash
116     files of your existing installation with the ones from the tarball (in most
117     cases anyway). To do so please run:
118     </p>
119    
120     <pre caption="Replacing installed files">
121 zmedico 1.18 # <i>cd /root/portage-recover/portage-&stable_version;</i>
122 zmedico 1.16 # <i>rm -rf /usr/lib/portage/*</i>
123 rane 1.6 # <i>cp -R pym bin /usr/lib/portage/</i>
124 genone 1.1 </pre>
125 rane 1.6
126 zmedico 1.11 <p>
127     If you are not using Gentoo on FreeBSD then you should remove the sed wrapper
128     script since it's not needed and it is known to cause problems with old
129     versions of bash:
130     </p>
131    
132     <pre caption="Removing the sed wrapper script">
133     # <i>rm -f /usr/lib/portage/bin/sed</i>
134     </pre>
135    
136 genone 1.7 <note>
137     If you accidently unmerged portage before or lost
138     <path>/etc/make.globals</path> for other reasons you should also copy
139     <path>cnf/make.globals</path> back into <path>/etc</path>, otherwise
140     portage might behave in strange ways.
141     </note>
142 zmedico 1.8 <note>
143     If the previous version of portage was less than 2.1 then you should now run
144     <c>emerge --metadata</c> before continuing to the next step. This is necessary
145     in order to convert the ebuild metadata to the new format that is used by
146     portage 2.1 and above. It is okay to run this command even if you are not sure
147     what the previous version of portage was.
148     </note>
149 genone 1.7
150 rane 1.6 <p>
151     Now you should have a working portage install again. To ensure a consistent
152 genone 1.1 system state however you should now run <c>emerge sys-apps/portage</c> again
153 rane 1.6 immediately.
154     </p>
155    
156     <p>
157     If you get a <e>command not found</e> error message when you try to run
158     <c>emerge</c> you have to recreate the symlink:
159     </p>
160    
161     <pre caption="Recreating the emerge symlink">
162 zmedico 1.16 # <i>ln -sf ../lib/portage/bin/emerge /usr/bin/emerge</i>
163 genone 1.4 </pre>
164 rane 1.6
165     <p>
166     If these steps didn't work for you your problem is likely not a broken portage
167     installation but something else beyond the scope of this document. Please
168     recheck the <uri link="/proj/en/portage/doc/common-problems.xml">list of common
169     problems</uri> and also look in <uri
170     link="http://bugs.gentoo.org">bugzilla</uri> if the problem is reported there.
171     </p>
172    
173 genone 1.1 </body>
174     </section>
175     </chapter>
176     </guide>

  ViewVC Help
Powered by ViewVC 1.1.20