linux系统加速

优化你的 Linux,让它变得更快更好用。


描述

在笔记本上安装linux,使用了一段时间后,你应该会感觉到系统开始变慢。

在这篇文章中列出了一些小技巧,能帮你提高一点Ubuntu的速度。还有一些很好的技巧,可以用来提高系统性能,让系统运行更流畅。

你可以选择尝试所有技巧或者其中的一部分,他们每一个都可以让你的Ubuntu更流畅,更敏捷,更迅速。

查看开机启动耗时

systemd-analyze time

清理APT缓存

sudo apt-get autoclean

修改grub2等待时间

grub2启动时,会在默认的启动项上停留数秒(默认10秒),等待用户选择。

我们可以把这个时间改的更短。如果是LinuxMint/Ubuntu单系统,可以直接改为0,即直接进入,无需等待。

以管理员身份编辑grub配置文件,修改GRUB_TIMEOUT项后的数字。

sudo gedit /etc/default/grub

GRUB_TIMEOUT 10改为GRUB_TIMEOUT 0

sudo update-grub2 或者grub-mkconfig -o /boot/grub/grub.cfg

减少程序启动时间及内存消耗

sudo apt-get install prelink 或者在软件管理器中安装

  • 启动:sudo prelink -avmR

  • 取消: sudo prelink -au

安装电源管理软件tlp

sudo add-apt-repository ppa:linrunner/tlp
sudo apt-get update
sudo apt-get install tlp tlp-rdw
sudo apt-get install tp-smapi-dkms acpi-call-dkms smartmontools
sudo tlp start   启动tlp
sudo tlp-stat     查看状态
sudo tlp-stat -s    查看状态

使用Preload预加载

sudo apt-get install preload

修改启动界面

sudo update-alternatives --config default.plymouth

编辑plymouth

sudo vim /usr/share/plymouth/themes/default.plymouth

修改如下内容:

[Plymouth Theme]
Name=Mint Logo
Description=A theme that features a blank background with a logo.
ModuleName=script

[script]
ImageDir=/usr/share/plymouth/themes/mint-logo
ScriptFile=/usr/share/plymouth/themes/mint-logo/mint-logo.script
  • plymouth错误
Linux Mint: “Warning: No support for locale: en_US.UTF-8” in update-initramfs

September 5, 2014 by hs 3 Comments

After installing Linux Mint 17 in a VM I started the Update Manager to get the latest updates, including kernel. In the details window I saw this error:

update-initramfs: Generating /boot/initrd.img-3.13.0-24-generic
Warning: No support for locale: en_US.UTF-8

Thanks to Tip: fix for update-initramfs “No support for local …” I found the cause and the solution.

Cause (quoting from the source post): “The problem is that /usr/share/initramfs-tools/hooks/root_locale is expecting to see individual locale directories in /usr/lib/locale, but locale-gen is configured to generate an archive file by default.”

Solution: Run locale-gen again (but use directories not archive file) and then update-initramfs.
  • 解决办法:

sudo locale-gen --purge --no-archive

sudo update-initramfs -u -t

主题美化

安装Adapta主题

有三种方法,建议第一种:

  • 直接在linux mint“主题”设置里找到“Adapta-Nokto”点击下载即可

  • 下载Adapta-Nokto的安装包,复制到~/.themes/

wget -c https://cinnamon-spices.linuxmint.com/files/themes/Adapta-Nokto.zip

unzip -o Adapta-Nokto.zip

cp -r Adapta-Nokto ~/.themes/

  • 从github上下载安装脚本

https://github.com/adapta-project/adapta-gtk-theme

安装papirus图标

sudo add-apt-repository ppa:papirus/papirus

sudo apt update && sudo apt install papirus-icon-theme

效果展示: 主题美化主题美化主题美化主题美化主题美化

卸载libreoffice

sudo apt-get purge libreoffice?

查找尝试破解主机密码的IP

grep “Failed password for invalid user” /var/log/secure | awk ‘{print $13}’ | sort | uniq -c | sort -nr | more

上次更新:
贡献者: iEchoxu