• Debian 安装记录


    1.蓝色标注是安装的部分或配置的。
     
    作者:http://www.cppblog.com/jinglexy上海体育馆
     
    2.linux 发行版测评网站:www.distrowatch.com
      打印机支持及驱动:www.linuxprinting.org
      内核下载:www.kernel.org
      
    3.当前的发行版本
      stable----->sarge
      testing---->etch
      unstable--->sid
      推荐的安装版本:etch
     
    4.修复grub的招数:
      grub> root (hd0,3)
      grub> setup (hd0)
     
    5.安装debian基本系统:
      下载etch 的第一张光盘,完整光盘,这样可以少到网上找deb源了
      vmlinuz和initrd.gz可以用http://debian.cn99.com/的,不要用cd中的isolinux
      debian/dists/etch/main/installer-i386/beta3/images/hd-media/2.6/
      grub> find /debian/vmlinz
      grub> kernel (hd0,1)/debian/vmlinuz root=/dev/ram ramdisk_size=256000 devfs=mount,dall
      grub> initrd (hd0,1)/debian/initrd.gz
      grub> boot
     
    6.安装选项:语言(英语),根分区reiserfs,数据分区推荐xfs,os可以选这个:
                kernel-2.6.16-2.686(服务器推荐用486),
                安装组件一个也不要(就是Debian software selection不要选)
                网络不要配置
    grub装不上去:
    # dpkg -i grub_0.97-19_i386.deb
    # grub-install /dev/hda
    配置/boot/grub/menu.lst文件(没有则创建)
    ###################################################################
    default  1
    timeout  5
    color  cyan/blue white/blue
     
    title  Debian GNU/Linux, kernel 2.6.16-2-686 vga=788(800x600)
    root  (hd0,1)
    kernel  /boot/vmlinuz-2.6.16-2-686 root=/dev/hda2 ro vga=788
    initrd  /boot/initrd.img-2.6.16-2-686
    savedefault
    boot
     
    title  Debian GNU/Linux, kernel 2.6.18-2-686 vga=788(800x600)
    root  (hd0,1)
    kernel  /boot/vmlinuz-2.6.18-2-686 root=/dev/hda2 ro vga=788
    initrd  /boot/initrd.img-2.6.18-2-686
    savedefault
    boot
     
    title  Windows XP SP2
    root  (hd0,0)
    chainloader +1
    ###################################################################

     
    7.启动系统:可以修改/boot/grub/menu.lst中kernel 参数vga=791,这样字体合适一些
      ~/.bashrc中加入:
      alias ls='ls --color'
      alias ll='ls -l --color'
      alias lsa='ls --color -a'
      alias lla='ls -l --color -a'
      alias vi='vim'
      alias rm='rm -i'
      alias cp='cp --interactive'
      alias rxvt='urxvtc -pe tabbed'
      alias sdcv='sdcv --data-dir /usr/local/share/stardict/dic/'
      . /etc/bash_completion
    去掉root密码:/etc/paasswd中的第一行root后面的x去掉
    /etc/profile中加入: setleds +num ---> 开机就打开小键盘
            再加入:export PKG_CONFIG=`which pkg-config`
     
    8.需要掌握的命令:cat, tail od, chmod, chown, wc, diff, grep/egrep, find,
      locate, shutdown, free, password, su, echo, date, fdisk, pstree, hwclock, vim
     
    9.dpkg学习:
    (1)dpkg是一个较底层的安装工具,处理.deb文件,软件包依赖性需要更高层的前端工具是apt;
       dpkg本身是不能解决依赖的。
       dpkg是dpkg-deb的前端,如果dpkg搞不定,可以用dpkg-deb。
    (2)所有的packages信息在/var/lib/dpkg目录下:
       available是安装源的描述,包括已安装和没有安装的
       info目录描述已安装的包:.list后缀是文件列表,.prerm描述关联的服务,
                               .config是配置,.preinst安装前配置,.postinst安装后配置
    (3)dpkg命令:
       dpkg -l              查看已经安装的所有包
       dpkg -s vim-tiny     查看某个包的详细信息
       dpkg -L vim-tiny     查看某个包安装的所有文件
       dpkg -S /bin/ls      查看这个文件属于哪个包
       dpkg -I vim7.0.deb   查看这个deb包的描述信息
       dpkg -c vim7.0.deb   查看这个deb包的所有安装文件
       dpkg -i /mnt/cdrom/poll/main/z/zhcon/zhcon_0.2.6-2_i386.deb
       如果这个包存在依赖而安装不能通过,则它会在/var/lib/dpkg/info中记录,
       再使用:apt-get -f install解决掉依赖就可以成功dpkg -i zhcon.deb了
     
       dpkg -r prozilla      删除包,不删除配置文件
       dpkg -P prozilla      删除包,也删除配置文件
     
       有些包安装时就需要配置,如果想重新配置,可以用:
       dpkg-reconfigure locales
     
    10.apt学习:
    (1)自动获取软件包,自动解决倚赖,自动配置,自动编译,常用命令:
       apt-get
       apt-cache
    (2)添加下面行到/ept/apt/sources.list
      (mount /dev/cdrom /media/cdrom
       deb file:/media/cdrom etch main
       它会在/mnt/iso的dists下寻找Packages.gz,并在pool下寻找包文件
    (3)apt-cache stats               显示数据源中包的统计信息
       apt-cache search  vim         按关键字查找软件包
       apt-cache show vim-common     这个包的详细信息
       apt-cache depends vim-common   依赖,冲突,替换的包
       apt-cache rdepends vim-common  反向依赖
    (4)apt-get update                 从数据源更新软件包的列表,运行产生软件包数据库
       apt-get upgrade                更新所有软件包(慎用,不要用!)
    (5)apt-get install lynx           安装软件包
       apt-get -y install lynx        安装时不提问是否确认
       apt-get --reinstall install lynx               重装
       apt-get remove lynx && dpkg -l |grep lynx      删除,不删除配置文件
       apt-get --purge remove lynx                    删除,并删除配置文件
    (6)apt-get install安装的软件包会下载到/var/cache/apt/archives中,
       删除请用:apt-get clean
       不要用:rm -fr /var/cache/apt/archives/*
    (7)apt-cache showsrc lynx         搜索源程序
       apt-get source lynx            下载源程序到当前目录
       apt-get build-dep lynx         编译依赖软件包
    (8)必杀技:apt-get -f install     纠正安装依赖
     
     
    11.debian中文配置:
    (1)unicode编码:
                  utf: UTF-16, UTF-8, UTF-7
                  ucs:
       常见的汉语字符集编码方式:GB13000, GBK, GB18030, GB2312
    (2)locale机制
       常见的locale变量:LC_CTYPE, LANG, LC_ALL, LC_MESSAGES
       优先级:LC_ALL > LC_* > LANG
    (3)编码辨识和转换工作由系统底层函数库完成,即glibc完成
    (4)/usr/share/locale目录保存locale信息
       /usr/share/consolefonts目录存放console的字体信息
       /uxr/lib/gconv字符转换模块信息
       /usr/X11R6/lib/X11/locale
       /usr/X11R6/lib/X11/fonts
    (5)生产locale数据库资料
       apt-get install locales
       dpkg-reconfigure locales
       apt-get install file
       apt-get install zhcon
       apt-get install fontconfig
       apt-get install bzip2
       需要的配置:en_US.UTF-8 UTF-8
                   en_US ISO-8859-1
                   zh_CN GB2312
                   zh_CN.GB18030 GB18030
                   zh_CN.GBK GBK
                   zh_CN.UTF-8 UTF-8
       默认用en_US.UTF-8 UTF-8
     
    12.网络配置:
    (1)命令:route, netstat -r
    (2)dhcp配置:
    echo "auto eth0" >> /etc/network/interfaces
    echo "iface eth0 inet dhcp" >> /etc/network/interfaces
    /etc/init.d/networking restart
    (3)静态ip地址配置
    echo "auto eth0" >> /etc/network/interfaces
    echo "iface eth0 inet static" >> /etc/network/interfaces
    echo " address 192.168.0.2" >> /etc/network/interfaces
    echo " netmask 255.255.255.0" >> /etc/network/interfaces
    echo " gateway 192.168.0.1" >> /etc/network/interfaces
    ifconfig eth0 down
    ifconfig eth0 up
    (4)配置主机名:/etc/hostname
    (5)DNS配置:/etc/resolv.conf
     
    13.重要的配置工具:
    apt-get install fbset
    apt-get install rcconf
    apt-get install modconf

    apt-get install fdflush  # 用法: fdflush /dev/sda1
    apt-get install manpages-dev # man 帮助页安装
    模块相关的知识:
    modprobe -c  显示当前被使用的模块配制
    modprobe -l  显示能匹配的模块列表
    modeprobe modname 加载模块
    modeprobe -r modname 卸载模块
    modinfo modname  显示模块欣喜
    insmod
    rmmod
    reset   /* cat filename后屏幕一片混乱的恢复方法 */
    dos2unix/unix2dos
    convert   /* 图片转换程序 */
    iconv -f utf8 -t gb2312 file1 > file2
    hdparm -tT /dev/hda
    updatedb更新数据库,locate filename查找,这个可以加到crontab中定时执行
    包管理工具:
    (1)console工具:tasksel, dselect, aptitude
    (2)gui工具:synaptic
     
     
    14.安装桌面基本系统(从/mnt/iso光盘中)
    apt-get install x-window-system-core        需要45M空间
    apt-get --purge remove vim-common
    apt-get --purge remove vim-tinny
    apt-get install vim-full
    fvwm安装:
    apt-get install fvwm
    也可以用下面的命令安装:
    dpkg -i librplay3_3.3.2-11_i386.deb
    dpkg -i libstroke0_0.5.1-5_i386.deb
    dpkg -i fvwm_2.5.18-1_i386.deb
    apt-get -f install
     
     
    15.配置中文环境和fcitx
    因为我们可以设置LC_ALL为zh_CN.GB2312,所以对应的startx启动后显示中文的fvwm,
    是不是很爽啊,但是先不要这么设置!
    fvwm设置:
    如果你用 startx 进 X 可以修改 ~/.xinitrc 为(没有就创建一个)
    export G_FILENAME_ENCODING=@GBK
    export LANG=zh_CN.GB2312
    export LC_ALL=zh_CN.GB2312
    export XMODIFIERS=@im=fcitx
    export XIM=fcitx
    export XIM_PROGRAM=fcitx

    fcitx
    exec fvwm-session
    推荐另一种做法:新建文件 /etc/X11/Xsession.d/25xchinput写入
    # 编码方式
    export G_FILENAME_ENCODING=@GBK
    export LANG=zh_CN.GBK
    export LC_ALL=zh_CN.GB2312
     
    # 输入法
    export XIM=fcitx
    export XIM_PROGRAM=fcitx
    export GTK_IM_MODULE=fcitx
    export XMODIFIERS="@im=fcitx"
    fcitx
    # 配置$[HOME]/.fcitx/config文件,候选词9个,去掉其他输入法只保留拼音
    fcitx隐藏主窗口: 主窗口隐藏模式=0设置为1即可
     
     
    16.fvwm需要的包及终端安装
    # 说明:fvwm编译前要装上libxpm-devel,libpng-devel 
    # apt-get install imagemagick      fvwm不能load图形(xpm,png)安装这个
    # 支持的命令:
    # $ convert filename.jpg filename.xpm
     
    装一个支持中文支持透明的终端:
    apt-get install mlterm
    终端配置,使用rxvt-unicode
    apt-get install rxvt-unicode
    在/etc/X11/Xsession.d/25xchinput中加入 urxvtd&
    配置文件:/etc/X11/Xresources/Xresources
    不重启更新配置文件的方法:xrdb Xresources
    xev获取按键
     
     
    17.内核编译环境
    (choose 1)apt-get install build-essential
    上面命令安装内核头文件,make工具,一些libc的库, dpkg-dev,gcc,
    已经包含了apt-get install gcc
    也可以用命令替代上面的安装:
    (choose 2)apt-get install libc6-dev
    编译内核:
    在console中编译官方内核,需要以下软件包
    bin86 - 16-bit assembler and loader
    diff - File comparison utilities
    libc6-dev - GNU C Library: Development Libraries and Header Files
    libncurses5-dev - Developer's libraries and docs for ncurses
    patch - Apply a diff file to an original
    apt-get install bin86
    apt-get install libncurses5-dev
    apt-get install kernel-package
    apt-cache search mkinitrd  这个包已经有了,里面包含mkinitramfs工具。
    说明:initramfs-tools和initrd-tools,前者是2.6.15以上内核推荐使用的
    内核编译指令:
    make mrproper
    make menuconfig(reiserfs 和 xfs静态编译到内核中)
    make
    make modules_install 编译安装模块文件到/lib/modules/对应的版本文件夹下
    cp arch/i386/boot/bzImage /boot/lfskernel-2.6.11.12
    cp System.map /boot/System.map-2.6.11.12
    cp .config /boot/config-2.6.11.12
    mkinitramfs -o /boot/initrd-2.6.17.8.img /lib/modules/2.6.17.8
    添加到grub中,即/boot/grub/menu.lst文件,重新启动系统
     
     
    18.smb工具安装(共享windows机器上的文件)
    安装smbfs工具
    dpkg -i samba-common_3.0.22-1_i386.deb
    dpkg -i smbfs_3.0.22-1_i386.deb
    使用范例:
    mount -t smbfs -o codepage=cp936,username=用户名,password=密码
          //ip/文件夹名 挂载点
    或者:
    mount -t smbfs -o codepage=cp936,username=用户名,password=密码
          //ip/文件夹名 挂载点
     
     
    19.字体美化,有两种X 字体处理系统(两种字体可并存)
    1) xfs(x font server) + xtt
    特点:非平滑字体,由X 服务器处理
    名称:-wqy-fixed-medium-r-normal--10-100-75-......-iso8820-1类试的表达式
    安装配置:
         X 字体服务器路径:
         /etc/X11/xorg.conf 中的 Files节的FontPath
         字体模块(解析库)的路径:
         /etc/X11/xorg.conf 中的 Module节的Load
         例如:freetype ,它支持ttf 和ttc
         说明:不要使用xtt 模块!
    生成字体索引文件:
         truetype字体: 使用ttmkfdir命令,例如文泉驿字体 以及大多数windows字体
         其他字体:使用mkfontdir 和 mkfontscale
         说明:fonts.dir是索引文件,fonts.scale是可缩放字体索引
         说明:这3个工具需要安装 apt-get install ttmkfdir
    工具:在X 环境下运行 xlsfonts 查看系统已安装的核心字体
         xfontsel选择字体
    2)xft + fontconfig + freetype
    特点:xft是负责显示的库
         fontconfig是配置工具
    工具:fc-list 列出安装的所有字体
         fc-cache -fv 手动更新系统字体配置
         fc-match -v Tahoma 查找某个字体的信息
    配置:
         添加字体文件到/etc/fonts/fonts.conf中或新建一个路径,
         添加完后不要忘了fc-cache -fv
    3)为应用程序配置字体
    1.gtk1 程序, 如xmms, gimp, 只能使用X 核心字体
    配置文件:/etc/gtk/gtkrc.zh_CN
    2.gtk2 和 qt程序, 可以使用xft 加 fontconfig
    gtk2配置文件: /etc/gtk-2.0/gtkrc
    qt配置:运行qtconfig 程序即可
    4)其他技巧
    5)查看dpi等信息: xdpyinfo | grep resolution
                     xdpyinfo | grep dimensions
      调整dpi: vi /etc/X11/xorg.conf 加入
     Section "Monitor"
      ......
      DisplaySize   287     215     # 1024x768  90dpi
      ......
     EndSection
      重启X 才能生效
    6)使用windows_xp的字体
      指令:
      mkdir /usr/share/fonts/truetype/winxp
      找台 Winxp,拷贝 C:windowsFonts 下的 tahoma.ttf tahomab.ttf simsun.ttf mingliu.ttf
      到该目录下。
      同时在 /etc/X11/xorg.conf 中加入该路径,好让 legacy X font server(xfs)
      找到是上述四个新添加字体。如下:
            FontPath        "/usr/share/fonts/truetype/winxp"
      ttmkfdir 创建fonts.scale 文件, fonts.dir是fonts.scale的拷贝
      重启 X, 使之生效。
      或者:放到/etc/fonts/fonts.conf指定的目录中然后fc-cache -fv
    7)X 支持truetype字体引擎:xtt, freetype, xfs, xft。
    前两个是X 的内部模块,xfs和xft是外部服务例程,只有xft支持AA,支持中文最好的是xtt
    8)fontconfig及xft
    西方字体:serif 和sans serif,sarif在字的笔画边缘处有额外的装饰,
    sans serif就没有。
    ***Times, Times New Roman等都属于serif字体,
    通常文章正文采用这个.
    ***Arial, Tahoma, verdana, helvetica等都属于sans serif字体,
    通常标题等醒目字体采用这个.
    中文字体中,宋体和细明体就是serif; 黑体和圆体就是sans serif字体。
    monospace 也是sans serif系列,但是是等距字体.
    修改fonts.conf文件:
    <alias><family>serif</family>
    <prefer>中:DejaVu和Bitstream Vera英文显示效果较好放在所有英文字体前面,
    AR PL New Sung(就是firefly字体)以及Simsun中文效果最好,放在所有cjk
    字体前面,技巧是搜索Luxi字体,放在它的前面。
    需要安装的字体: windows中拷贝 simsun.ttf, simhei.ttf, tahoma.ttf, tahomabd.ttf
    拷贝到/usr/local/share/fonts/,然后执行fc-cache -fv
    拷贝预先编辑好的font.conf到/etc/fonts/目录
     
     
    20.常用工具安装
    apt-get install links2  支持彩色的控制台浏览器
    apt-get install firefox
    apt-get install firefox-locale-zh-cn
    apt-get install less  /* 让man支持vi风格 */
    apt-get install rox-filer
    apt-get install wireshark /* ethereal */
    apt-get install gtksee
    apt-get install amule
    apt-get install xpaint
    apt-get install gimp
    apt-get install beep-media-player
    apt-get install mp3blaster
    apt-get install gaim
    apt-get install liferea  /* RSS reader */
    apt-get install zlib1g-dev /* zlib library */
    apt-get install libglib2.0-dev /* glib2.0 */
    apt-get install libxml-perl /* stardict need it */
    apt-get install libgnomeui-dev /* stardict need it */
    apt-get install scrollkeeper /* before stardict make */
    apt-get install gthumb  /* picture browse */
    apt-get install kopete  /* for chat (graphics) */
    apt-get install irssi  /* for chat (console) */
    apt-get install gftp
    apt-get install mpg321  /* console mp3 player */
    apt-get install dia  /* 流程图软件 */
    apt-get install scrot  /* 截图软件 */
    apt-get install xxdiff  /* 比较目录,比较文件可以用vimdiff */
    apt-get install pciutils /* lspci */
    apt-get install hdparm
    apt-get install mkisofs
    apt-get install jfbterm  /* 支持framebuffer的终端 */
    apt-get install synaptic /* 新立德软件包管理器 */
    apt-get install unzip

    21.安装stardict

    tar jxf sdcv-0.4.2.tar.bz2 && cd sdcv-0.4.2 && ./configure && make && make install
    tar jxf stardict-2.4.8.tar.bz2 && cd stardict-2.4.8 && ./configure && make && make install
    mkdir /usr/local/share/stardict/dic
    tar jxf infoBrowse-zh_CN-2.4.2.tar.bz2 --directory /usr/local/share/stardict/dic/
    tar jxf stardict-gaojihanyudacidian-2.4.2.tar.bz2 --directory /usr/local/share/stardict/dic/
    tar jxf stardict-hanyuchengyucidian-2.4.2.tar.bz2 --directory /usr/local/share/stardict/dic/
    tar jxf stardict-langdao-ce-gb-2.4.2.tar.bz2 --directory /usr/local/share/stardict/dic/
    tar jxf stardict-langdao-ec-gb-2.4.2.tar.bz2 --directory /usr/local/share/stardict/dic/
    tar jxf stardict-ncce-ce-2.4.2.tar.bz2 --directory /usr/local/share/stardict/dic/
    tar jxf stardict-ncce-ec-2.4.2.tar.bz2 --directory /usr/local/share/stardict/dic/
    tar jxf stardict-oxford-gb-2.4.2.tar.bz2 --directory /usr/local/share/stardict/dic/
    tar jxf stardict-oxfordjm-ec-2.4.2.tar.bz2 --directory /usr/local/share/stardict/dic/
    tar jxf stardict-treedict-infoBrowse-zh_CN-2.4.2 --directory /usr/local/share/stardict/dic/
    tar jxf stardict-xdict-ce-gb-2.4.2.tar.bz2 --directory /usr/local/share/stardict/dic/
    tar jxf stardict-xdict-ec-gb-2.4.2.tar.bz2 --directory /usr/local/share/stardict/dic/

    22.软件安装:firefox, openoffice, adobe reader, stardict, java, lumaqq,
    ati driver, alsa sound, gaim, mp3blaster, prozilla, wine,
    fcitx, vim and plugin, bochs, cscope, linux kernel src, gtk, winrar,

    subversion,prozilla, vim and plugin, bochs, qume, mplayer
    其他:
    conky, gdesklets, xchat, azureus, dockapps


    23.Conky是Linux下一个很好用的系统信息监视工具。在安装之后默认状态下并不会闪烁,但是经过配置之后就往往会出现闪烁的问题。解决办法如下:

    sudo apt-get install wmctrl
    sudo vim /etc/X11/xorg.conf

    在Module段加入一行:

        Load    “dbe”

    保存后退出。

    设置conky的配置文件:

        vim ~/.conkyrc

    设置以下几项:

    own_window yes
    own_window_type override
    double_buffer yes

    保存后退出。

  • 相关阅读:
    数据类型及转换
    进制转换
    精通libGDX-RPG开发实战
    github上最好的开源MMORPG
    同步mysql数据到ElasticSearch的最佳实践
    在libGDX中使用Spine骨骼动画
    window下Kafka最佳实践
    linux 系统的负载与CPU、内存、硬盘、用户数监控脚本[marked]
    源码安装cmake(或者叫升级cmake)
    Rust-HayStack
  • 原文地址:https://www.cnblogs.com/pengdonglin137/p/3311237.html
Copyright © 2020-2023  润新知