版本30和31间的区别
于2020-04-14 12:52:20修订的的版本30
大小: 18048
编辑: czk
备注:
于2020-04-14 12:53:02修订的的版本31
大小: 18092
编辑: czk
备注:
删除的内容标记成这样。 加入的内容标记成这样。
行号 1: 行号 1:
## page was renamed from Linux系统安装

安装

1. Debian安装

事先在硬盘上准备一个未分区的空间,至少5G。最好先备份硬盘上的重要数据,或者使用完全空闲的硬盘。

下载debian安装光盘的镜像文件。完整版需要很多光盘。如果网络条件许可,使用网络安装版最方便:http://www.debian.org/distrib/netinst

将镜像刻录成光盘,使用这张光盘引导系统。引导后出来安装界面,安照提示一步一步完成即可。其中在选择apt源的时候,选择cn99的http服务器比较快。

2. Ubuntu 安装

安装前:

  • 事先在硬盘上准备一个未分区的空间,至少5G。最好先备份硬盘上的重要数据,或者使用完全空闲的硬盘。
  • 可以从官方网站下载安装光盘,然后刻录成光盘:http://www.ubuntu.org.cn/getubuntu/download

  • 或者也可以向ubuntu官方申请邮寄免费光盘过来,申请地址在: https://shipit.ubuntu.com/ 不过速度比较慢,一般要等一个月左右才能拿到光盘。

  • ubuntu下载

  • http://releases.ubuntu.com

  • Kubuntu KDE桌面版;Edubuntu 教学版;Alternate - Gnome桌面版(文本安装模式);Desktop - Gnome桌面版(图形安装模式);Server - 服务器版(文本安装模式);

光盘安装过程:

  • 将光盘放入光驱,按照提示一步一步执行即可。在硬盘分区这一步要特别小心,默认可能是删除硬盘所有分区,需要根据具体情况修改。

