Ubuntuの不要なパッケージを削除する

提供: Ubuntu入門
移動: 案内検索
スポンサーリンク

Ubuntuを長く利用していると、不要になってくるパッケージがあります。aptコマンドでインストールなどをしているときに、インストールされているけど、すでに不要になっているパッケージを教えてくれます。不要なパッケージは、いらないので削除してしまいましょう。

読み方

apt-get
あぷとげっと
autoremove
おーと りむーぶ

概要

aptコマンドを使用していると以下の様なメッセージが表示されることがあります。

The following packages were automatically installed and are no longer required:
  linux-headers-3.13.0-24 linux-headers-3.13.0-24-generic
  linux-image-3.13.0-24-generic linux-image-extra-3.13.0-24-generic
Use 'apt-get autoremove' to remove them.

不要なパッケージは、インストールされていても意味がないので消してしまいましょう。ストレージの使用量を減らすことができます。

不要なパッケージの削除の仕方

これだけで、自動削除できます。

$ sudo apt-get autoremove

実行例

$ sudo apt-get autoremove Reading package lists... Done Building dependency
tree Reading state information... Done The following packages will be REMOVED:
linux-headers-3.13.0-24 linux-headers-3.13.0-24-generic
linux-image-3.13.0-24-generic linux-image-extra-3.13.0-24-generic 0 upgraded,
0 newly installed, 4 to remove and 0 not upgraded.  After this operation, 270
MB disk space will be freed.  Do you want to continue? [Y/n] y (Reading
database ... 266859 files and directories currently installed.) Removing
linux-headers-3.13.0-24-generic (3.13.0-24.47) ...  Removing
linux-headers-3.13.0-24 (3.13.0-24.47) ...  Removing
linux-image-extra-3.13.0-24-generic (3.13.0-24.47) ...  Examining
/etc/kernel/postrm.d .  run-parts: executing
/etc/kernel/postrm.d/initramfs-tools 3.13.0-24-generic
/boot/vmlinuz-3.13.0-24-generic update-initramfs: Deleting
/boot/initrd.img-3.13.0-24-generic run-parts: executing
/etc/kernel/postrm.d/zz-update-grub 3.13.0-24-generic
/boot/vmlinuz-3.13.0-24-generic Generating grub configuration file ...
Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is
set is no longer supported.  Found linux image:
/boot/vmlinuz-3.13.0-46-generic Found initrd image:
/boot/initrd.img-3.13.0-46-generic Found linux image:
/boot/vmlinuz-3.13.0-45-generic Found initrd image:
/boot/initrd.img-3.13.0-45-generic Found linux image:
/boot/vmlinuz-3.13.0-24-generic Found linux image:
/boot/vmlinuz-3.11.0-12-generic Found initrd image:
/boot/initrd.img-3.11.0-12-generic Found memtest86+ image:
/boot/memtest86+.elf Found memtest86+ image: /boot/memtest86+.bin done
Removing linux-image-3.13.0-24-generic (3.13.0-24.47) ...  Examining
/etc/kernel/postrm.d .  run-parts: executing
/etc/kernel/postrm.d/initramfs-tools 3.13.0-24-generic
/boot/vmlinuz-3.13.0-24-generic update-initramfs: Deleting
/boot/initrd.img-3.13.0-24-generic run-parts: executing
/etc/kernel/postrm.d/zz-update-grub 3.13.0-24-generic
/boot/vmlinuz-3.13.0-24-generic Generating grub configuration file ...
Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is
set is no longer supported.  Found linux image:
/boot/vmlinuz-3.13.0-46-generic Found initrd image:
/boot/initrd.img-3.13.0-46-generic Found linux image:
/boot/vmlinuz-3.13.0-45-generic Found initrd image:
/boot/initrd.img-3.13.0-45-generic Found linux image:
/boot/vmlinuz-3.11.0-12-generic Found initrd image:
/boot/initrd.img-3.11.0-12-generic Found memtest86+ image:
/boot/memtest86+.elf Found memtest86+ image: /boot/memtest86+.bin done

関連項目




スポンサーリンク