This is an old revision of the document!
netselect-apt can do this:
netselect-apt -n -s
will benchmark Debian mirrors and generate sources.list containing the fastest stable mirror, including non-free packages and source packages. This file can then overwrite /etc/apt/sources.list to become the default source for Debian packages.
First use ar:
ar vx *.deb
which will generate the following files:
x - debian-binary x - control.tar.gz x - data.tar.lzma
lzma may be gz, in which case, use tar -xpvf data.tar.gz to proceed further. Otherwise, in case it is compressed using lzma:
tar --lzma -xpvf file.tar.lama
Useful, for example, while manually recompiling a source package:
aptitude [hold|unhold] package
in order to avoid it being overwritten by a binary package.
In order to do this the Debian way, download the source and configure the kernel. The current kernel source for the installed Debian distribution can be fetched with:
aptitude install linux-source kernel-package
along with kernel-package which gives us the tools to compile the kernel.
which will download the current kernel source and place it in /usr/src/linux-source-*.tar.bz2 depending on the version of the kernel. The next step is to unarchive the source:
cd /usr/src/ tar -jxpvf linux-source-*.tar.bz2
To configure the kernel for compilation, first copy the current kernel configuration from /boot/config-* depending on the version of the kernel to /usr/src/linux-source-*. This will give you the basis from which to start:
cp /boot/config-* /usr/src/linux-source-*/.config
then we change the directory to /usr/src/linux-source-* and use make menuconfig:
cd /usr/src/linux-source-* make menuconfig
After configuring, we issue:
make-kpkg --initrd kernel_image
which places the deb files in the immediately superior directory. To install the image, issue:
cd .. dpkg -i linux-image-2.6.32.Custom_amd64.deb
depending what version of the kernel has been compiled.
For example, to determine what Debian package /etc/samba/smb.conf belongs to, issue:
dpkg -S /etc/samba/smb.conf
First install dh-make-perl and update apt-file:
aptitude install dh-make-perl apt-file update
Then install packages with:
dh-make-perl --build --cpan Desired::CPAN::Module
Filesystem repairs on boot can hang the machine if the filesystem was not cleanly unmounted. By editing /etc/default/rcS and setting:
# automatically repair filesystems with inconsistencies during boot FSCKFIX=yes
will allow the server to automatically repair the filesystem on boot.
In order to install packages from other releases, first add the repository to /etc/apt/sources:
deb http://ftp.ua.debian.org/debian/debian/ squeeze main deb-src http://ftp.ua.debian.org/debian/ squeeze main
Then edit /etc/apt/apt.conf and set the default release to stable:
APT::Default-release "stable";
Now, to install the package libace-dev from squeeze, the syntax is:
aptitude install libace-dev/squeeze
Backports are useful when you want a new package from the unstable branch. A good use for them is for example a newer kernel that supports features you may need. The procedure consists in:
/etc/apt/sources.list in order to add:deb http://MIRROR.debian.org/debian wheezy-backports main
aptitude update to pick-up the changes.aptitude -t wheezy-backports install linux-image-amd64
grub can boot an ISO file using the grml-rescueboot package. First install the grml-rescueboot package:
aptitude install grml-rescueboot
and then place the ISO file in /boot/grml/:
cp rescue.iso /boot/grml
Finally update grub using the update-grub command:
update-grub
Once the system restarts you will have a new option to boot from the ISO file.
aptitude install module-assistant xtables-addons-source module-assistant prepare module-assistant auto-install xtables-addons-source depmod -a
To change the time-zone, the Debian way, issue:
dpkg-reconfigure tzdata
The following command will list all packages that were not installed automatically (for example, as a dependency of some other package):
aptitude search ~i | grep -v "i A" | cut -d " " -f 4
As root, execute:
cp /usr/share/doc/util-linux/examples/fstrim.{service,timer} /etc/systemd/system systemctl enable fstrim.timer
which will schedule a TRIM operation on all SSDs every week.
To enable IPX networking in Debian you should first follow the tutorial on installing unstable packages because the ipx package providing the ipx_interface command is (at the time of writing) available in the oldstable branch of Debian.
Next, to set-up the network, edit the configuration file /etc/network/interfaces. In that file you will find your LAN interface (either a bridge or an ethernet device), or the interface you want to enable IPX on. For example:
# The primary network interface
auto br0
iface br0 inet static
bridge_ports eth0
bridge_stp off
bridge_maxwait 0
bridge_fd 0
address 192.168.1.1
broadcast 192.168.1.255
netmask 255.255.255.0
After that you can add the IPX network:
iface br0 ipx static
frame 802.2
netnum AABBCCDD
where AABBCCDD is the IPX network number represented in hex (excluding 00000000 and FFFFFFFF which are reserved).
An interesting idea would be to set the network number by transforming the TCP/IP address into hexadecimal, for example for 192.168.1.1 we would replace AABBCCDD with C0A80101.
In case you are trying to install packages from HTTPs repositories, you may encounter the error message:
E: The method driver /usr/lib/apt/methods/https could not be found.
In order to resolve the issues, the following packages can be installed:
aptitude install apt-transport-https ca-certificates
such that Debian will accept package repositories that have to be fetched through HTTPs.
To add modules to be loaded by initd, install initramfs-tools:
aptitude install initramfs-tools
and then edit /etc/initramfs-tools/modules and add the module name to the list.
Finally, issue:
update-initramfs -k all -u
to update the initrd image.
On Debian, the default snakeoil certificates at /etc/ssl/certs/ssl-cert-snakeoil* can be regenerated with the command:
make-ssl-cert generate-default-snakeoil --force-overwrite
When compiling packages on Debian that use libraries that are not managed by the Debian package system the following error may appear at the end of the build process: dpkg-shlibdeps: error: no dependency information found followed by the library you are compiling against.
In order to ignore missing library information, add the following snippet:
override_dh_shlibdeps:
dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info
to rules/debian.
Note that the spaces before dh_shlibdeps is actually a tab!
Additionally, you can issue:
export DEB_DH_SHLIBDEPS_ARGS_ALL=--dpkg-shlibdeps-params=--ignore-missing-info
before compiling.
If you want to install the Intel Compiler (icc) on Debian, the 32-bit version libraries are required. To install them, issue:
dpkg --add-architecture i386 aptitude update aptitude install gcc-multilib libstdc++6:i386 libgcc1:i386
After editing /etc/crypttab, issue:
systemctl daemon-reload systemctl restart cryptsetup.target
followed by:
mount -a
to remount all encrypted drives.
The following line, when executed inside a package directory tree, will generate the DEBIAN/md5sums file.
md5sum $(find * -type f -not -path 'DEBIAN/*') >DEBIAN/md5sums
The following command will reinstall a package along with all its dependencies and additionally create any new configuration files:
apt-cache depends PACKAGE | grep '[ |]Depends: [^<]' | cut -d: -f2 | tr -d ' ' | xargs apt install --reinstall -o Dpkg::Options::="--force-confask,confnew,confmiss" -y
where:
PACKAGE is a debian package.For the contact, copyright, license, warranty and privacy terms for the usage of this website please see the contact, license, privacy, copyright.