799 lines
52 KiB
HTML
799 lines
52 KiB
HTML
|
<!DOCTYPE html>
|
|||
|
<html>
|
|||
|
<head>
|
|||
|
<meta charset="utf-8">
|
|||
|
<title>
|
|||
|
customizing-package-installation -
|
|||
|
Live Systems Manual
|
|||
|
</title>
|
|||
|
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
|
|||
|
<meta name="dc.title" content="Live Systems Manual" />
|
|||
|
<meta name="dc.author" content="Live Systems Project <debian-live@lists.debian.org>" />
|
|||
|
<meta name="dc.publisher" content="Live Systems Project <debian-live@lists.debian.org>" />
|
|||
|
<meta name="dc.date" content="2015-09-22" />
|
|||
|
<meta name="dc.rights" content="Copyright: Copyright (C) 2006-2015 Live Systems Project \\ License: This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. \\ \\ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. \\ \\ You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/. \\ \\ The complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL-3 file." />
|
|||
|
|
|||
|
<meta name="generator" content="SiSU 7.2.1_pre_rel of 2019w35/4 (2019-09-05) (n*x and Ruby!)" />
|
|||
|
<link rel="generator" href="http://www.sisudoc.org/" />
|
|||
|
<link rel="shortcut icon" href="../_sisu/image/rb7.ico" />
|
|||
|
|
|||
|
<link href="../../_sisu/css/html.css" rel="stylesheet">
|
|||
|
</head>
|
|||
|
<body lang="en">
|
|||
|
<a name="top" id="top"></a><table summary="segment navigation band with banner" bgcolor="#ffffff" width="100%"><tr>
|
|||
|
<td width="20%" align="left">
|
|||
|
<table summary="home button / home information" border="0" cellpadding="3" cellspacing="0">
|
|||
|
<tr><td align="left" bgcolor="#ffffff">
|
|||
|
<p class="tiny_left"><a href="http://debian-live.alioth.debian.org/manual" target="_top">
|
|||
|
Live manual
|
|||
|
</a></p>
|
|||
|
<p class="tiny_left"><a href="http://debian-live.alioth.debian.org" target="_top">
|
|||
|
Live Systems
|
|||
|
</a></p>
|
|||
|
</td></tr>
|
|||
|
</table>
|
|||
|
</td>
|
|||
|
<td width="75%" align="center">
|
|||
|
|
|||
|
<table summary="segment navigation available documents types: toc,doc,pdf,concordance" border="0" cellpadding="3" cellspacing="0">
|
|||
|
<tr>
|
|||
|
<td align="center" bgcolor="#ffffff">
|
|||
|
|
|||
|
|
|||
|
</tr></table>
|
|||
|
</td>
|
|||
|
<td width="5%" align="right">
|
|||
|
<table summary="segment navigation pre/next" border="0" cellpadding="3" cellspacing="0">
|
|||
|
<tr>
|
|||
|
<td align="center" bgcolor="#ffffff">
|
|||
|
<a href="customization-overview.en.html" target="_top">
|
|||
|
<img border="0" width="22" height="22" src="../../_sisu/image_sys/arrow_prev_red.png" alt="<< previous" />
|
|||
|
</a>
|
|||
|
</td>
|
|||
|
<td align="center" bgcolor="#ffffff">
|
|||
|
<a href="toc.en.html" target="_top">
|
|||
|
<img border="0" width="22" height="22" src="../../_sisu/image_sys/arrow_up_red.png" alt="toc" />
|
|||
|
</a>
|
|||
|
</td>
|
|||
|
<td align="center" bgcolor="#ffffff">
|
|||
|
<a href="customizing-contents.en.html" target="_top">
|
|||
|
<img border="0" width="22" height="22" src="../../_sisu/image_sys/arrow_next_red.png" alt="next >>" />
|
|||
|
</a>
|
|||
|
</td>
|
|||
|
<td>
|
|||
|
</td></tr>
|
|||
|
</table>
|
|||
|
</td></tr>
|
|||
|
</table><div class="content0">
|
|||
|
<h1 class="tiny">
|
|||
|
Live Systems Manual
|
|||
|
</h1>
|
|||
|
</div><div class="content0">
|
|||
|
<h1 class="tiny">
|
|||
|
Customizing package installation
|
|||
|
</h1>
|
|||
|
</div><div class="content0"><div class="substance">
|
|||
|
<label class="ocn"><a href="#370" class="lnkocn">370</a></label>
|
|||
|
<h1 class="norm" id="370"><a name="370"></a>
|
|||
|
8. Customizing package installation
|
|||
|
</h1>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#371" class="lnkocn">371</a></label>
|
|||
|
<p class="i0" id="371">
|
|||
|
Perhaps the most basic customization of a live system is the selection of packages to be included in the image. This chapter guides you through the various build-time options to customize <i>live-build</i>'s installation of packages. The broadest choices influencing which packages are available to install in the image are the distribution and archive areas. To ensure decent download speeds, you should choose a nearby distribution mirror. You can also add your own repositories for backports, experimental or custom packages, or include packages directly as files. You can define lists of packages, including metapackages which will install many related packages at once, such as packages for a particular desktop or language. Finally, a number of options give some control over <i>apt</i>, or if you prefer, <i>aptitude</i>, at build time when packages are installed. You may find these handy if you use a proxy, want to disable installation of recommended packages to save space, or need to control which versions of packages are installed via APT pinning, to name a few possibilities.
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#372" class="lnkocn">372</a></label>
|
|||
|
<p class="bold" id="372"><a name="372"></a> <a id="hc8.1"></a>
|
|||
|
<a name="c8.1" ></a><a name="h8.1" ></a>8.1 Package sources
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#373" class="lnkocn">373</a></label>
|
|||
|
<p class="bold" id="373"><a name="373"></a> <a id="hc8.1.1"></a>
|
|||
|
<a name="c8.1.1" ></a><a name="h8.1.1" ></a>8.1.1 Distribution, archive areas and mode
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#374" class="lnkocn">374</a></label>
|
|||
|
<p class="i0" id="374">
|
|||
|
The distribution you choose has the broadest impact on which packages are available to include in your live image. Specify the codename, which defaults to <b>buster</b> for the <b>buster</b> version of <i>live-build</i>. Any current distribution carried in the archive may be specified by its codename here. (See <a href="about-manual.en.html#terms">Terms</a> for more details.) The <tt>--distribution</tt> option not only influences the source of packages within the archive, but also instructs <i>live-build</i> to behave as needed to build each supported distribution. For example, to build against the <b>unstable</b> release, <b>sid</b>, specify:
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#375" class="lnkocn">375</a></label>
|
|||
|
<p class="code" id="375">
|
|||
|
$ lb config --distribution sid<br>
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#376" class="lnkocn">376</a></label>
|
|||
|
<p class="i0" id="376">
|
|||
|
Within the distribution archive, archive areas are major divisions of the archive. In Debian, these are <tt>main</tt>, <tt>contrib</tt> and <tt>non-free</tt>. Only <tt>main</tt> contains software that is part of the Debian distribution, hence that is the default. One or more values may be specified, e.g.
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#377" class="lnkocn">377</a></label>
|
|||
|
<p class="code" id="377">
|
|||
|
$ lb config --archive-areas "main contrib non-free"<br>
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#378" class="lnkocn">378</a></label>
|
|||
|
<p class="i0" id="378">
|
|||
|
Experimental support is available for some Debian derivatives through a <tt>--mode</tt> option. By default, this option is set to <tt>debian</tt> only if you are building on a Debian or on an unknown system. If <tt>lb config</tt> is invoked on any of the supported derivatives, it will default to create an image of that derivative. If <tt>lb config</tt> is run in e.g. <tt>ubuntu</tt> mode, the distribution names and archive areas for the specified derivative are supported instead of the ones for Debian. The mode also modifies <i>live-build</i> behaviour to suit the derivatives.
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#379" class="lnkocn">379</a></label>
|
|||
|
<p class="i0" id="379">
|
|||
|
<b>Note:</b> The projects for whom these modes were added are primarily responsible for supporting users of these options. The Live Systems Project, in turn, provides development support on a best-effort basis only, based on feedback from the derivative projects as we do not develop or support these derivatives ourselves.
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#380" class="lnkocn">380</a></label>
|
|||
|
<p class="bold" id="380"><a name="380"></a> <a id="hc8.1.2"></a>
|
|||
|
<a name="c8.1.2" ></a><a name="h8.1.2" ></a>8.1.2 Distribution mirrors
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#381" class="lnkocn">381</a></label>
|
|||
|
<p class="i0" id="381">
|
|||
|
The Debian archive is replicated across a large network of mirrors around the world so that people in each region can choose a nearby mirror for best download speed. Each of the <tt>--mirror-*</tt> options governs which distribution mirror is used at various stages of the build. Recall from <a href="customization-overview.en.html#stages-of-the-build">Stages of the build</a> that the <b>bootstrap</b> stage is when the chroot is initially populated by <i>debootstrap</i> with a minimal system, and the <b>chroot</b> stage is when the chroot used to construct the live system's filesystem is built. Thus, the corresponding mirror switches are used for those stages, and later, in the <b>binary</b> stage, the <tt>--mirror-binary</tt> and <tt>--mirror-binary-security</tt> values are used, superseding any mirrors used in an earlier stage.
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#382" class="lnkocn">382</a></label>
|
|||
|
<p class="bold" id="382"><a name="382"></a> <a id="hdistribution-mirrors-build-time"></a>
|
|||
|
<a name="h8.1.3" ></a><a name="distribution-mirrors-build-time" ></a>8.1.3 Distribution mirrors used at build time
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#383" class="lnkocn">383</a></label>
|
|||
|
<p class="i0" id="383">
|
|||
|
To set the distribution mirrors used at build time to point at a local mirror, it is sufficient to set <tt>--mirror-bootstrap</tt> and <tt>--mirror-chroot-security</tt> as follows.
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#384" class="lnkocn">384</a></label>
|
|||
|
<p class="code" id="384">
|
|||
|
$ lb config --mirror-bootstrap http://localhost/debian/ \<br>
|
|||
|
--mirror-chroot-security http://localhost/debian-security/<br>
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#385" class="lnkocn">385</a></label>
|
|||
|
<p class="i0" id="385">
|
|||
|
The chroot mirror, specified by <tt>--mirror-chroot</tt>, defaults to the <tt>--mirror-bootstrap</tt> value.
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#386" class="lnkocn">386</a></label>
|
|||
|
<p class="bold" id="386"><a name="386"></a> <a id="hc8.1.4"></a>
|
|||
|
<a name="c8.1.4" ></a><a name="h8.1.4" ></a>8.1.4 Distribution mirrors used at run time
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#387" class="lnkocn">387</a></label>
|
|||
|
<p class="i0" id="387">
|
|||
|
The <tt>--mirror-binary*</tt> options govern the distribution mirrors placed in the binary image. These may be used to install additional packages while running the live system. The defaults employ <tt>httpredir.debian.org</tt>, a service that chooses a geographically close mirror based, among other things, on the user's IP family and the availability of the mirrors. This is a suitable choice when you cannot predict which mirror will be best for all of your users. Or you may specify your own values as shown in the example below. An image built from this configuration would only be suitable for users on a network where "<tt>mirror</tt>" is reachable.
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#388" class="lnkocn">388</a></label>
|
|||
|
<p class="code" id="388">
|
|||
|
$ lb config --mirror-binary http://mirror/debian/ \<br>
|
|||
|
--mirror-binary-security http://mirror/debian-security/ \<br>
|
|||
|
--mirror-binary-backports http://mirror/debian-backports/<br>
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#389" class="lnkocn">389</a></label>
|
|||
|
<p class="bold" id="389"><a name="389"></a> <a id="hadditional-repositories"></a>
|
|||
|
<a name="h8.1.5" ></a><a name="additional-repositories" ></a>8.1.5 Additional repositories
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#390" class="lnkocn">390</a></label>
|
|||
|
<p class="i0" id="390">
|
|||
|
You may add more repositories, broadening your package choices beyond what is available in your target distribution. These may be, for example, for backports, experimental or custom packages. To configure additional repositories, create <tt>config/archives/your-repository.list.chroot</tt>, and/or <tt>config/archives/your-repository.list.binary</tt> files. As with the <tt>--mirror-*</tt> options, these govern the repositories used in the <b>chroot</b> stage when building the image, and in the <b>binary</b> stage, i.e. for use when running the live system.
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#391" class="lnkocn">391</a></label>
|
|||
|
<p class="i0" id="391">
|
|||
|
For example, <tt>config/archives/live.list.chroot</tt> allows you to install packages from the debian-live snapshot repository at live system build time.
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#392" class="lnkocn">392</a></label>
|
|||
|
<p class="code" id="392">
|
|||
|
deb http://debian-live.alioth.debian.org/ sid-snapshots main contrib non-free<br>
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#393" class="lnkocn">393</a></label>
|
|||
|
<p class="i0" id="393">
|
|||
|
If you add the same line to <tt>config/archives/live.list.binary</tt>, the repository will be added to your live system's <tt>/etc/apt/sources.list.d/</tt> directory.
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#394" class="lnkocn">394</a></label>
|
|||
|
<p class="i0" id="394">
|
|||
|
If such files exist, they will be picked up automatically.
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#395" class="lnkocn">395</a></label>
|
|||
|
<p class="i0" id="395">
|
|||
|
You should also put the GPG key used to sign the repository into <tt>config/archives/your-repository.key.{binary,chroot}</tt> files.
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#396" class="lnkocn">396</a></label>
|
|||
|
<p class="i0" id="396">
|
|||
|
Should you need custom APT pinning, such APT preferences snippets can be placed in <tt>config/archives/your-repository.pref.{binary,chroot}</tt> files and will be automatically added to your live system's <tt>/etc/apt/preferences.d/</tt> directory.
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#397" class="lnkocn">397</a></label>
|
|||
|
<p class="bold" id="397"><a name="397"></a> <a id="hchoosing-packages-to-install"></a>
|
|||
|
<a name="h8.2" ></a><a name="choosing-packages-to-install" ></a>8.2 Choosing packages to install
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#398" class="lnkocn">398</a></label>
|
|||
|
<p class="i0" id="398">
|
|||
|
There are a number of ways to choose which packages <i>live-build</i> will install in your image, covering a variety of different needs. You can simply name individual packages to install in a package list. You can also use metapackages in those lists, or select them using package control file fields. And finally, you may place package files in your <tt>config/</tt> tree, which is well suited to testing of new or experimental packages before they are available from a repository.
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#399" class="lnkocn">399</a></label>
|
|||
|
<p class="bold" id="399"><a name="399"></a> <a id="hpackage-lists"></a>
|
|||
|
<a name="h8.2.1" ></a><a name="package-lists" ></a>8.2.1 Package lists
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#400" class="lnkocn">400</a></label>
|
|||
|
<p class="i0" id="400">
|
|||
|
Package lists are a powerful way of expressing which packages should be installed. The list syntax supports conditional sections which makes it easy to build lists and adapt them for use in multiple configurations. Package names may also be injected into the list using shell helpers at build time.
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#401" class="lnkocn">401</a></label>
|
|||
|
<p class="i0" id="401">
|
|||
|
<b>Note:</b> The behaviour of <i>live-build</i> when specifying a package that does not exist is determined by your choice of APT utility. See <a href="customizing-package-installation.en.html#choosing-apt-or-aptitude">Choosing apt or aptitude</a> for more details.
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#402" class="lnkocn">402</a></label>
|
|||
|
<p class="bold" id="402"><a name="402"></a> <a id="husing-metapackages"></a>
|
|||
|
<a name="h8.2.2" ></a><a name="using-metapackages" ></a>8.2.2 Using metapackages
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#403" class="lnkocn">403</a></label>
|
|||
|
<p class="i0" id="403">
|
|||
|
The simplest way to populate your package list is to use a task metapackage maintained by your distribution. For example:
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#404" class="lnkocn">404</a></label>
|
|||
|
<p class="code" id="404">
|
|||
|
$ lb config<br>
|
|||
|
$ echo task-gnome-desktop > config/package-lists/desktop.list.chroot<br>
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#405" class="lnkocn">405</a></label>
|
|||
|
<p class="i0" id="405">
|
|||
|
This supercedes the older predefined list method supported in <tt>live-build</tt> 2.x. Unlike predefined lists, task metapackages are not specific to the Live System project. Instead, they are maintained by specialist working groups within the distribution and therefore reflect the consensus of each group about which packages best serve the needs of the intended users. They also cover a much broader range of use cases than the predefined lists they replace.
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#406" class="lnkocn">406</a></label>
|
|||
|
<p class="i0" id="406">
|
|||
|
All task metapackages are prefixed <tt>task-</tt>, so a quick way to determine which are available (though it may contain a handful of false hits that match the name but aren't metapackages) is to match on the package name with:
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#407" class="lnkocn">407</a></label>
|
|||
|
<p class="code" id="407">
|
|||
|
$ apt-cache search --names-only ^task-<br>
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#408" class="lnkocn">408</a></label>
|
|||
|
<p class="i0" id="408">
|
|||
|
In addition to these, you will find other metapackages with various purposes. Some are subsets of broader task packages, like <tt>gnome-core</tt>, while others are individual specialized parts of a Debian Pure Blend, such as the <tt>education-*</tt> metapackages. To list all metapackages in the archive, install the <tt>debtags</tt> package and list all packages with the <tt>role::metapackage</tt> tag as follows:
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#409" class="lnkocn">409</a></label>
|
|||
|
<p class="code" id="409">
|
|||
|
$ debtags search role::metapackage<br>
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#410" class="lnkocn">410</a></label>
|
|||
|
<p class="bold" id="410"><a name="410"></a> <a id="hc8.2.3"></a>
|
|||
|
<a name="c8.2.3" ></a><a name="h8.2.3" ></a>8.2.3 Local package lists
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#411" class="lnkocn">411</a></label>
|
|||
|
<p class="i0" id="411">
|
|||
|
Whether you list metapackages, individual packages, or a combination of both, all local package lists are stored in <tt>config/package-lists/</tt>. Since more than one list can be used, this lends itself well to modular designs. For example, you may decide to devote one list to a particular choice of desktop, another to a collection of related packages that might as easily be used on top of a different desktop. This allows you to experiment with different combinations of sets of packages with a minimum of fuss, sharing common lists between different live image projects.
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#412" class="lnkocn">412</a></label>
|
|||
|
<p class="i0" id="412">
|
|||
|
Package lists that exist in this directory need to have a <tt>.list</tt> suffix in order to be processed, and then an additional stage suffix, <tt>.chroot</tt> or <tt>.binary</tt> to indicate which stage the list is for.
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#413" class="lnkocn">413</a></label>
|
|||
|
<p class="i0" id="413">
|
|||
|
<b>Note:</b> If you don't specify the stage suffix, the list will be used for both stages. Normally, you want to specify <tt>.list.chroot</tt> so that the packages will only be installed in the live filesystem and not have an extra copy of the <tt>.deb</tt> placed on the medium.
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#414" class="lnkocn">414</a></label>
|
|||
|
<p class="bold" id="414"><a name="414"></a> <a id="hc8.2.4"></a>
|
|||
|
<a name="c8.2.4" ></a><a name="h8.2.4" ></a>8.2.4 Local binary package lists
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#415" class="lnkocn">415</a></label>
|
|||
|
<p class="i0" id="415">
|
|||
|
To make a binary stage list, place a file suffixed with <tt>.list.binary</tt> in <tt>config/package-lists/</tt>. These packages are not installed in the live filesystem, but are included on the live medium under <tt>pool/</tt>. You would typically use such a list with one of the non-live installer variants. As mentioned above, if you want this list to be the same as your chroot stage list, simply use the <tt>.list</tt> suffix by itself.
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#416" class="lnkocn">416</a></label>
|
|||
|
<p class="bold" id="416"><a name="416"></a> <a id="hgenerated-package-lists"></a>
|
|||
|
<a name="h8.2.5" ></a><a name="generated-package-lists" ></a>8.2.5 Generated package lists
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#417" class="lnkocn">417</a></label>
|
|||
|
<p class="i0" id="417">
|
|||
|
It sometimes happens that the best way to compose a list is to generate it with a script. Any line starting with an exclamation point indicates a command to be executed within the chroot when the image is built. For example, one might include the line <tt>! grep-aptavail -n -sPackage -FPriority standard | sort</tt> in a package list to produce a sorted list of available packages with <tt>Priority: standard</tt>.
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#418" class="lnkocn">418</a></label>
|
|||
|
<p class="i0" id="418">
|
|||
|
In fact, selecting packages with the <tt>grep-aptavail</tt> command (from the <tt>dctrl-tools</tt> package) is so useful that <tt>live-build</tt> provides a <tt>Packages</tt> helper script as a convenience. This script takes two arguments: <tt>field</tt> and <tt>pattern</tt>. Thus, you can create a list with the following contents:
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#419" class="lnkocn">419</a></label>
|
|||
|
<p class="code" id="419">
|
|||
|
$ lb config<br>
|
|||
|
$ echo '! Packages Priority standard' > config/package-lists/standard.list.chroot<br>
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#420" class="lnkocn">420</a></label>
|
|||
|
<p class="bold" id="420"><a name="420"></a> <a id="hc8.2.6"></a>
|
|||
|
<a name="c8.2.6" ></a><a name="h8.2.6" ></a>8.2.6 Using conditionals inside package lists
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#421" class="lnkocn">421</a></label>
|
|||
|
<p class="i0" id="421">
|
|||
|
Any of the <i>live-build</i> configuration variables stored in <tt>config/*</tt> (minus the <tt>LB_</tt> prefix) may be used in conditional statements in package lists. Generally, this means any <tt>lb config</tt> option uppercased and with dashes changed to underscores. But in practice, it is only the ones that influence package selection that make sense, such as <tt>DISTRIBUTION</tt>, <tt>ARCHITECTURES</tt> or <tt>ARCHIVE_AREAS</tt>.
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#422" class="lnkocn">422</a></label>
|
|||
|
<p class="i0" id="422">
|
|||
|
For example, to install <tt>ia32-libs</tt> if the <tt>--architectures amd64</tt> is specified:
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#423" class="lnkocn">423</a></label>
|
|||
|
<p class="code" id="423">
|
|||
|
#if ARCHITECTURES amd64<br>
|
|||
|
ia32-libs<br>
|
|||
|
#endif<br>
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#424" class="lnkocn">424</a></label>
|
|||
|
<p class="i0" id="424">
|
|||
|
You may test for any one of a number of values, e.g. to install <i>memtest86+</i> if either <tt>--architectures i386</tt> or <tt>--architectures amd64</tt> is specified:
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#425" class="lnkocn">425</a></label>
|
|||
|
<p class="code" id="425">
|
|||
|
#if ARCHITECTURES i386 amd64<br>
|
|||
|
memtest86+<br>
|
|||
|
#endif<br>
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#426" class="lnkocn">426</a></label>
|
|||
|
<p class="i0" id="426">
|
|||
|
You may also test against variables that may contain more than one value, e.g. to install <i>vrms</i> if either <tt>contrib</tt> or <tt>non-free</tt> is specified via <tt>--archive-areas</tt>:
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#427" class="lnkocn">427</a></label>
|
|||
|
<p class="code" id="427">
|
|||
|
#if ARCHIVE_AREAS contrib non-free<br>
|
|||
|
vrms<br>
|
|||
|
#endif<br>
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#428" class="lnkocn">428</a></label>
|
|||
|
<p class="i0" id="428">
|
|||
|
The nesting of conditionals is not supported.
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#429" class="lnkocn">429</a></label>
|
|||
|
<p class="bold" id="429"><a name="429"></a> <a id="hc8.2.7"></a>
|
|||
|
<a name="c8.2.7" ></a><a name="h8.2.7" ></a>8.2.7 Removing packages at install time
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#430" class="lnkocn">430</a></label>
|
|||
|
<p class="i0" id="430">
|
|||
|
You can list packages in files with <tt>.list.chroot_live</tt> and <tt>.list.chroot_install</tt> suffixes inside the <tt>config/package-lists</tt> directory. If both a live and an install list exist, the packages in the <tt>.list.chroot_live</tt> list are removed with a hook after the installation (if the user uses the installer). The packages in the <tt>.list.chroot_install</tt> list are present both in the live system and in the installed system. This is a special tweak for the installer and may be useful if you have <tt>--debian-installer live</tt> set in your config, and wish to remove live system-specific packages at install time.
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#431" class="lnkocn">431</a></label>
|
|||
|
<p class="bold" id="431"><a name="431"></a> <a id="hdesktop-and-language-tasks"></a>
|
|||
|
<a name="h8.2.8" ></a><a name="desktop-and-language-tasks" ></a>8.2.8 Desktop and language tasks
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#432" class="lnkocn">432</a></label>
|
|||
|
<p class="i0" id="432">
|
|||
|
Desktop and language tasks are special cases that need some extra planning and configuration. Live images are different from Debian Installer images in this respect. In the Debian Installer, if the medium was prepared for a particular desktop environment flavour, the corresponding task will be automatically installed. Thus, there are internal <tt>gnome-desktop</tt>, <tt>kde-desktop</tt>, <tt>lxde-desktop</tt> and <tt>xfce-desktop</tt> tasks, none of which are offered in <tt>tasksel</tt>'s menu. Likewise, there are no menu entries for tasks for languages, but the user's language choice during the install influences the selection of corresponding language tasks.
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#433" class="lnkocn">433</a></label>
|
|||
|
<p class="i0" id="433">
|
|||
|
When developing a desktop live image, the image typically boots directly to a working desktop, the choices of both desktop and default language having been made at build time, not at run time as in the case of the Debian Installer. That's not to say that a live image couldn't be built to support multiple desktops or multiple languages and offer the user a choice, but that is not <i>live-build</i>'s default behaviour.
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#434" class="lnkocn">434</a></label>
|
|||
|
<p class="i0" id="434">
|
|||
|
Because there is no provision made automatically for language tasks, which include such things as language-specific fonts and input-method packages, if you want them, you need to specify them in your configuration. For example, a GNOME desktop image containing support for German might include these task metapackages:
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#435" class="lnkocn">435</a></label>
|
|||
|
<p class="code" id="435">
|
|||
|
$ lb config<br>
|
|||
|
$ echo "task-gnome-desktop task-laptop" >> config/package-lists/my.list.chroot<br>
|
|||
|
$ echo "task-german task-german-desktop task-german-gnome-desktop" >> config/package-lists/my.list.chroot<br>
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#436" class="lnkocn">436</a></label>
|
|||
|
<p class="bold" id="436"><a name="436"></a> <a id="hkernel-flavour-and-version"></a>
|
|||
|
<a name="h8.2.9" ></a><a name="kernel-flavour-and-version" ></a>8.2.9 Kernel flavour and version
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#437" class="lnkocn">437</a></label>
|
|||
|
<p class="i0" id="437">
|
|||
|
One or more kernel flavours will be included in your image by default, depending on the architecture. You can choose different flavours via the <tt>--linux-flavours</tt> option. Each flavour is suffixed to the default stub <tt>linux-image</tt> to form each metapackage name which in turn depends on an exact kernel package to be included in your image.
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#438" class="lnkocn">438</a></label>
|
|||
|
<p class="i0" id="438">
|
|||
|
Thus by default, an <tt>amd64</tt> architecture image will include the <tt>linux-image-amd64</tt> flavour metapackage, and an <tt>i386</tt> architecture image will include the <tt>linux-image-586</tt> metapackage.
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#439" class="lnkocn">439</a></label>
|
|||
|
<p class="i0" id="439">
|
|||
|
When more than one kernel package version is available in your configured archives, you can specify a different kernel package name stub with the <tt>--linux-packages</tt> option. For example, supposing you are building an <tt>amd64</tt> architecture image and add the experimental archive for testing purposes so you can install the <tt>linux-image-3.18.0-trunk-amd64</tt> kernel. You would configure that image as follows:
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#440" class="lnkocn">440</a></label>
|
|||
|
<p class="code" id="440">
|
|||
|
$ lb config --linux-packages linux-image-3.18.0-trunk<br>
|
|||
|
$ echo "deb http://ftp.debian.org/debian/ experimental main" > config/archives/experimental.list.chroot<br>
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#441" class="lnkocn">441</a></label>
|
|||
|
<p class="bold" id="441"><a name="441"></a> <a id="hcustom-kernels"></a>
|
|||
|
<a name="h8.2.10" ></a><a name="custom-kernels" ></a>8.2.10 Custom kernels
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#442" class="lnkocn">442</a></label>
|
|||
|
<p class="i0" id="442">
|
|||
|
You can build and include your own custom kernels, so long as they are integrated within the Debian package management system. The <i>live-build</i> system does not support kernels not built as <tt>.deb</tt> packages.
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#443" class="lnkocn">443</a></label>
|
|||
|
<p class="i0" id="443">
|
|||
|
The proper and recommended way to deploy your own kernel packages is to follow the instructions in the <tt>kernel-handbook</tt>. Remember to modify the ABI and flavour suffixes appropriately, then include a complete build of the <tt>linux</tt> and matching <tt>linux-latest</tt> packages in your repository.
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#444" class="lnkocn">444</a></label>
|
|||
|
<p class="i0" id="444">
|
|||
|
If you opt to build the kernel packages without the matching metapackages, you need to specify an appropriate <tt>--linux-packages</tt> stub as discussed in <a href="customizing-package-installation.en.html#kernel-flavour-and-version">Kernel flavour and version</a>. As we explain in <a href="customizing-package-installation.en.html#installing-modified-or-third-party-packages">Installing modified or third-party packages</a>, it is best if you include your custom kernel packages in your own repository, though the alternatives discussed in that section work as well.
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#445" class="lnkocn">445</a></label>
|
|||
|
<p class="i0" id="445">
|
|||
|
It is beyond the scope of this document to give advice on how to customize your kernel. However, you must at least ensure your configuration satisfies these minimum requirements:
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#446" class="lnkocn">446</a></label>
|
|||
|
<ul>
|
|||
|
<li class="bullet" id="446">
|
|||
|
Use an initial ramdisk.
|
|||
|
</li>
|
|||
|
</ul>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#447" class="lnkocn">447</a></label>
|
|||
|
<ul>
|
|||
|
<li class="bullet" id="447">
|
|||
|
Include the union filesystem module (i.e. usually <tt>aufs</tt>).
|
|||
|
</li>
|
|||
|
</ul>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#448" class="lnkocn">448</a></label>
|
|||
|
<ul>
|
|||
|
<li class="bullet" id="448">
|
|||
|
Include any other filesystem modules required by your configuration (i.e. usually <tt>squashfs</tt>).
|
|||
|
</li>
|
|||
|
</ul>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#449" class="lnkocn">449</a></label>
|
|||
|
<p class="bold" id="449"><a name="449"></a> <a id="hinstalling-modified-or-third-party-packages"></a>
|
|||
|
<a name="h8.3" ></a><a name="installing-modified-or-third-party-packages" ></a>8.3 Installing modified or third-party packages
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#450" class="lnkocn">450</a></label>
|
|||
|
<p class="i0" id="450">
|
|||
|
While it is against the philosophy of a live system, it may sometimes be necessary to build a live system with modified versions of packages that are in the Debian repository. This may be to modify or support additional features, languages and branding, or even to remove elements of existing packages that are undesirable. Similarly, "third-party" packages may be used to add bespoke and/or proprietary functionality.
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#451" class="lnkocn">451</a></label>
|
|||
|
<p class="i0" id="451">
|
|||
|
This section does not cover advice regarding building or maintaining modified packages. Joachim Breitner's 'How to fork privately' method from ‹<a href="http://www.joachim-breitner.de/blog/archives/282-How-to-fork-privately.html" target="_top">http://www.joachim-breitner.de/blog/archives/282-How-to-fork-privately.html</a>› may be of interest, however. The creation of bespoke packages is covered in the Debian New Maintainers' Guide at ‹<a href="https://www.debian.org/doc/maint-guide/" target="_top">https://www.debian.org/doc/maint-guide/</a>› and elsewhere.
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#452" class="lnkocn">452</a></label>
|
|||
|
<p class="i0" id="452">
|
|||
|
There are two ways of installing modified custom packages:
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#453" class="lnkocn">453</a></label>
|
|||
|
<ul>
|
|||
|
<li class="bullet" id="453">
|
|||
|
<tt>packages.chroot</tt>
|
|||
|
</li>
|
|||
|
</ul>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#454" class="lnkocn">454</a></label>
|
|||
|
<ul>
|
|||
|
<li class="bullet" id="454">
|
|||
|
Using a custom APT repository
|
|||
|
</li>
|
|||
|
</ul>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#455" class="lnkocn">455</a></label>
|
|||
|
<p class="i0" id="455">
|
|||
|
Using <tt>packages.chroot</tt> is simpler to achieve and useful for "one-off" customizations but has a number of drawbacks, while using a custom APT repository is more time-consuming to set up.
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#456" class="lnkocn">456</a></label>
|
|||
|
<p class="bold" id="456"><a name="456"></a> <a id="hc8.3.1"></a>
|
|||
|
<a name="c8.3.1" ></a><a name="h8.3.1" ></a>8.3.1 Using <tt>packages.chroot</tt> to install custom packages
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#457" class="lnkocn">457</a></label>
|
|||
|
<p class="i0" id="457">
|
|||
|
To install a custom package, simply copy it to the <tt>config/packages.chroot/</tt> directory. Packages that are inside this directory will be automatically installed into the live system during build - you do not need to specify them elsewhere.
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#458" class="lnkocn">458</a></label>
|
|||
|
<p class="i0" id="458">
|
|||
|
Packages <b>must</b> be named in the prescribed way. One simple way to do this is to use <tt>dpkg-name</tt>.
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#459" class="lnkocn">459</a></label>
|
|||
|
<p class="i0" id="459">
|
|||
|
Using <tt>packages.chroot</tt> for installation of custom packages has disadvantages:
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#460" class="lnkocn">460</a></label>
|
|||
|
<ul>
|
|||
|
<li class="bullet" id="460">
|
|||
|
It is not possible to use secure APT.
|
|||
|
</li>
|
|||
|
</ul>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#461" class="lnkocn">461</a></label>
|
|||
|
<ul>
|
|||
|
<li class="bullet" id="461">
|
|||
|
You must install all appropriate packages in the <tt>config/packages.chroot/</tt> directory.
|
|||
|
</li>
|
|||
|
</ul>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#462" class="lnkocn">462</a></label>
|
|||
|
<ul>
|
|||
|
<li class="bullet" id="462">
|
|||
|
It does not lend itself to storing live system configurations in revision control.
|
|||
|
</li>
|
|||
|
</ul>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#463" class="lnkocn">463</a></label>
|
|||
|
<p class="bold" id="463"><a name="463"></a> <a id="hc8.3.2"></a>
|
|||
|
<a name="c8.3.2" ></a><a name="h8.3.2" ></a>8.3.2 Using an APT repository to install custom packages
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#464" class="lnkocn">464</a></label>
|
|||
|
<p class="i0" id="464">
|
|||
|
Unlike using <tt>packages.chroot</tt>, when using a custom APT repository you must ensure that you specify the packages elsewhere. See <a href="customizing-package-installation.en.html#choosing-packages-to-install">Choosing packages to install</a> for details.
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#465" class="lnkocn">465</a></label>
|
|||
|
<p class="i0" id="465">
|
|||
|
While it may seem unnecessary effort to create an APT repository to install custom packages, the infrastructure can be easily re-used at a later date to offer updates of the modified packages.
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#466" class="lnkocn">466</a></label>
|
|||
|
<p class="bold" id="466"><a name="466"></a> <a id="hc8.3.3"></a>
|
|||
|
<a name="c8.3.3" ></a><a name="h8.3.3" ></a>8.3.3 Custom packages and APT
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#467" class="lnkocn">467</a></label>
|
|||
|
<p class="i0" id="467">
|
|||
|
<i>live-build</i> uses APT to install all packages into the live system so will therefore inherit behaviours from this program. One relevant example is that (assuming a default configuration) given a package available in two different repositories with different version numbers, APT will elect to install the package with the higher version number.
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#468" class="lnkocn">468</a></label>
|
|||
|
<p class="i0" id="468">
|
|||
|
Because of this, you may wish to increment the version number in your custom packages' <tt>debian/changelog</tt> files to ensure that your modified version is installed over one in the official Debian repositories. This may also be achieved by altering the live system's APT pinning preferences - see <a href="customizing-package-installation.en.html#apt-pinning">APT pinning</a> for more information.
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#469" class="lnkocn">469</a></label>
|
|||
|
<p class="bold" id="469"><a name="469"></a> <a id="hc8.4"></a>
|
|||
|
<a name="c8.4" ></a><a name="h8.4" ></a>8.4 Configuring APT at build time
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#470" class="lnkocn">470</a></label>
|
|||
|
<p class="i0" id="470">
|
|||
|
You can configure APT through a number of options applied only at build time. (APT configuration used in the running live system may be configured in the normal way for live system contents, that is, by including the appropriate configurations through <tt>config/includes.chroot/</tt>.) For a complete list, look for options starting with <tt>apt</tt> in the <tt>lb_config</tt> man page.
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#471" class="lnkocn">471</a></label>
|
|||
|
<p class="bold" id="471"><a name="471"></a> <a id="hchoosing-apt-or-aptitude"></a>
|
|||
|
<a name="h8.4.1" ></a><a name="choosing-apt-or-aptitude" ></a>8.4.1 Choosing apt or aptitude
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#472" class="lnkocn">472</a></label>
|
|||
|
<p class="i0" id="472">
|
|||
|
You can elect to use either <i>apt</i> or <i>aptitude</i> when installing packages at build time. Which utility is used is governed by the <tt>--apt</tt> argument to <tt>lb config</tt>. Choose the method implementing the preferred behaviour for package installation, the notable difference being how missing packages are handled.
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#473" class="lnkocn">473</a></label>
|
|||
|
<ul>
|
|||
|
<li class="bullet" id="473">
|
|||
|
<tt>apt</tt>: With this method, if a missing package is specified, the package installation will fail. This is the default setting.
|
|||
|
</li>
|
|||
|
</ul>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#474" class="lnkocn">474</a></label>
|
|||
|
<ul>
|
|||
|
<li class="bullet" id="474">
|
|||
|
<tt>aptitude</tt>: With this method, if a missing package is specified, the package installation will succeed.
|
|||
|
</li>
|
|||
|
</ul>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#475" class="lnkocn">475</a></label>
|
|||
|
<p class="bold" id="475"><a name="475"></a> <a id="hc8.4.2"></a>
|
|||
|
<a name="c8.4.2" ></a><a name="h8.4.2" ></a>8.4.2 Using a proxy with APT
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#476" class="lnkocn">476</a></label>
|
|||
|
<p class="i0" id="476">
|
|||
|
One commonly required APT configuration is to deal with building an image behind a proxy. You may specify your APT proxy with the <tt>--apt-ftp-proxy</tt> or <tt>--apt-http-proxy</tt> options as needed, e.g.
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#477" class="lnkocn">477</a></label>
|
|||
|
<p class="code" id="477">
|
|||
|
$ lb config --apt-http-proxy http://proxy/<br>
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#478" class="lnkocn">478</a></label>
|
|||
|
<p class="bold" id="478"><a name="478"></a> <a id="htweaking-apt-to-save-space"></a>
|
|||
|
<a name="h8.4.3" ></a><a name="tweaking-apt-to-save-space" ></a>8.4.3 Tweaking APT to save space
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#479" class="lnkocn">479</a></label>
|
|||
|
<p class="i0" id="479">
|
|||
|
You may find yourself needing to save some space on the image medium, in which case one or the other or both of the following options may be of interest.
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#480" class="lnkocn">480</a></label>
|
|||
|
<p class="i0" id="480">
|
|||
|
If you don't want to include APT indices in the image, you can omit those with:
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#481" class="lnkocn">481</a></label>
|
|||
|
<p class="code" id="481">
|
|||
|
$ lb config --apt-indices false<br>
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#482" class="lnkocn">482</a></label>
|
|||
|
<p class="i0" id="482">
|
|||
|
This will not influence the entries in <tt>/etc/apt/sources.list</tt>, but merely whether <tt>/var/lib/apt</tt> contains the indices files or not. The tradeoff is that APT needs those indices in order to operate in the live system, so before performing <tt>apt-cache search</tt> or <tt>apt-get install</tt>, for instance, the user must <tt>apt-get update</tt> first to create those indices.
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#483" class="lnkocn">483</a></label>
|
|||
|
<p class="i0" id="483">
|
|||
|
If you find the installation of recommended packages bloats your image too much, provided you are prepared to deal with the consequences discussed below, you may disable that default option of APT with:
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#484" class="lnkocn">484</a></label>
|
|||
|
<p class="code" id="484">
|
|||
|
$ lb config --apt-recommends false<br>
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#485" class="lnkocn">485</a></label>
|
|||
|
<p class="i0" id="485">
|
|||
|
The most important consequence of turning off recommends is that <tt>live-boot</tt> and <tt>live-config</tt> themselves recommend some packages that provide important functionality used by most Live configurations, such as <tt>user-setup</tt> which <tt>live-config</tt> recommends and is used to create the live user. In all but the most exceptional circumstances you need to add back at least some of these recommends to your package lists or else your image will not work as expected, if at all. Look at the recommended packages for each of the <tt>live-*</tt> packages included in your build and if you are not certain you can omit them, add them back into your package lists.
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#486" class="lnkocn">486</a></label>
|
|||
|
<p class="i0" id="486">
|
|||
|
The more general consequence is that if you don't install recommended packages for any given package, that is, "packages that would be found together with this one in all but unusual installations" (Debian Policy Manual, section 7.2), some packages that users of your Live system actually need may be omitted. Therefore, we suggest you review the difference turning off recommends makes to your packages list (see the <tt>binary.packages</tt> file generated by <tt>lb build</tt>) and re-include in your list any missing packages that you still want installed. Alternatively, if you find you only want a small number of recommended packages left out, leave recommends enabled and set a negative APT pin priority on selected packages to prevent them from being installed, as explained in <a href="customizing-package-installation.en.html#apt-pinning">APT pinning</a>.
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#487" class="lnkocn">487</a></label>
|
|||
|
<p class="bold" id="487"><a name="487"></a> <a id="hc8.4.4"></a>
|
|||
|
<a name="c8.4.4" ></a><a name="h8.4.4" ></a>8.4.4 Passing options to apt or aptitude
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#488" class="lnkocn">488</a></label>
|
|||
|
<p class="i0" id="488">
|
|||
|
If there is not a <tt>lb config</tt> option to alter APT's behaviour in the way you need, use <tt>--apt-options</tt> or <tt>--aptitude-options</tt> to pass any options through to your configured APT tool. See the man pages for <tt>apt</tt> and <tt>aptitude</tt> for details. Note that both options have default values that you will need to retain in addition to any overrides you may provide. So, for example, suppose you have included something from <tt>snapshot.debian.org</tt> for testing purposes and want to specify <tt>Acquire::Check-Valid-Until=false</tt> to make APT happy with the stale <tt>Release</tt> file, you would do so as per the following example, appending the new option after the default value <tt>--yes</tt>:
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#489" class="lnkocn">489</a></label>
|
|||
|
<p class="code" id="489">
|
|||
|
$ lb config --apt-options "--yes -oAcquire::Check-Valid-Until=false"<br>
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#490" class="lnkocn">490</a></label>
|
|||
|
<p class="i0" id="490">
|
|||
|
Please check the man pages to fully understand these options and when to use them. This is an example only and should not be construed as advice to configure your image this way. This option would not be appropriate for, say, a final release of a live image.
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#491" class="lnkocn">491</a></label>
|
|||
|
<p class="i0" id="491">
|
|||
|
For more complicated APT configurations involving <tt>apt.conf</tt> options you might want to create a <tt>config/apt/apt.conf</tt> file instead. See also the other <tt>apt-*</tt> options for a few convenient shortcuts for frequently needed options.
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#492" class="lnkocn">492</a></label>
|
|||
|
<p class="bold" id="492"><a name="492"></a> <a id="hapt-pinning"></a>
|
|||
|
<a name="h8.4.5" ></a><a name="apt-pinning" ></a>8.4.5 APT pinning
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#493" class="lnkocn">493</a></label>
|
|||
|
<p class="i0" id="493">
|
|||
|
For background, please first read the <tt>apt_preferences(5)</tt> man page. APT pinning can be configured either for build time, or else for run time. For the former, create <tt>config/archives/*.pref</tt>, <tt>config/archives/*.pref.chroot</tt>, and <tt>config/apt/preferences</tt>. For the latter, create <tt>config/includes.chroot/etc/apt/preferences</tt>.
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#494" class="lnkocn">494</a></label>
|
|||
|
<p class="i0" id="494">
|
|||
|
Let's say you are building a <b>buster</b> live system but need all the live packages that end up in the binary image to be installed from <b>sid</b> at build time. You need to add <b>sid</b> to your APT sources and pin the live packages from it higher, but all other packages from it lower, than the default priority. Thus, only the packages you want are installed from <b>sid</b> at build time and all others are taken from the target system distribution, <b>buster</b>. The following will accomplish this:
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#495" class="lnkocn">495</a></label>
|
|||
|
<p class="code" id="495">
|
|||
|
$ echo "deb http://mirror/debian/ sid main" > config/archives/sid.list.chroot<br>
|
|||
|
$ cat >> config/archives/sid.pref.chroot << EOF<br>
|
|||
|
Package: live-*<br>
|
|||
|
Pin: release n=sid<br>
|
|||
|
Pin-Priority: 600<br><br>
|
|||
|
Package: *<br>
|
|||
|
Pin: release n=sid<br>
|
|||
|
Pin-Priority: 1<br>
|
|||
|
EOF<br>
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#496" class="lnkocn">496</a></label>
|
|||
|
<p class="i0" id="496">
|
|||
|
Negative pin priorities will prevent a package from being installed, as in the case where you do not want a package that is recommended by another package. Suppose you are building an LXDE image using <tt>task-lxde-desktop</tt> in <tt>config/package-lists/desktop.list.chroot</tt>, but don't want the user prompted to store wifi passwords in the keyring. This metapackage depends on <i>lxde-core</i>, which recommends <i>gksu</i>, which in turn recommends <i>gnome-keyring</i>. So you want to omit the recommended <i>gnome-keyring</i> package. This can be done by adding the following stanza to <tt>config/apt/preferences</tt>:
|
|||
|
</p>
|
|||
|
</div><div class="substance">
|
|||
|
<label class="ocn"><a href="#497" class="lnkocn">497</a></label>
|
|||
|
<p class="code" id="497">
|
|||
|
Package: gnome-keyring<br>
|
|||
|
Pin: version *<br>
|
|||
|
Pin-Priority: -1<br>
|
|||
|
</p>
|
|||
|
</div></div><br><div class="main_column">
|
|||
|
<table summary="segment navigation band" bgcolor="#ffffff" width="100%"><tr>
|
|||
|
<td width="70%" align="center">
|
|||
|
|
|||
|
<table summary="segment navigation available documents types: toc,doc,pdf,concordance" border="0" cellpadding="3" cellspacing="0">
|
|||
|
<tr>
|
|||
|
<td align="center" bgcolor="#ffffff">
|
|||
|
|
|||
|
|
|||
|
</tr></table>
|
|||
|
</td>
|
|||
|
<td width="5%" align="right">
|
|||
|
<table summary="segment navigation pre/next" border="0" cellpadding="3" cellspacing="0">
|
|||
|
<tr>
|
|||
|
<td align="center" bgcolor="#ffffff">
|
|||
|
<a href="customization-overview.en.html" target="_top">
|
|||
|
<img border="0" width="22" height="22" src="../../_sisu/image_sys/arrow_prev_red.png" alt="<< previous" />
|
|||
|
</a>
|
|||
|
</td>
|
|||
|
<td align="center" bgcolor="#ffffff">
|
|||
|
<a href="toc.en.html" target="_top">
|
|||
|
<img border="0" width="22" height="22" src="../../_sisu/image_sys/arrow_up_red.png" alt="toc" />
|
|||
|
</a>
|
|||
|
</td>
|
|||
|
<td align="center" bgcolor="#ffffff">
|
|||
|
<a href="customizing-contents.en.html" target="_top">
|
|||
|
<img border="0" width="22" height="22" src="../../_sisu/image_sys/arrow_next_red.png" alt="next >>" />
|
|||
|
</a>
|
|||
|
</td>
|
|||
|
<td>
|
|||
|
</td></tr>
|
|||
|
</table>
|
|||
|
</td></tr>
|
|||
|
</table>
|
|||
|
|
|||
|
</div><div class="main_column">
|
|||
|
|
|||
|
<a name="bottom" id="bottom"></a>
|
|||
|
<a name="end" id="end"></a>
|
|||
|
</div></div></body>
|
|||
|
</html>
|