Ubuntu – Mirror using apt-mirror and exclude certain sections/categories

aptapt-mirror

I'm currently using apt-mirror to create a local mirror of the Debian repositories.

As the mirrored repositories will be used only by machines destined to be headless servers and as an effort to reduce the current mirroring size (around 75GB), categories like games and possibly others will never be needed.

How can I go about specifying (on the mirror.list perhaps?) what sections/categories I want to be excluded from the mirroring?

Maybe a bit subjective, but apart from games what other sections/categories could be "safely" ignored from the mirroring for my environment purposes?

My mirror.list looks as below since all the machines are using precise.

# MAIN
deb-amd64 http://archive.ubuntu.com/ubuntu precise main restricted universe multiverse
deb-i386 http://archive.ubuntu.com/ubuntu precise main restricted universe multiverse

# SECURITY
deb-amd64 http://archive.ubuntu.com/ubuntu precise-security main restricted universe multiverse
deb-i386 http://archive.ubuntu.com/ubuntu precise-security main restricted universe multiverse

Also, what others would you recommend adding to the list to be mirrored for a relatively stable environment? Again I understand this is subjective, just looking for some pointers.

Best Answer

Sadly, apt-mirror is not capable of such tasks. Meanwhile, the debmirror tool does have such functionality:

--exclude-deb-section=regex
    Never download any files whose Debian Section (games, doc, oldlibs,
    science, ...) match the regex. May be used multiple times.

This can be configured in the /etc/debmirror.conf. Just copy the example from /usr/share/doc/debmirror/examples/debmirror.conf, and do the configurations that you like. The important bit is the # @excludes_deb_section="";.