我有一个vps在linux-generic-lts-raring
系列中运行ubuntu 12.04,内核为3.8.0-34。
在这个内核系列中,有一个最新版本3.8.0-35。
由于我已经安装了linux-generic-lts-saucy
3.11.0-15内核,我决定删除旧的raring内核:
$ sudo apt-get -s purge linux-headers-3.8.0-34 linux-headers-3.8.0-34-generic linux-image-3.8.0-34-generic
和输出:
Reading package lists...
Building dependency tree...
Reading state information...
The following extra packages will be installed:
linux-headers-3.8.0-35 linux-headers-3.8.0-35-generic
linux-headers-generic-lts-raring linux-image-3.8.0-35-generic
linux-image-generic-lts-raring
Suggested packages:
fdutils linux-lts-raring-doc-3.8.0 linux-lts-raring-source-3.8.0
linux-lts-raring-tools
The following packages will be REMOVED:
linux-headers-3.8.0-34* linux-headers-3.8.0-34-generic*
linux-image-3.8.0-34-generic*
The following NEW packages will be installed:
linux-headers-3.8.0-35 linux-headers-3.8.0-35-generic
linux-image-3.8.0-35-generic
The following packages will be upgraded:
linux-headers-generic-lts-raring linux-image-generic-lts-raring
2 upgraded, 3 newly installed, 3 to remove and 21 not upgraded.
问题是将安装内核3.8.0-35 ......并且linux-headers-generic-lts-raring
和linux-image-generic-lts-raring
将被升级。
我想要的是彻底删除:
linux-generic-lts-raring
linux-headers-generic-lts-raring
linux-headers-3.8.0-34
linux-headers-3.8.0-34-generic
linux-image-generic-lts-raring
linux-image-3.8.0-34-generic
linux
linux-server
linux-image
linux-headers-server
...我还不知道。我尝试传递--no-install-recommends
或--no-upgrade
等选项来清除命令但没有人工作。
任何人都可以提供可以在厨师食谱中重复使用的命令或选项吗?
提前致谢。
答案 0 :(得分:0)
哈!我设法删除所有这些包而不安装额外的内核3.8.0-35,添加“*”:
$ sudo apt-get -s purge linux-headers-3.8.0-* linux-image-3.8.0-*
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'linux-headers-3.8.0-33-generic' for regex 'linux-headers-3.8.0-*'
Note, selecting 'linux-headers-3.8.0-21' for regex 'linux-headers-3.8.0-*'
Note, selecting 'linux-headers-3.8.0-22' for regex 'linux-headers-3.8.0-*'
Note, selecting 'linux-headers-3.8.0-23' for regex 'linux-headers-3.8.0-*'
Note, selecting 'linux-headers-3.8.0-19' for regex 'linux-headers-3.8.0-*'
Note, selecting 'linux-headers-3.8.0-30' for regex 'linux-headers-3.8.0-*'
Note, selecting 'linux-headers-3.8.0-25' for regex 'linux-headers-3.8.0-*'
Note, selecting 'linux-headers-3.8.0-31' for regex 'linux-headers-3.8.0-*'
Note, selecting 'linux-headers-3.8.0-26' for regex 'linux-headers-3.8.0-*'
Note, selecting 'linux-headers-3.8.0-32' for regex 'linux-headers-3.8.0-*'
Note, selecting 'linux-headers-3.8.0-27' for regex 'linux-headers-3.8.0-*'
Note, selecting 'linux-headers-3.8.0-33' for regex 'linux-headers-3.8.0-*'
Note, selecting 'linux-headers-3.8.0-34' for regex 'linux-headers-3.8.0-*'
Note, selecting 'linux-headers-3.8.0-29' for regex 'linux-headers-3.8.0-*'
Note, selecting 'linux-headers-3.8.0-35' for regex 'linux-headers-3.8.0-*'
Note, selecting 'linux-headers-3.8.0-23-generic' for regex 'linux-headers-3.8.0-*'
Note, selecting 'linux-headers-3.8.0-31-generic' for regex 'linux-headers-3.8.0-*'
Note, selecting 'linux-headers-3.8.0-26-generic' for regex 'linux-headers-3.8.0-*'
Note, selecting 'linux-headers-3.8.0-34-generic' for regex 'linux-headers-3.8.0-*'
Note, selecting 'linux-headers-3.8.0-29-generic' for regex 'linux-headers-3.8.0-*'
Note, selecting 'linux-headers-3.8.0-21-generic' for regex 'linux-headers-3.8.0-*'
Note, selecting 'linux-headers-3.8.0-19-generic' for regex 'linux-headers-3.8.0-*'
Note, selecting 'linux-headers-3.8.0-32-generic' for regex 'linux-headers-3.8.0-*'
Note, selecting 'linux-headers-3.8.0-27-generic' for regex 'linux-headers-3.8.0-*'
Note, selecting 'linux-headers-3.8.0-35-generic' for regex 'linux-headers-3.8.0-*'
Note, selecting 'linux-headers-3.8.0-22-generic' for regex 'linux-headers-3.8.0-*'
Note, selecting 'linux-headers-3.8.0-30-generic' for regex 'linux-headers-3.8.0-*'
Note, selecting 'linux-headers-3.8.0-25-generic' for regex 'linux-headers-3.8.0-*'
Note, selecting 'linux-image-3.8.0-23-generic' for regex 'linux-image-3.8.0-*'
Note, selecting 'linux-image-3.8.0-31-generic' for regex 'linux-image-3.8.0-*'
Note, selecting 'linux-image-3.8.0-26-generic' for regex 'linux-image-3.8.0-*'
Note, selecting 'linux-image-3.8.0-34-generic' for regex 'linux-image-3.8.0-*'
Note, selecting 'linux-image-3.8.0-29-generic' for regex 'linux-image-3.8.0-*'
Note, selecting 'linux-image-3.8.0-21-generic' for regex 'linux-image-3.8.0-*'
Note, selecting 'linux-image-3.8.0-19-generic' for regex 'linux-image-3.8.0-*'
Note, selecting 'linux-image-3.8.0-32-generic' for regex 'linux-image-3.8.0-*'
Note, selecting 'linux-image-3.8.0-27-generic' for regex 'linux-image-3.8.0-*'
Note, selecting 'linux-image-3.8.0-35-generic' for regex 'linux-image-3.8.0-*'
Note, selecting 'linux-image-3.8.0-22-generic' for regex 'linux-image-3.8.0-*'
Note, selecting 'linux-image-3.8.0-30-generic' for regex 'linux-image-3.8.0-*'
Note, selecting 'linux-image-3.8.0-25-generic' for regex 'linux-image-3.8.0-*'
Note, selecting 'linux-image-3.8.0-33-generic' for regex 'linux-image-3.8.0-*'
Package linux-headers-3.8.0-19 is not installed, so not removed
Package linux-headers-3.8.0-19-generic is not installed, so not removed
Package linux-headers-3.8.0-21 is not installed, so not removed
Package linux-headers-3.8.0-21-generic is not installed, so not removed
Package linux-headers-3.8.0-22 is not installed, so not removed
Package linux-headers-3.8.0-22-generic is not installed, so not removed
Package linux-headers-3.8.0-23 is not installed, so not removed
Package linux-headers-3.8.0-23-generic is not installed, so not removed
Package linux-headers-3.8.0-25 is not installed, so not removed
Package linux-headers-3.8.0-25-generic is not installed, so not removed
Package linux-headers-3.8.0-26 is not installed, so not removed
Package linux-headers-3.8.0-26-generic is not installed, so not removed
Package linux-headers-3.8.0-27 is not installed, so not removed
Package linux-headers-3.8.0-27-generic is not installed, so not removed
Package linux-headers-3.8.0-29 is not installed, so not removed
Package linux-headers-3.8.0-29-generic is not installed, so not removed
Package linux-headers-3.8.0-30 is not installed, so not removed
Package linux-headers-3.8.0-30-generic is not installed, so not removed
Package linux-headers-3.8.0-31 is not installed, so not removed
Package linux-headers-3.8.0-31-generic is not installed, so not removed
Package linux-headers-3.8.0-32 is not installed, so not removed
Package linux-headers-3.8.0-32-generic is not installed, so not removed
Package linux-headers-3.8.0-33 is not installed, so not removed
Package linux-headers-3.8.0-33-generic is not installed, so not removed
Package linux-headers-3.8.0-35 is not installed, so not removed
Package linux-headers-3.8.0-35-generic is not installed, so not removed
Package linux-image-3.8.0-19-generic is not installed, so not removed
Package linux-image-3.8.0-21-generic is not installed, so not removed
Package linux-image-3.8.0-22-generic is not installed, so not removed
Package linux-image-3.8.0-23-generic is not installed, so not removed
Package linux-image-3.8.0-25-generic is not installed, so not removed
Package linux-image-3.8.0-26-generic is not installed, so not removed
Package linux-image-3.8.0-27-generic is not installed, so not removed
Package linux-image-3.8.0-29-generic is not installed, so not removed
Package linux-image-3.8.0-30-generic is not installed, so not removed
Package linux-image-3.8.0-31-generic is not installed, so not removed
Package linux-image-3.8.0-32-generic is not installed, so not removed
Package linux-image-3.8.0-33-generic is not installed, so not removed
Package linux-image-3.8.0-35-generic is not installed, so not removed
The following packages will be REMOVED:
linux-generic-lts-raring* linux-headers-3.8.0-34* linux-headers-3.8.0-34-generic* linux-headers-generic-lts-raring*
linux-image-3.8.0-34-generic* linux-image-generic-lts-raring*
0 upgraded, 0 newly installed, 6 to remove and 0 not upgraded.
Purg linux-generic-lts-raring [3.8.0.35.35]
Purg linux-headers-generic-lts-raring [3.8.0.34.34]
Purg linux-headers-3.8.0-34-generic [3.8.0-34.49~precise1]
Purg linux-headers-3.8.0-34 [3.8.0-34.49~precise1]
Purg linux-image-generic-lts-raring [3.8.0.34.34]
Purg linux-image-3.8.0-34-generic [3.8.0-34.49~precise1]
答案 1 :(得分:0)
删除旧内核版本的单行
dpkg --list | grep linux-image | awk' {print $ 2}' | sort -V | sed -n' /' uname -r
' / q; p' | xargs sudo apt-get -y purge