如何应用Debian安全补丁

时间:2020-01-09 14:16:47  来源:igfitidea点击:

如何使用命令行选项对我的Debian Linux服务器应用安全补丁?
如果您是Debian的新手,并且对如何访问Debian安全更新感到困惑。
本教程告诉您如何使服务器或由Debian Linux 9.x或8.x驱动的云计算机保持最新,并具有最新的安全更新。
解决方法:您需要使用apt-get命令或apt命令将补丁程序应用于Debian Linux服务器或基于桌面的系统。

语法

语法为:

$ sudo apt update
$ sudo apt upgrade

或者使用apt-get命令获取Repo更新:

$ sudo apt-get update

输出示例:

Get:2 http://security.debian.org stretch/updates InRelease [62.9 kB]
Ign:1 http://cdn-fastly.deb.debian.org/debian stretch InRelease
Get:3 http://cdn-fastly.deb.debian.org/debian stretch Release [118 kB]
Get:4 http://cdn-fastly.deb.debian.org/debian stretch Release.gpg [2,373 B]
     
Fetched 45.3 MB in 49s (906 kB/s)                                                                                                                                                                                                     
Reading package lists... Done

现在安装补丁:

$ sudo apt-get upgrade

输出示例:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
65 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 91.4 MB of archives.
After this operation, 57.3 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:2 http://security.debian.org stretch/updates/main amd64 apache2 amd64 2.4.25-3+deb9u2 [235 kB]
Get:1 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 base-files amd64 9.9+deb9u1 [67.2 kB]
Get:3 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 libperl5.24 amd64 5.24.1-3+deb9u1 [3,524 kB]
.....
...
....
Get:37 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 os-prober amd64 1.76~deb9u1 [30.0 kB] etched 91.4 MB in 1min 9s (1,311 kB/s)                                                                                                                                                                                               
Reading changelogs... Done
Extracting templates from packages: 100%
Preconfiguring packages ...
(Reading database ... 115129 files and directories currently installed.)
Preparing to unpack .../base-files_9.9+deb9u1_amd64.deb ...
Unpacking base-files (9.9+deb9u1) over (9.9) ...
Setting up base-files (9.9+deb9u1) ...
Installing new version of config file /etc/debian_version ...
.....
...
....
Setting up libirs141:amd64 (1:9.10.3.dfsg.P4-12.3+deb9u2) ...
Setting up linux-image-amd64 (4.9+80+deb9u1) ...
Setting up gnuplot (5.0.5+dfsg1-6+deb9u1) ...
Setting up openssh-sftp-server (1:7.4p1-10+deb9u1) ...
Setting up libmagickcore-6.q16-3-extra:amd64 (8:6.9.7.4+dfsg-11+deb9u1) ...
Setting up imagemagick (8:6.9.7.4+dfsg-11+deb9u1) ...
Processing triggers for initramfs-tools (0.130) ...
update-initramfs: Generating /boot/initrd.img-4.9.0-3-amd64
cryptsetup: WARNING: failed to detect canonical device of /dev/md0
cryptsetup: WARNING: could not determine root device from /etc/fstab
W: initramfs-tools configuration sets RESUME=UUID=054b217a-306b-4c18-b0bf-0ed85af6c6e1
W: but no matching swap device is available.
I: The initramfs will attempt to resume from /dev/md1p1
I: (UUID=bf72f3d4-3be4-4f68-8aae-4edfe5431670)
I: Set the RESUME variable to override this.
Processing triggers for libc-bin (2.24-11+deb9u1) ..

请注意,在安装补丁程序时,可能会提示您安装或保留现有的配置文件:单击以放大

我建议您重新启动Linux机器,以验证更新是否成功或加载新的Linux内核:

$ sudo reboot

或者

$ sudo shutdown -r now