Linux系统管理点滴

【Linux根据进程名删除所有进程】

ControllerServer:进程名
kill -9 `ps -ef|grep ControllerServer|awk '{print $2}'`
         

【Ubuntu下启用root用户】 

设置root密码:sudo passwd root     
Ubuntu7.04启用root用户:vim /etc/X11/gdm/gdm.conf 中设置AllowRoot=true(启用为true,否则为false)     
Ubuntu8.04启用root用户:vim /etc/gdm/gdm.conf 中设置AllowRoot=true(启用为true,否则为false)


    【取消MAC与ethX绑定】

    Ubuntu 7.04 下取消MAC与ethX绑定     vim /etc/iftab  把mac与ethX对应注释即可 
    Ubuntu 8.04 下取消MAC与ethX绑定     rm /etc/udev/rules.d/*-persistent-net.rules


      【ubuntu下"unable to resolve host xxx"的解决】

      
      
      查看/etc/hostname的内容,如:myhost
      
      修改/etc/hosts的内容,修改为:(192.168.200.31为IP,)
      127.0.0.1       localhost
      
      192.168.200.31  myhost


         

        【ubuntu下"unable to resolve host xxx"的解决】

        编辑/etc/udev/rules.d/70-persistent-net.rules这个文件,修改MAC地址对应name"ethx"
        


           

          【UTC时间修改为本地时间】

          vim /etc/default/rcS  中设置UTC=no(UCT时间为yes,本地时间为no)
                     

            【Ubuntu 8.04 中把root用户语言设置为中文】

            修改root用户目录下修改.profile:    
            LANG="zh_CN.UTF-8"     
            LANGUAGE="zh_CN:zh"
                  

              【Ubuntu 下添加ISO软件源】

              mount -t iso9660 -o loop /media/Soft/Downloads/ubuntu-8.04-dvd-i386.iso  /media/cdrom 
              apt-cdrom -m -d /cdrom add
                         

                【ubuntu下删除旧内核】

                列出所有安装的内核,从中选择要卸载的包,带有image的就是内核文件:     
                dpkg ——get-selections|grep linux
                用apt-get来卸载旧内核:     
                apt-get remove linux-image-2.6.15-23-386
                     

                  【openoffice的安装和删除】
                      http://wiki.services.openoffice.org/wiki/ZH/Documentation/Administration_Guide/Linux

                      基于 RPM 的 Linux 分发

                  Image:documentation_note.png 以下说明假定您已下载并解压缩了 OpenOffice.org 安装文件。

                  安装

                  1. 成为 root 用户(如果需要)
                    su -
                  2. 转到以下目录:
                    <OpenOffice.org_unzip-dir>/RPMS
                  3. RPMS 目录包含 Gnome 和 KDE 集成的 RPM 软件包。
                    • 对于使用 KDE 的用户,您可以删除 Gnome 集成 RPM:
                    rm openoffice.org-gnome-integration-<version>.rpm
                    • 对于使用 Gnome 的用户,您可以删除 KDE 集成 RPM:
                    rm openoffice.org-kde-integration-<version>.rpm
                  4. 安装到标准 /opt 目录中
                    rpm -ivh *.rpm
                    Image:documentation_note.png 如果要在其他位置中安装 OpenOffice.org,请使用 -prefix 选项。
                    rpm -ivh –prefix <install-dir> *.rpm
                  5. 在菜单中安装 OpenOffice.org:
                    cd desktop-integration

                    查找并安装特定 Linux 分发的 RPM:

                    rpm -ivh openoffice.org-<distribution>-menus_<version>.deb

                  在安装完成后,您可以安全地删除 OpenOffice.org 安装软件包。

                  卸载

                  不要从文件系统中删除 OpenOffice.org 文件。您必须使用 OpenOffice.org Java 安装程序或 RPM 软件包管理器来卸载 OpenOffice.org。

                  1. 成为 root 用户(如果需要)
                    su -
                  2. 创建 'ooo_packages' 文件,其中包含与 OpenOffice.org 相关的所有 RPM 软件包
                    rpm -qa | grep openoffice > ooo_packages
                  3. 仔细检查该文件的内容。将删除列出的所有软件包。如果使用包含 JRE 的 OpenOffice.org 安装集,则所列内容中不包含已安装的 JRE 软件包。
                  4. 使用以下命令删除与 OpenOffice.org 相关的所有软件包:
                    rpm -e 'cat ooo_packages'

                  基于 DEB 的 Linux 分发

                  APT 或 DPKG 软件包管理器用于安装、更新和删除 DEB 软件包,它是作为基于 DEB 的 Linux 分发(如 Debian 和 Ubuntu)的一部分提供的。

                  Image:documentation_note.png If you have the RPMS package and do not want to download the DEBS package, you can convert the RPMs to DEBs using the following command:
                     sudo alien -d --scripts *.rpm 

                  安装

                  1. 成为 root 用户(如果需要)
                    su -
                  2. 转到以下目录:
                    <OpenOffice.org_unzip-dir>/DEBS
                  3. DEBS 目录包含 Gnome 和 KDE 集成的 DEB 软件包。
                    • 对于使用 KDE 的用户,您可以删除 Gnome 集成 DEB:
                    rm openoffice.org-gnome-integration-<version>.deb
                    • 对于使用 Gnome 的用户,您可以删除 KDE 集成 DEB:
                    rm openoffice.org-kde-integration-<version>.deb
                  4. 安装到标准 /opt 目录中
                    dpkg -i *.deb
                    Image:documentation_note.png 如果要在其他位置中安装 OpenOffice.org,请使用 --instdir=<directory> 选项。
                    dpkg -i --installdir=<install-dir> *.deb
                  5. 在菜单中安装 OpenOffice.org:
                    cd desktop-integration
                    dpkg -i openoffice.org-debian-menus_<version>.deb

                  在安装完成后,您可以安全地删除 OpenOffice.org 安装软件包。

                  卸载

                  不要从文件系统中删除 OpenOffice.org 文件。您必须使用 OpenOffice.org Java 安装程序或 DEB 软件包管理器来卸载 OpenOffice.org。

                  1. 成为 root 用户(如果需要)
                    su -
                  2. 使用以下命令删除与 OpenOffice.org 相关的所有软件包:
                    apt-get remove openoffice.org*

                  posted @ 2009-06-01 10:46  JenshyHong  阅读(265)  评论(0)    收藏  举报