zoukankan      html  css  js  c++  java
  • 一键脚本清理DEBIAN系统无用组件 减少系统资源

    虽然如今我们选择服务器资源都比较多,以前我们看到很多128MB内存、甚至32MB内存的建站网站,感觉特别羡慕。其实这些也不是难事,相比之下,DEBIAN系统比CENTOS系统占用资源少,然后我们需要进行内存优化处理,删除不必要的组件,这样又可以节省一些资源。这里我找到几个减少资源的方式,如果我们需要节省不必要的组件的时候可以用到。

    第一、一键删除无用组件

    apt-get update -y && apt-get upgrade -y
    apt-get -y purge apache2-* bind9-* xinetd samba-* nscd-* portmap sendmail-* sasl2-bin
    apt-get -y purge lynx memtester unixodbc python-* odbcinst-* sudo tcpdump ttf-*
    apt-get autoremove && apt-get clean

    第二、清理opera firefox的缓存文件

    ls ~/.opera/cache4
    ls ~/.mozilla/firefox/*.default/Cache
     
    第三、清理Linux下孤立的包:
    图形界面下我们可以用:gtkorphan
    sudo apt-get install gtkorphan -y
    终端命令下我们可以用:deborphan
    sudo apt-get install deborphan -y
     
    第四、卸载:tracker
    这个东西一般我只要安装Ubuntu就会第一删掉tracker 他不仅会产生大量的cache文件而且还会影响开机速度。所以在新得利里面删掉就行。  www.2cto.com  
     
    第五、删除多余的内核:一定不要删错哦,切记!!
    打开终端敲命令:dpkg --get-selections|grep linux
    有image的就是内核文件
    删除老的内核文件:
    sudo apt-get remove 内核文件名(例如:linux-image-2.6.27-2-generic)
    内核删除,释放空间了,应该能释放130-140M空间。
     
    这样,我们再去安装需要的系统软件,可以减少资源占用。
     
    以上文章参考:
  • 相关阅读:
    67. Add Binary
    66. Plus One
    64. Minimum Path Sum
    63. Unique Paths II
    How to skip all the wizard pages and go directly to the installation process?
    Inno Setup打包之先卸载再安装
    How to change the header background color of a QTableView
    Openstack object list 一次最多有一万个 object
    Openstack 的 Log 在 /var/log/syslog 里 【Ubuntu】
    Git 分支
  • 原文地址:https://www.cnblogs.com/miercler/p/6271356.html
Copyright © 2011-2022 走看看