Debian 扩容 SWAP + 内核升级

Linux
34 0

扩容 SWAP

# 查看
free -h

# 关闭
swapoff -a

# 建立
dd if=/dev/zero of=/swap bs=1M count=1024

# 授权
chmod 0600 /swap

# 格式化
mkswap /swap

# 开启
swapon /swap

# 自启
echo "/swap swap swap defaults 0 0" >> /etc/fstab

升级内核

# 查看当前最新内核
# https://www.kernel.org

uname -r

apt update && apt full-upgrade -y
apt install lsb-release

cat > /etc/apt/sources.list << EOF
deb http://cdn-aws.deb.debian.org/debian $(lsb_release -sc) main contrib non-free
deb http://cdn-aws.deb.debian.org/debian-security $(lsb_release -sc)/updates main contrib non-free
deb http://cdn-aws.deb.debian.org/debian $(lsb_release -sc)-updates main contrib non-free
deb http://cdn-aws.deb.debian.org/debian $(lsb_release -sc)-backports main contrib non-free
deb http://cdn-aws.deb.debian.org/debian $(lsb_release -sc)-proposed-updates main contrib non-free
# deb http://cdn-aws.deb.debian.org/debian $(lsb_release -sc)-backports-sloppy main contrib non-free
EOF

apt update
apt search linux-image

apt install -t $(lsb_release -sc)-backports linux-image-$(dpkg --print-architecture) linux-headers-$(dpkg --print-architecture) --install-recommends -y

update-grub
reboot

uname -r
dpkg -l | grep linux
apt purge linux-image-4.9.0-3-amd64
更新 2018-08-12
评论 ( 0 )
私信
pic
code
pre