Penguin
Annotated edit history of DebianNotes version 39, including all changes. View license author blame.
Rev Author # Line
27 SkliaroukArieh 1 !!! Package-related Notes
37 IanMcDonald 2
27 SkliaroukArieh 3 !! Rate-limiting apt-get
4
5 If you live in NewZealand, you might be interested in rate-limiting downloads thanks to terrible queuing and rate-limiting on many [ADSL] services.
6
7 apt-get(8) uses its own built-in code for retrieving packages via [HTTP] or [FTP], instead of relying on an external program like wget(1), and doesn't offer any rate-limiting options. There are two main ways to throttle its bandwidth consumption anyway:
8
9 * Set up a WebProxy on your [LAN] which throttles downloads, and configure [APT] to use it, either via <tt>/etc/apt/apt.conf.d</tt> settings or with the <tt>http_proxy</tt> or <tt>ftp_proxy</tt> [EnvironmentVariable]s.
10 * Install the trickle(1) package, which can rate-limit most UserSpace socket connections.
11
12 The second route is much easier, but note that using trickle(1) will also __rate-limit any child processes__ spawned by your command -- if [APT] restarts any daemons, they will be rate-limited! You should therefor do two separate passes with apt-get(8): a trickle(1)-controlled one to download packages, and a separate one without trickle(1) to install the downloaded packages. You can do this with a command such as
13
14 <verbatim>
15 trickle -d $KBPS apt-get --download-only upgrade && apt-get upgrade
16 </verbatim>
17
18 You may also use trickle only in the http and ftp file retrieval "plug-ins" of apt. For the http method :
19 <verbatim>
20 dpkg-divert --local --rename /usr/lib/apt/methods/http
21 echo '#!/bin/sh' > /usr/lib/apt/methods/http
22 echo '/usr/bin/trickle -s -d 10 /usr/lib/apt/methods/http.distrib' >> /usr/lib/apt/methods/http
23 chmod 755 /usr/lib/apt/methods/http
24 </verbatim>
25 Do the same for the ftp method. The "-d 10" sets a ratelimit of 10KB/s. You may want to take out the -s/-d switches and configure trickled.
26
27 !! dpkg doesn't ask me questions any more?
28
29 You have configured debconf not to ask questions, possibly after an AutoInstall. You can fix this using the following command:
30
31 <verbatim>
32 dpkg-reconfigure --frontend=dialog --priority=low debconf
33 </verbatim>
34
35 !! Excluding a particular package from automatic upgrades
36
37 Put the package on hold, like so:
38
39 <pre>
40 echo "''packagename'' hold" | dpkg --set-selections
41 </pre>
42
43
44 !! How to get back lost files from your packages
45
46 <verbatim>
47 cd /var/lib/dpkg/info/
48 for PKG in *.list ; do
49 while read FILE ; do
28 MattBrown 50 [ -r "$FILE" ] && continue
27 SkliaroukArieh 51 echo "${PKG%%.list}"
52 break
53 done < "$PKG"
54 done \
28 MattBrown 55 | xargs apt-get -y install --reinstall
27 SkliaroukArieh 56 </verbatim>
57
58 It will look at your installed packages to see what files should be installed, then reinstall any packages for which files are missing.
59
60 !! Reinstalling all packages on a system
61
62 <verbatim>
63 dpkg --get-selections | awk '$2 == "install" { print $1 }' | xargs apt-get -y --reinstall install
36 CraigBox 64 </verbatim>
65
66 !! Removing all packages marked as 'deinstall'
67
68 <verbatim>
69 dpkg --get-selections | grep deinstall | cut -f1 | xargs dpkg --purge
27 SkliaroukArieh 70 </verbatim>
71
72 !! Irritations using dpkg -l '*glob*'
73
74 The <tt>COLUMNS</tt> EnvironmentVariable controls the width of dpkg(1)'s output, and thus how much of the package names gets chopped off. Note its behaviour differs depending on whether stdout is a terminal or not. Eg.:
75
76 <verbatim>
77 COLUMNS=160 dpkg -l 'lib*' | awk '{print $1,$2}'
78 </verbatim>
79
80 !! Some other people's notes on dealing with DebianLinux
81
82 While the following page has some good tips, it seems to have been written by someone who not only thought that they should be able to instantly know every nuance of a piece of software without reading a manual or anything like that, but needed to take a few CTFD pills before writing this page. That said, it's mildly amusing and has a few good points.
83
84 http://www.miketaylor.org.uk/tech/wxinmfpl/debian.html
85
86 The main cause of this person's problems was mixing packages from stable and testing. One of the best features about DebianLinux is that (in stable, at least) the debian packages work very well with the other packages in the distribution. They've been tested lots, and spent a lot of time having only bug-fixes applied. With Testing or Unstable, it is likely that the developers and users building and using packages are using packages from the same repository. Often packages from testing may not work very well with an older library from stable, but the package doesn't have the required dependency on a newer version, simply because the DebianLinux maintainer doesn't know that the program misbehaves. If someone reports it as a bug, then the package will probably get the required dependency. But if very few people mix-n-match packages from stable and testing, all these little problems won't be discovered and resolved.
87
88 Moral: if you use testing or unstable, don't keep old versions of packages around while only upgrading some of them.
89
90 !! Downgrading from unstable to stable
91
92 This is not a process to be taken lightly. It will probably be faster, safer and easier to just do a complete reinstall.
93
94 Steps:
95 # Backup the system
96 # Uninstall all unnecessary packages ([Apache], [KDE], [GNOME], etc)
97 # Get a copy of a statically linked bash(1) and put it in <tt>/bin/</tt> somewhere
98 # Edit <tt>/etc/debian_version</tt> to the version you want
99 # Edit <tt>/etc/apt/sources.list</tt> to the version you want
100 # Issue <tt>apt-get --reinstall install binutils</tt> which will reinstall and pretty much everything
101
102 You may find yourself in a situation which you have an old linker that won't let you uninstall a relatively new libc6. The solution to this problem is to reverse the changes in <tt>/etc/apt/sources.list</tt>, get a new linker, get an old libc6, then get an old linker.
31 MichaelJager 103
104 !! Reconfiguring the bootloader automagically after kernel package install/remove
105
106 If you use kernel packages, you can configure the machine to run a postinstall/postremove script. This is normally taken care of during system install time (if you install a machine with [GRUB], then update-grub is run after kernel install/remove), but if you change bootloaders, it may not be.
107
108 Look in /etc/kernel-img.conf (create it if it doesn't exist), and set the postinst_hook and postrm_hook values accordingly.
109 <verbatim>
110 postinst_hook=/sbin/update-grub
111 postrm_hook=/sbin/update-grub
112 </verbatim>
32 CraigBox 113
114 !! Compiling debs for modules
115
116 If you run 'make-kpkg modules_image', make-kpkg(1) will go through /usr/src/modules and build modules .debs for all the subdirectories of Debian-build-able modules you have in there.
27 SkliaroukArieh 117
118 !!! Miscellaneous Notes
119
120 !! Setting up two [NIC]s to bridge
121
122 Assuming you have the appropriate tools installed (bridge-utils), you just need to add a stanza like the following to <tt>/etc/network/interfaces</tt>:
123
124 <verbatim>
125 auto br0
126 iface br0 inet static
127 address 10.66.100.1
128 netmask 255.255.255.0
129 gateway 10.66.100.254
130 bridge-ports eth0 eth1
131 </verbatim>
132
133 Note that you should __not__ have a separate stanza for <tt>eth0</tt> and <tt>eth1</tt>.
39 BenStaz 134
135 !!How on earth do I create extended partitions when using the Debian installer?
136
137 If you create logical partitions then a extended partition will be automatically created to house it. Don't worry! :)
138
139
30 AlastairPorter 140
141 !! I installed >1gb of ram but it doesn't show up
142
34 JohnMcPherson 143 The default debian 386 kernel package doesn't have bigmem support. Try installing a more specific image, eg 686 (in the '<tt>kernel-image-2.6-686</tt>' package).
33 CraigBox 144
145 !! The installer can't see my $new_device
146
147 Kenshi Muto has built [a Sarge debian-installer CD based on the 2.6.15 kernel|http://kmuto.jp/b.cgi/debian/d-i-2615.htm]. It might be what you need. Otherwise, install onto an IDE disk and move your installation.
29 MattBrown 148
149 !!! Debian Books
150
151 There are several books available to teach you about Debian.
152
153 * [Debian GNU/Linux 3.1 Bible|ISBN:0764576445]
154 * [The Debian System: Concepts and Techniques|ISBN:1593270690]
35 CraigBox 155
156 !!! Other pages
157
158 In addition to this page, you should also take a look at
159
160 * DebianPackageTools
161 * AptSourcesList
162 * apt-move(8) -- a tool for moving your <tt>/var/cache/apt/archives</tt> into your very own Debian mirror
163 * [AutoInstall] -- Progeny's rather broken solution for automatically installing [Debian]
29 MattBrown 164
27 SkliaroukArieh 165 ----
166 CategoryDebian

PHP Warning

lib/blame.php:177: Warning: Invalid argument supplied for foreach() (...repeated 3 times)