unnecessary packages in images / please run autoremove

Bug #1721035 reported by Scott Moser
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
cloud-images
New
Medium
Unassigned

Bug Description

It looks like all supported releases other than zesty have unnecessary packages in the lxd images.
Wouldn't it make sense to run apt-get autoremove before publication ?

$ for rel in $(ubuntu-distro-info --supported); do echo == $rel ==; n=autoremove-$rel; lxc launch ubuntu-daily:$rel $n; sleep 1; lxc exec $n -- apt-get autoremove --dry-run; lxc delete --force $n; done
== trusty ==
Creating autoremove-trusty
Starting autoremove-trusty
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  libfreetype6 os-prober
0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
Remv libfreetype6 [2.5.2-1ubuntu2.8]
Remv os-prober [1.63ubuntu1.1]
== xenial ==
Creating autoremove-xenial
Starting autoremove-xenial
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  libfreetype6
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
Remv libfreetype6 [2.6.1-0.1ubuntu2.3]
== zesty ==
Creating autoremove-zesty
Starting autoremove-zesty
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
== artful ==
Creating autoremove-artful
Starting autoremove-artful
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  libfreetype6
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
Remv libfreetype6 [2.8-0.2ubuntu2]

Dan Watkins (oddbloke)
Changed in cloud-images:
importance: Undecided → Medium
Revision history for this message
Scott Moser (smoser) wrote :

Updated as of today.

$ for rel in $(ubuntu-distro-info --supported); do echo == $rel ==; n=autoremove-$rel; lxc launch ubuntu-daily:$rel $n; sleep 1; lxc exec $n -- cat /etc/cloud/build.info; lxc exec $n -- apt-get autoremove --dry-run; lxc delete --force $n; done
== trusty ==
Creating autoremove-trusty
Starting autoremove-trusty
build_name: server
serial: 20180222.1
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  libfreetype6 os-prober
0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
Remv libfreetype6 [2.5.2-1ubuntu2.8]
Remv os-prober [1.63ubuntu1.1]
== xenial ==
Creating autoremove-xenial
Starting autoremove-xenial
build_name: server
serial: 20180223
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  libfreetype6
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
Remv libfreetype6 [2.6.1-0.1ubuntu2.3]
== artful ==
Creating autoremove-artful
Starting autoremove-artful
build_name: server
serial: 20180222
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  libfreetype6
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
Remv libfreetype6 [2.8-0.2ubuntu2.1]
== bionic ==
Creating autoremove-bionic
Starting autoremove-bionic
build_name: server
serial: 20180222
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Revision history for this message
Scott Moser (smoser) wrote :

I noticed today that 'apt-get autoremove' in an amd64 cloud image will offer to remove grub-pc-bin.

That would save 2987kb of disk space.

Is there some reason we don't do this?

Revision history for this message
Scott Moser (smoser) wrote :

well, looked at a minimal focal image and came across this again.
We could save almost a whole 1% there.

$ lxc launch ubunut-minimal-daily:focall minf1
root@minf1:~# du -hs --one-file-system /
215M /

root@minf1:~# cat /etc/cloud/build.info
build_name: minimal
serial: 20200218

root@minf1:~# apt-get autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  gettext-base libefiboot1 libefivar1 libfreetype6 libpng16-16 linux-base
0 upgraded, 0 newly installed, 6 to remove and 0 not upgraded.
After this operation, 1930 kB disk space will be freed.

Revision history for this message
Simon Déziel (sdeziel) wrote :

Running this "apt-get autoremove --purge" on first boot is annoying, would be nice to get rid of this as it also causes some noise when installing packages because apt reminds you to do a cleanup :)

tags: added: id-5e4d6fd6efbb1884d04003fc
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.