Debian packages – list and install on another server.

To list all currently installed packages, type “dpkg –get-selections”. You can save this data to a file by running “dpkg --get-selections > ~/packages.txt“.
And then place this file on another system and install the listed packages by running “cat packages.txt > sudo dpkg --set-selections && sudo apt-get dselect-upgrade“.
Also, the list of packages can be loaded for installation by running “dpkg --clear-selections && sudo dpkg --set-selections < packages.txt".
This could be used also for recovery. This trick is helpful when a system must be reinstalled, then all of the same packages can be installed all at once.
Sometimes, the output of "dpkg --get-selections" may list packages marked to be uninstalled or some other status. If so happens, use the following "dpkg --get-selections | grep -w install$ > ~/packages.txt". I mean, "| grep -w install$"

Installing Guest Additions on Debian

Follow these steps to install the Guest Additions on your Debian virtual machine:

1. The APT package index is essentially a database of available packages from the repositories defined in the /etc/apt/sources.list file and in the /etc/apt/sources.list.d directory. To update the local package index with the latest changes made in the repositories, type the following: apt-get update and the install the latest security updates, over time, updated versions of packages currently installed on your computer may become available from the package repositories (for example security updates). To upgrade your system, first update your package index as outlined above, and then type: apt-get upgrade
2. Install required packages: apt-get install build-essential module-assistant;
3. Configure your system for building kernel modules by running m-a prepare;
4. And run as root: sh /media/cdrom/ and follow the instructions on screen.

authz_core:error – client denied by server configuration: /var/lib/roundcube/

From logs:

[Tue May 05 10:01:46.317409 2015] [authz_core:error] [pid 5837] [client] AH01630: client denied by server configuration: /var/lib/roundcube/

From browser:

You don’t have permission to access / on this server.

To enable roundcube on Debian 8 after an upgrade add the following “Require all granted” to a virtual host configuration file:

<Directory /var/lib/roundcube/>
Options +FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
Require all granted

Continue reading “authz_core:error – client denied by server configuration: /var/lib/roundcube/”

OpenVPN and OpenVZ tun issue.

After the upgrade Debian 7 to Debian 8 on OpenVZ platform on OVH the OpenVPN service stopped working. The problem was that the “TUN” device was missing, so the command below will temporary fix this problem.

root# mkdir -p /dev/net
root# mknod /dev/net/tun c 10 200
root# chmod 600 /dev/net/tun

Also you can add this to a script at start up.

Kernel – Install and Compile in Debian Linux

To get started, we are going to need some packages, namely fakeroot and kernel-package:

root# apt-get install fakeroot kernel-package

Now, lets take a latest source tarball from or you may use following wget command to download it.

root# wget -c

Now, let’s unpack the archive.

root# tar -xvJf linux-3.2.58.tar.xz

After, extracting, a new kernel source directory will be created.

root# cd linux-3.2.58

Now, we will want to configure the kernel. It is best to start with a configuration that you are currently using and work from there. To do this, we will copy the current configuration from the /boot directory to the current working directory and save it as .config.

root# cp /boot/config-3.2.0-4-amd64 ./.config

Now we can configure the kernel:

root# make menuconfig

Once that is done, it is time to clean the source tree.

root# make-kpkg clean

Finally, it’s time to build the kernel package.

root# export CONCURRENCY_LEVEL=3
root# fakeroot make-kpkg --append-to-version "-customkernelname" --revision "1" --initrd kernel_image kernel_headers

Debian 7.0 was released May 4th, 2013.

May 4th, 2013

After many months of constant development, the Debian project is proud to present its new stable version 7.0 (code name “Wheezy”).
This new version of Debian includes various interesting features such as multiarch support, several specific tools to deploy private clouds, an improved installer, and a complete set of multimedia codecs and front-ends which remove the need for third-party repositories.

Multiarch support, one of the main release goals for “Wheezy”, will allow Debian users to install packages from multiple architectures on the same machine. This means that you can now, for the first time, install both 32- and 64-bit software on the same machine and have all the relevant dependencies correctly resolved, automatically.

The installation process has been greatly improved: Debian can now be installed using software speech, above all by visually impaired people who do not use a Braille device. Thanks to the combined efforts of a huge number of translators, the installation system is available in 73 languages, and more than a dozen of them are available for speech synthesis too.
In addition, for the first time, Debian supports installation and booting using UEFI for new 64-bit PCs (amd64), although there is no support for “Secure Boot” yet.

Debian is a free operating system, developed by thousands of volunteers from all over the world who collaborate via the Internet. The Debian project’s key strengths are its volunteer base, its dedication to the Debian Social Contract and Free Software, and its commitment to provide the best operating system possible. Debian 7.0 is another important step in that direction.

The code name for the next major Debian release after wheezy is “jessie”.

This release started as a copy of wheezy, and is currently in a state called “testing”. That means that things should not break as badly as in unstable or experimental distributions, because packages are allowed to enter this distribution only after a certain period of time has passed, and when they don’t have any release-critical bugs filed against them.

Well now, my servers have been updated to “wheezy” πŸ˜€

Disable the system beep during the shutdown -h +time.

To disable the system beep during the shutdown -h +time, sysfinit has to be downloaded into your machine.

apt-get source sysvinit
vim sysvinit-2.88dsf/src/shutdown.c

then find a “void warn(int mins)” function and there change

wall(buf, 0); to /*wall(buf, 0);*/

then run ./configure make etc. or make a package. Also you can use this:

rmmod pcspeaker

Surely there is another way to off the beep which I do not know πŸ˜‰

Desktop doesn't remember brightness settings after a reboot.

Every time I reboot my laptop the brightness goes back to 100% in Gnome. I wish it would keep the last one setting. Here is a quick workaround for that:-) edit the /etc/rc.local file by typing: vim /etc/rc.local and add the following line:
echo 5 > /sys/class/backlight/acpi_video0/brightness

It looks like this:
root@ProBook:~# cat /sys/class/backlight/acpi_video0/brightness
root@ProBook:~# echo 5 > /sys/class/backlight/acpi_video0/brightness
root@ProBook:~# vim /etc/rc.local
root@ProBook:~# cat /etc/rc.local
#!/bin/sh -e
# rc.local
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
# In order to enable or disable this script just change the execution
# bits.
# By default this script does nothing.
echo 12 > /sys/class/backlight/acpi_video0/brightness

exit 0

After the reboot the Gnome keeps our settings πŸ™‚