| 1 |
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
|
| 3 |
<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/new-upgrade-to-gentoo-1.4.xml,v 1.18 2011/09/04 17:53:40 swift Exp $ -->
|
| 4 |
|
| 5 |
<!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
|
| 6 |
|
| 7 |
<guide>
|
| 8 |
|
| 9 |
<title>Gentoo 1.4 Upgrade Guide</title>
|
| 10 |
|
| 11 |
<author title="Author">
|
| 12 |
<mail link="rac@gentoo.org">Robert Coie</mail>
|
| 13 |
</author>
|
| 14 |
<author title="Copy Editor">
|
| 15 |
<mail link="avenj@gentoo.org">Jon Portnoy</mail>
|
| 16 |
</author>
|
| 17 |
|
| 18 |
<abstract>
|
| 19 |
A method for upgrading older Gentoo installations in place to Gentoo 1.4
|
| 20 |
</abstract>
|
| 21 |
|
| 22 |
<!-- The content of this document is licensed under the CC-BY-SA license -->
|
| 23 |
<!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
|
| 24 |
<license/>
|
| 25 |
|
| 26 |
<version>1</version>
|
| 27 |
<date>2024-07-24</date>
|
| 28 |
|
| 29 |
<chapter>
|
| 30 |
<title>Before you begin</title>
|
| 31 |
<section>
|
| 32 |
<title>Be prepared</title>
|
| 33 |
<body>
|
| 34 |
|
| 35 |
<p>
|
| 36 |
As with any major upgrade to the core of your Gentoo system, there is always the
|
| 37 |
possibility that unforeseen problems will ensue. It is always prudent to back
|
| 38 |
up all important data before beginning this process. If possible, try to
|
| 39 |
allocate a large block of time for this upgrade, so that you will not feel
|
| 40 |
rushed. All the software on your machine will need to be recompiled.
|
| 41 |
</p>
|
| 42 |
|
| 43 |
</body>
|
| 44 |
</section>
|
| 45 |
<section>
|
| 46 |
<title>Other options</title>
|
| 47 |
<body>
|
| 48 |
|
| 49 |
<p>
|
| 50 |
This is not the only way to upgrade your system. You can install a new 1.4
|
| 51 |
system onto a separate partition and reuse some of your system configuration
|
| 52 |
instead. This method also has the advantage that you can always go back to your
|
| 53 |
old system in the meantime as a fallback. You may also decide to simply not
|
| 54 |
upgrade your system. If you decide you want to upgrade in place, read on.
|
| 55 |
</p>
|
| 56 |
|
| 57 |
</body>
|
| 58 |
</section>
|
| 59 |
<section>
|
| 60 |
<title>General notes</title>
|
| 61 |
<body>
|
| 62 |
|
| 63 |
<p>
|
| 64 |
Whenever the code listings suggest running the <c>emerge</c> command, it is
|
| 65 |
always a good idea to make a test run of the command using the <c>-p</c> or
|
| 66 |
<c>--pretend</c> option to make sure that the command will do what you expect it
|
| 67 |
to do.
|
| 68 |
</p>
|
| 69 |
|
| 70 |
</body>
|
| 71 |
</section>
|
| 72 |
</chapter>
|
| 73 |
<chapter>
|
| 74 |
<title>Upgrading in place</title>
|
| 75 |
<section>
|
| 76 |
<title>Get Portage as current as possible</title>
|
| 77 |
<body>
|
| 78 |
|
| 79 |
<p>
|
| 80 |
Some of the syntax of current ebuilds is unreadable by older versions of
|
| 81 |
Portage. If you don't have at least Portage 2.0.44, try upgrading Portage.
|
| 82 |
</p>
|
| 83 |
|
| 84 |
<pre caption="Updating Portage">
|
| 85 |
# <i>emerge --sync</i>
|
| 86 |
# <i>emerge -u portage</i>
|
| 87 |
</pre>
|
| 88 |
|
| 89 |
<note>
|
| 90 |
If your Portage version is very old, you may get an error message containing the
|
| 91 |
phrase "unscriptable object". Read and follow the instructions in
|
| 92 |
<path>/usr/portage/sys-apps/portage/files/README.RESCUE</path>. Your Portage
|
| 93 |
install should then be current.
|
| 94 |
</note>
|
| 95 |
|
| 96 |
</body>
|
| 97 |
</section>
|
| 98 |
<section>
|
| 99 |
<title>Preparing GCC for cohabitation</title>
|
| 100 |
<body>
|
| 101 |
|
| 102 |
<p>
|
| 103 |
You will be installing a newer version of GCC during this upgrade. Versions of
|
| 104 |
GCC older than 2.95.3-r8 are not designed to have multiple versions of GCC
|
| 105 |
installed. You must therefore upgrade GCC to at least version 2.95.3-r8. This
|
| 106 |
will also have the beneficial side-effect of installing the <c>gcc-config</c>
|
| 107 |
package on your system, which can be used to switch back and forth between
|
| 108 |
various installed versions of GCC.
|
| 109 |
</p>
|
| 110 |
|
| 111 |
<pre caption="Updating GCC">
|
| 112 |
# <i>emerge -u gcc</i>
|
| 113 |
</pre>
|
| 114 |
|
| 115 |
<p>
|
| 116 |
You can now check to see if gcc-config is working properly:
|
| 117 |
</p>
|
| 118 |
|
| 119 |
<pre caption="Verifying GCC profile">
|
| 120 |
# <i>gcc-config --get-current-profile</i>
|
| 121 |
</pre>
|
| 122 |
|
| 123 |
<p>
|
| 124 |
This should return i686-pc-linux-gnu-2.95.3 on most x86 systems. Older systems
|
| 125 |
may return i586-pc-linux-gnu-2.95.3.
|
| 126 |
</p>
|
| 127 |
|
| 128 |
</body>
|
| 129 |
</section>
|
| 130 |
<section>
|
| 131 |
<title>Installing GCC 3</title>
|
| 132 |
<body>
|
| 133 |
|
| 134 |
<p>
|
| 135 |
Now you can install a newer version of GCC without damaging your current
|
| 136 |
compiler. Look in <path>/usr/portage/sys-devel/gcc</path> for a version of the
|
| 137 |
GCC ebuild that is at least 3.2.1-r6. Choose the highest version that is marked
|
| 138 |
stable for your architecture. To see if an ebuild is considered stable for your
|
| 139 |
architecture, look for the KEYWORDS line in the ebuild file. If it has your
|
| 140 |
architecture listed without a ~ in front of it, it is considered stable.
|
| 141 |
Assuming 3.2.2 is the most current stable version, we first need to remove the
|
| 142 |
glibc dependency from gcc.
|
| 143 |
</p>
|
| 144 |
|
| 145 |
<p>
|
| 146 |
Edit <path>/usr/portage/sys-devel/gcc/gcc-3.2.2.ebuild</path> and search for the
|
| 147 |
line containing <c>DEPEND</c>. Remove the <c>glibc</c> dependency and save the
|
| 148 |
ebuild.
|
| 149 |
</p>
|
| 150 |
|
| 151 |
<pre caption="Editing gcc-3.2.2.ebuild">
|
| 152 |
# <i>vim /usr/portage/sys-devel/gcc/gcc-3.2.2.ebuild</i>
|
| 153 |
</pre>
|
| 154 |
|
| 155 |
<p>
|
| 156 |
Now install the latest GCC version on your system:
|
| 157 |
</p>
|
| 158 |
|
| 159 |
<pre caption="Install the latest GCC">
|
| 160 |
# <i>USE="-java" emerge /usr/portage/sys-devel/gcc/gcc-3.2.2.ebuild</i>
|
| 161 |
</pre>
|
| 162 |
|
| 163 |
</body>
|
| 164 |
</section>
|
| 165 |
<section>
|
| 166 |
<title>Changing profiles</title>
|
| 167 |
<body>
|
| 168 |
|
| 169 |
<p>
|
| 170 |
Now you need to change two sets of profiles: your gcc-config profile and your
|
| 171 |
Portage profile.
|
| 172 |
</p>
|
| 173 |
|
| 174 |
<pre caption="Change the Portage profile">
|
| 175 |
# <i>cd /etc/portage</i>
|
| 176 |
# <i>rm make.profile</i>
|
| 177 |
<comment>(Replace "x86" with your architecture)</comment>
|
| 178 |
# <i>ln -s ../usr/portage/profiles/default-x86-1.4 make.profile</i>
|
| 179 |
</pre>
|
| 180 |
|
| 181 |
<pre caption="Change the GCC profile">
|
| 182 |
<comment>(Note the one for the version you just emerged, use it below)</comment>
|
| 183 |
# <i>gcc-config --list-profiles</i>
|
| 184 |
<comment>(Replace with the version you noted above)</comment>
|
| 185 |
# <i>gcc-config i686-pc-linux-gnu-3.2.2</i>
|
| 186 |
</pre>
|
| 187 |
|
| 188 |
</body>
|
| 189 |
</section>
|
| 190 |
<section>
|
| 191 |
<title>Recompile toolchain</title>
|
| 192 |
<body>
|
| 193 |
|
| 194 |
<p>
|
| 195 |
Now you need to recompile your core toolchain with your new compiler. If you
|
| 196 |
are continuing in the same shell, you need to run <c>source /etc/profile</c> as
|
| 197 |
gcc-config instructed you to. Then emerge glibc and binutils using your new
|
| 198 |
compiler:
|
| 199 |
</p>
|
| 200 |
|
| 201 |
<pre caption="Rebuilding the toolchain">
|
| 202 |
# <i>emerge glibc binutils</i>
|
| 203 |
</pre>
|
| 204 |
|
| 205 |
<warn>
|
| 206 |
It is quite likely that you will upgrade glibc from a 2.2 or older version to
|
| 207 |
2.3. Do not downgrade glibc afterwards. Any software you have compiled against
|
| 208 |
glibc 2.3 will stop working, and this can make your system unusable.
|
| 209 |
</warn>
|
| 210 |
|
| 211 |
</body>
|
| 212 |
</section>
|
| 213 |
<section>
|
| 214 |
<title>Recompiling everything with your new compiler</title>
|
| 215 |
<body>
|
| 216 |
|
| 217 |
<p>
|
| 218 |
Now you may recompile everything on your system with your new compiler:
|
| 219 |
</p>
|
| 220 |
|
| 221 |
<pre caption="Rebuilding the entire system">
|
| 222 |
# <i>emerge -e world</i>
|
| 223 |
</pre>
|
| 224 |
|
| 225 |
<note>
|
| 226 |
If this command fails at any point due to errors, you
|
| 227 |
can use <c>emerge --resume</c> to continue the process where
|
| 228 |
you left off. This requires Portage 2.0.47 or later.
|
| 229 |
</note>
|
| 230 |
|
| 231 |
</body>
|
| 232 |
</section>
|
| 233 |
</chapter>
|
| 234 |
</guide>
|