硬盘安装过程:(以Ubuntu-8.04-desktop-i386.iso 为例)

  • 第一种方法(最简单的安装方法):用winiso或winrar解压光盘镜像里的内容到同一文件夹内(和光盘镜像放在一起),双击wubi安装。按照提示完成后重启电脑,在启动菜单上选择Ubuntu就可以一步步安装Ubuntu到你的硬盘了。
  • 第二种方法:将 Ubuntu-8.04-desktop-i386.iso 中的 .disk ,casper ,wubi.exe ,umenu.exe 四个东西解压到fat32分区根目录(我用的是C盘)。双击运行 umenu.exe ,选择 demo and full installation ,选中 help me to boot from CD ,点击 finish ,出现 install CD booter ,点击下一步,将自动配置启动文件,按提示重启,出现系统选择菜单时选择 Ubuntu 即可。有的时候不能正常启动或安装,则在屏幕左上角出现“ Press `ESC’ to enter the menu ”时,按 esc 键,进入启动菜单,选择第一项 第二项 或 第三项 或第四项试试。
  • 第三种方法:
    1. 下载GRUBFORDOS,将grldr和grub.exe放入C盘根目录;
    2. 在C盘根目录新建 menu.lst文件,内容如下:(如果已经有menu.lst文件的覆盖亦可)

               title Install Ubuntu
               find –set-root /Ubuntu-8.04-desktop-i386.iso
               kernel  /vmlinuz  boot=casper  find_iso=/ubuntu-8.04-beta-desktop-i386.iso noapic (我的是AMD平台的)
               initrd  /initrd.gz
      那个noapic,因为AMD CPU的原因,加入noapic,否则会有kernel panic.
    3. 用winiso或winrar,复制 Casper和 .disk两个目录到C盘根目录;
    4. 复制Casper目录中的vmlinuz和initrd.gz文件到C盘根目录;
    5. 修改C盘根目录下的boot.ini文件,在文件末尾加入下面代码:

             C:\grldr=”GRUB”
    6. 重启,在启动菜单处,选择Grub,然后再选择Install Ubuntu就可以开始安装了。

安装完成后,修改ubuntu的源,改成国内的ubuntu源速度比较快。修改文件:/etc/apt/sources.list,选如下多组服务器中的一组替换原来的内容:(以下是feisty 7.04的源,如果是7.10改成gutsy,如果是8.04改成hardy,如果是8.10改成intrepid)

    * Archive.ubuntu.com 更新服务器(欧洲):
deb http://archive.ubuntu.com/ubuntu/ feisty main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ feisty-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ feisty-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ feisty-backports main restricted universe multiverse
deb http://archive.ubuntu.org.cn/ubuntu-cn/ feisty main restricted universe multiverse

    * Ubuntu.cn99.com 更新服务器(江苏省常州市电信,推荐电信用户使用。):

deb http://ubuntu.cn99.com/ubuntu/ feisty main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ feisty-updates main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ feisty-security main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ feisty-backports main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu-cn/ feisty main restricted universe multiverse

    * Mirror.lupaworld.com 更新服务器(浙江省杭州市电信,推荐电信用户使用。):

deb http://mirror.lupaworld.com/ubuntu/archive/ feisty main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu/archive/ feisty-security main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu/archive/ feisty-updates main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu/archive/ feisty-backports main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu/ubuntu-cn/ feisty main restricted universe multiverse

    * 上海市交通大学 更新服务器(教育网,推荐校园网和网通用户使用。):

deb http://ftp.sjtu.edu.cn/ubuntu/ feisty main multiverse restricted universe
deb http://ftp.sjtu.edu.cn/ubuntu/ feisty-backports main multiverse restricted universe
deb http://ftp.sjtu.edu.cn/ubuntu/ feisty-proposed main multiverse restricted universe
deb http://ftp.sjtu.edu.cn/ubuntu/ feisty-security main multiverse restricted universe
deb http://ftp.sjtu.edu.cn/ubuntu/ feisty-updates main multiverse restricted universe
deb http://ftp.sjtu.edu.cn/ubuntu-cn/ feisty main multiverse restricted universe

    * 北京市清华大学 更新服务器(教育网,推荐校园网和网通用户使用。):

deb http://mirror.net9.org/ubuntu/ feisty main multiverse restricted universe
deb http://mirror.net9.org/ubuntu/ feisty-backports main multiverse restricted universe
deb http://mirror.net9.org/ubuntu/ feisty-proposed main multiverse restricted universe
deb http://mirror.net9.org/ubuntu/ feisty-security main multiverse restricted universe
deb http://mirror.net9.org/ubuntu/ feisty-updates main multiverse restricted universe
deb http://mirror.net9.org/ubuntu-cn/ feisty main multiverse restricted universe

    * 中国 台湾省台湾大学 更新服务器(推荐网通用户使用,电信PING平均响应速度41MS。)

deb http://ubuntu.csie.ntu.edu.tw/ubuntu/ feisty main restricted universe multiverse
deb http://ubuntu.csie.ntu.edu.tw/ubuntu/ feisty-updates main restricted universe multiverse
deb http://ubuntu.csie.ntu.edu.tw/ubuntu/ feisty-backports main restricted universe multiverse
deb http://ubuntu.csie.ntu.edu.tw/ubuntu/ feisty-security main restricted universe multiverse
deb http://ftp.sjtu.edu.cn/ubuntu-cn/ feisty main multiverse restricted universe

    * Mirror.vmmatrix.net 更新服务器(上海市电信,推荐电信网通用户使用。):

deb http://mirror.vmmatrix.net/ubuntu/ feisty main restricted universe multiverse
deb http://mirror.vmmatrix.net/ubuntu/ feisty-updates main restricted universe multiverse
deb http://mirror.vmmatrix.net/ubuntu/ feisty-backports main restricted universe multiverse
deb http://mirror.vmmatrix.net/ubuntu/ feisty-security main restricted universe multiverse
deb http://ftp.sjtu.edu.cn/ubuntu-cn/ feisty main multiverse restricted universe

我的ubuntu的source.list

deb http://ubuntu.cn99.com/ubuntu/ feisty main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ feisty-updates main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ feisty-security main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ feisty-backports main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu-cn/ feisty main restricted universe multiverse

Ubuntu 源列表 http://wiki.ubuntu.com.cn/index.php?title=Qref/Source&variant=zh-cn

安装686版的内核代替386版的内核

apt-get install linux-generic

ubuntu的优化: http://www.linuxsir.org/bbs/showthread.php?t=264885

安装java

apt-get install sun-java5-jdk
apt-get install sun-java5-plugin
update-alternatives --config java

配置java字体

wget http://paste.ubuntu.org.cn/d323
sudo mv /etc/java-1.5.0-sun/fontconfig.properties /etc/java-1.5.0-sun/fontconfig.properties.old
sudo mv d323 /etc/java-1.5.0-sun/fontconfig.properties
sudo chown root:root /etc/java-1.5.0-sun/fontconfig.properties

adsl拨号

使用pppoeconf配置拨号的属性

pppoeconf

使用pon进行拨号

pon dsl-provider

使用poff断开

poff dsl-provider

网络配置

Debian和Ubuntu的网络配置大多出现在文件/etc/hostname和文件/etc/network/ interfaces里,另从/etc/network目录下的options文件里提供一点儿帮助。 主机名在/etc/hostname文件里设置。这个文件里的名字应该是全名,因为它的值要在各种场合下使用,其中有些场合需要全名。不过,标准的Debian安装在那里留下的不是一个全名。

/etc/hostname           #主机名
/etc/network/interfaces #IP地址、子网掩码、默认网关
/etc/network/options    #IP转发

可以用VI编辑以上文件,也可用"ifconfig"和"route"配置

休眠

查看系统支持哪些模式

cat /sys/power/state
  • suspend to disk(S4):

echo disk > /sys/power/state
  • suspend to ram(S3):

echo mem > /sys/power/state

hp的笔记本从待机恢复后键盘鼠标失去响应的问题,可以在/etc/acpi/suspend.d中新建文件20-i8042-input.sh:

# Unbind the AT keyboard interface.
if [ -f /sys/bus/platform/drivers/i8042/unbind ]; then
  echo -n "i8042" > /sys/bus/platform/drivers/i8042/unbind
fi

在/etc/acpi/resume.d中新建文件80-i8042-input.sh:

# Rebind the AT keyboard interface.
if [ -f /sys/bus/platform/drivers/i8042/bind ]; then
  echo -n "i8042" > /sys/bus/platform/drivers/i8042/bind
fi

节电措施

Suggestion: increase the VM dirty writeback time from 5.00 to 15 seconds with:

  echo 1500 > /proc/sys/vm/dirty_writeback_centisecs

This wakes the disk up less frequenty for background VM activity

X配置

从X.org 7.3和Xrandr1.2起,Linux的图形界面可以动态修改双头显示的配置了。首先将/etc/X11/xorg.conf改为(Intel 945显卡):

Section "Files"
EndSection

Section "InputDevice"
        Identifier      "Generic Keyboard"
        Driver          "kbd"
        Option          "CoreKeyboard"
        Option          "XkbRules"      "xorg"
        Option          "XkbModel"      "pc105"
        Option          "XkbLayout"     "us"
EndSection

Section "InputDevice"
        Identifier      "Configured Mouse"
        Driver          "mouse"
        Option          "CorePointer"
        Option          "Device"                "/dev/input/mice"
        Option          "Protocol"              "ImPS/2"
        Option          "ZAxisMapping"          "4 5"
        Option          "Emulate3Buttons"       "true"
EndSection

Section "InputDevice"
        Identifier      "Synaptics Touchpad"
        Driver          "synaptics"
        Option          "SendCoreEvents"        "true"
        Option          "Device"                "/dev/psaux"
        Option          "Protocol"              "auto-dev"
        Option          "HorizScrollDelta"      "0"
EndSection



Section "Device"
        Identifier      "Intel Corporation Mobile 945GM/GMS, 943/940GML Express Integrated Graphics Controller"
        Driver          "intel"
        BusID           "PCI:0:2:0"
EndSection

Section "Monitor"
        Identifier      "通用显示器"
        Option          "DPMS"
EndSection

Section "Screen"
        Identifier      "Default Screen"
        Device          "Intel Corporation Mobile 945GM/GMS, 943/940GML Express Integrated Graphics Controller"
        Monitor         "通用显示器"
        DefaultDepth    24
        SubSection "Display"
                Virtual 2048 2048
        EndSubSection
EndSection

Section "ServerLayout"
        Identifier      "Default Layout"
        Screen          "Default Screen"
        InputDevice     "Generic Keyboard"
        InputDevice     "Configured Mouse"
        InputDevice     "stylus"        "SendCoreEvents"
        InputDevice     "cursor"        "SendCoreEvents"
        InputDevice     "eraser"        "SendCoreEvents"
        InputDevice     "Synaptics Touchpad"
EndSection

用xrandr命令修改双头设置

usage: xrandr [options]
  where options are:
  -display <display> or -d <display>
  -help
  -o <normal,inverted,left,right,0,1,2,3>
            or --orientation <normal,inverted,left,right,0,1,2,3>
  -q        or --query
  -s <size>/<width>x<height> or --size <size>/<width>x<height>
  -r <rate> or --rate <rate> or --refresh <rate>
  -v        or --version
  -x        (reflect in x)
  -y        (reflect in y)
  --screen <screen>
  --verbose
  --dryrun
  --prop or --properties
  --fb <width>x<height>
  --fbmm <width>x<height>
  --dpi <dpi>/<output>
  --output <output>
      --auto
      --mode <mode>
      --preferred
      --pos <x>x<y>
      --rate <rate> or --refresh <rate>
      --reflect normal,x,y,xy
      --rotate normal,inverted,left,right
      --left-of <output>
      --right-of <output>
      --above <output>
      --below <output>
      --same-as <output>
      --set <property> <value>
      --off
      --crtc <crtc>
  --newmode <name> <clock MHz>
            <hdisp> <hsync-start> <hsync-end> <htotal>
            <vdisp> <vsync-start> <vsync-end> <vtotal>
            [+HSync] [-HSync] [+VSync] [-VSync]
  --rmmode <name>
  --addmode <output> <name>
  --delmode <output> <name>

Linux使用基础:mount登录与安装软件

  • 在这里,配置的对象并非内核,而是软件。至于网络的配置,主要在安装系统是已经基本完成;也可以进入GUI界面从菜单选择liloconf来配置。 与WINDOWS一样,在Linux系统可以从光盘、软盘安装应用软件;但不同的是,它需要用命令mount来登录光驱、软驱。而且,软件大多是经过压缩的,所以还需要懂得如何解压。最后必须配置、编译才能运行。下面分四个方面进行介绍: 一、mount登录 Linux的软驱设备用特殊文件/dev/fd0,文件系统是msdos,因此用以下命令登录,读取软盘内容: # mount -t msdos /dev/fd0 /mnt/floppy # cd /mnt/floppy 同理,键入以下命令读光盘: # mount -t iso9660 /dev/hdb /mnt/cdrom # cd /mnt/cdrom 然后,用cp命令将所需的软件拷贝到系统中。 退出软驱、光驱用umount命令。注意,不能在其目录中使用此命令,而应先cd到其他目录,再使用:umount /mnt/cdrom。
  • 二、安装软件
    • for Linux的软件一般是以.gz或.tar或者.tar.gz结尾的。前者是由gzip压缩的,后者是先用tar归档,在用gzip压缩而成的。 1、以.gz结尾的为压缩文件,用命令:gzip -d filename来解压,得到的文件在当前目录中,但已没有了.gz。 2、以.tar结尾的为归档文件,用命令:tar -xvf filename来展开,生成的文件与源文件在同一目录中,只是少了.tar。 3、以.tar.gz结尾的文件最常见,可直接用命令:gzip -cd filename | tar xfv -来安装。 一般情况下,这类文件的第一项是一个目录,所以用上面的命令时会创建出这一个目录,并把所有的文件都存在此目录之下。如果是特殊情况,可先用命令:tar -tvf filename | more 来查看文件的第一项。倘若它并不是目录,则先创建一个目录,把文件放在此目录之下,在用命令:tar -xvf filename来安装。 经过以上步骤,会生成README及INSTALL等文件。用vi来仔细阅读这些文件造处于Linux有关的部分,更具体是进行配置。一般的步骤是:(1)./config,(2)make install,(3)make。主要的变化在第一步,其后面需要参数,可见入命令来选择:./config --help。 三、举例配置apache(阿帕其服务器)、php3两个软件 先从网上下载for Linux的软件apache.tar.gz、php3.tar.gz。 1、由于apache.tar.gz大于1.44M,所以笔者在center_5的MSDOS上用telnet命令登录Linux,通过put将其上传。 2、笔者将这两个软件放在/usr/src目录之下,用命令gzip -cd apache.tar.gz(php3.tar.gz)| tar xfv -来安装。这样会看到两个目录:apache_1.3.6和php-3.0.7。 3、在第一个目录之下,会看到非常重要的文件:README、INSTALL。如果此时是在GUI界面,则可以打开两个xterm,一个用于仔细阅读,一个则用于根据文件的提示进行配置。 4、在第二个目录中,也会很快的找到文件:INSTALL、INSTALL.DSO、README.QNX。步骤与3相似。由于这两个文件相互关联,必须先配置前者。 5、配置完后,进入/apache_1.3.6/conf/httpd.conf。在文件里面,理解其注释,删除或增加一些选项前的"#"。保存文件后,执行命令/usr/src/apache_1.3.6/bin/apachectl start,即打开http,然后可以在Netscape Communication来浏览网页。

Linux桌面安装与基本配置 (2023-04-02 23:28:19由czk编辑)

ch3n2k.com | Copyright (c) 2004-2020 czk.