📄 095-099.html
字号:
<HTML>
<HEAD>
<TITLE>Linux Configuration and Installation:Installing Linux</TITLE>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>
-->
<!--ISBN=1558285660//-->
<!--TITLE=Linux Configuration and Installation//-->
<!--AUTHOR=Patrick Volkerding//-->
<!--AUTHOR=Kevin Reichard//-->
<!--AUTHOR=Eric Foster//-->
<!--PUBLISHER=IDG Books Worldwide, Inc.//-->
<!--IMPRINT=M & T Books//-->
<!--CHAPTER=2//-->
<!--PAGES=095-099//-->
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//-->
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="092-095.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="099-103.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<P><BR></P>
<H3><A NAME="Heading24"></A><FONT COLOR="#000077">Upgrading from a Previous Version of Linux</FONT></H3>
<P>If you’re using an older version of Slackware and you want to upgrade to the version on the accompanying CD-ROMs, you can do so without going through the agony of a full installation.
</P>
<P>The new versions of <B>pkgtool</B> (a package maintenance tool developed for the Slackware distribution) should provide a clean upgrade path from earlier versions of Slackware. Because <B>pkgtool</B> can now remove packages from your hard drive while running on a self-contained Linux filesystem loaded into a ramdisk, it can remove <I>any</I> files from your system, including ones, such as the shell, shared libraries, init, and other crucial system files, that were difficult or impossible to remove while running on the hard drive.</P>
<BLOCKQUOTE>
<P><FONT SIZE="-1"><HR><B>NOTE: </B>Upgrading through this method is probably more trouble than it’s worth. For example, several commonly reported bugs are caused by improper upgrading—mixing disks from different versions of the distribution and/or failing to remove old packages first. We need to face the fact that things haven’t quite settled down yet, and until they do it’s not always possible to foresee differences in filesystem structure, daemons, utilities, and so on that can lead to problems with the system.<P>The <I>correct</I> and best way to upgrade to a new distribution version is to back up everything you want saved and then reinstall from scratch. This is especially true for the <I>A</I> and <I>N</I> series disks. If you do upgrade packages from one of those disksets, you should seriously consider which packages from the other one might be related somehow and install those too. Again, it can be tricky to know just which packages are related, given the overall complexity of the Linux system. That’s why, unless you <I>really</I> know what you’re doing, there is a substantial risk of screwing up a system while attempting to upgrade it.<HR></FONT>
</BLOCKQUOTE>
</P>
<P>Here’s how you’d upgrade to a newer version of Slackware from any previous version that supports package information files in <B>/var/adm/packages</B>. (If your system puts these files elsewhere, you might still be able to do this by creating a symbolic link from the package information directory to <B>/var/adm/packages</B>.) The steps are as follows:</P>
<DL>
<DD><B>1.</B> Back up important files, or take your chances. Odds are you’ll come through OK. However, there are two important exceptions to this rule. The first (and most obvious) is when a package overwrites a file you meant to keep with a new one. The second, and possibly more serious, situation is when the system needs to replace an existing file with a symbolic link. It will replace the file, whether it’s a simple file, a file with a file permission of 444, or a directory filled with other subdirectories, each containing part of your doctoral dissertation. So, be careful.
<DD><B>2.</B> Make a list of the packages you plan to replace.
<DD><B>3.</B> Use a boot-kernel disk to boot one of the root/install disks. Log in as <B>root</B>.
<DD><B>4.</B> Mount your root Linux partitions under <B>/mnt</B> while logged into the install disk. The method used here differs, depending on what filesystem you’re using for Linux. For example, to mount an <I>ext2fs</I> partition, use
<!-- CODE SNIP //-->
<PRE>
mount /dev/hda1 /mnt -t ext2
</PRE>
<!-- END CODE SNIP //-->
<BR>Replace <B>/dev/hda1</B> with the name of your root partition.
<BR>If you’re using UMSDOS (the system that allows you to install onto an existing MS-DOS filesystem), use this command:
<!-- CODE SNIP //-->
<PRE>
mount /dev/hda1 /mnt -t umsdos
</PRE>
<!-- END CODE SNIP //-->
<BR>If you’ve got other partitions that are part of your Linux filesystem, mount them after you’ve mounted that root partition. The method is the same; for example, here’s how you’d mount an <I>ext2fs /usr</I> partition:
<!-- CODE SNIP //-->
<PRE>
mount /dev/hda2 /mnt/usr -t ext2
</PRE>
<!-- END CODE SNIP //-->
<DD><B>5.</B> Once the partition has been mounted, you need to activate swap space if the system has less than 8 megabytes of RAM. (If you have 8 or more megabytes of RAM, you may go on to step 6.)
<BR>You may use either a swap partition or a swapfile. To get a quick listing of your partition information, you can always type <B>fdisk -l</B>. Doing this on a typical machine provides the following information:
<!-- CODE //-->
<PRE>
Disk /dev/hda: 15 heads, 17 sectors, 1001 cylinders
Units = cylinders of 255 * 512 bytes
Device Boot Begin Start End Blocks Id System
/dev/hda1 10 10 90 10327+ 1 DOS 12-bit FAT
/dev/hda2 91 91 1000 116025 5 Extended
/dev/hda3 * 1 1 9 1139 a OPUS
/dev/hda5 * 91 91 1000 116016+ 6 DOS 16-bit >=32M
Disk /dev/hdb: 16 heads, 31 sectors, 967 cylinders
Units = cylinders of 496 * 512 bytes
Device Boot Begin Start End Blocks Id System
/dev/hdb1 * 1 1 921 228392+ 6 DOS 16-bit >=32M
/dev/hdb2 922 922 966 11160 82 Linux swap
</PRE>
<!-- END CODE //-->
<BR>From this display, you can see that <B>/dev/hdb2</B> has been designated as the Linux swap partition. If the partition has not been previously prepared with <B>mkswap</B>, here’s how that would be done:
<!-- CODE SNIP //-->
<PRE>
mkswap /dev/hdb2 11160
</PRE>
<!-- END CODE SNIP //-->
<BR>To activate the swap partition, you would type:
<!-- CODE SNIP //-->
<PRE>
swapon /dev/hdb2
</PRE>
<!-- END CODE SNIP //-->
<DD><B>6.</B> Remove the packages. To do this, type <B>pkgtool</B> and select the option <B>Remove installed packages</B>. You’ll be given a list of packages that you’ve installed—just select the packages that you plan to replace.
<BR>If you’re using one of the full-color versions of <B>pkgtool</B>, select the packages to remove by moving up and down through the list with <B>+</B> and <B>-</B> and selecting packages to remove with the <B>Spacebar</B>. Once you’ve selected all the packages you want to remove, hit <B>Enter</B> to remove them.
<BR>If you’re using one of the tty-based versions of <B>pkgtool</B>, you’ll have to type in the names of the packages you wish to remove. Separate each name with a space. Don’t worry about how long the line is—just keep typing in the names until you’ve entered them all, and then hit <B>Enter</B> to remove them.
</DL>
<P>That’s it! Now you’ve cleaned up the old packages and you’re ready to install the new ones. Type <B>setup</B> at a command line and install the new packages as normal.</P>
<P>Although it never hurts to play it safe and remove all packages from the bootdisk, almost all of them can be removed using <B>pkgtool</B> from your hard drive. The <I>A</I> series is the important exception here.</P><P><BR></P>
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="092-095.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="099-103.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
</td>
</tr>
</table>
<!-- begin footer information -->
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -