/[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.10 - (show annotations) (download) (as text)
Fri Oct 5 17:41:20 2007 UTC (6 years, 6 months ago) by genone
Branch: MAIN
Changes since 1.9: +8 -6 lines
File MIME type: application/xml
increase visibility of python compability note

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

  ViewVC Help
Powered by ViewVC 1.1.20