Nethence Newdoc Olddoc Lab Your IP BBDock  

Warning: those guides are mostly obsolete, please have a look at the new documentation.


Debian / Ubuntu Server notes
Enable FTP on Ubuntu Server,
apt install vsftpd
cd /etc/
cp vsftpd.conf vsftpd.conf.dist
vi vsftpd.conf
systemctl restart vsftpd
Note. no need to change ftp account's shell (/bin/false), it works anyway
- network config & remote access
- apt full-upgrade + ksh screen wget lftp curl mc & screen config
During the installation for ubuntu server, make sure OpenSSH server is checked.
Get a temporary IP just to remote log in,
sudo su -
ifconfig -a
ps aux | grep dhclient
#dhclient eth0
Note. dhclient is running by default on ubuntu and ubuntu server.
Remote log in by SSH and,
sudo su -
Configure the network,
cd /etc/network/
cp interfaces interfaces.dist
vi interfaces
auto eth0
#iface eno16777984 inet static
iface eth0 inet static
address 10.0.x.x
netmask 255.255.x.0
gateway 10.0.0.X
dns-search example.local
dns-nameservers DNS1 DNS2 DNS3
Eventually disable the firewall (ubuntu srv),
ufw disable
Eventually send your SSH public key for easy root access.
Eventually install a few packages,
apt-get update
apt-cache search ksh
apt-get install \
screen \
and setup gnu screen,
cd /etc/
mv screenrc screenrc.dist
cd ~/
Eventually install the community maintained vmware tools and make sure those are enabled,
apt-get install open-vm-tools
/etc/init.d/open-vm-tools restart
note. if you get this error on Squeeze,
vmmemctlFATAL: Module vmmemctl not found.
vmsyncFATAL: Module vmsync not found.
build the modules for your running kernel,
uname -r
module-assistant auto-install open-vm -i
/etc/init.d/open-vm-tools restart
Eventually disable portmap and other services if not used.
Add a few aliases to .bashrc,
case "$-" in *i*)
alias ll='ls -alkF'
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
Fix the locales,
#dpkg-reconfigure locales
locale-gen C.UTF-8
#locale-gen en_US.UTF-8
vi /etc/default/locale
dpkg-reconfigure locales
#apt-get install language-env
vi ~/.pam_environment
Updating the system
Minor update,
apt-get update
apt-get dist-upgrade
apt-get autoremove
Upgrading the system
See what release you are running,
cat /etc/debian_version
See if you are running an x32 or x64 system,
uname -a
Check what is the default grub option for GRUB1,
catl /grub/grub.conf
cat /grub/menu.lst
cat /boot/grub/menu.lst
for GRUB2,
cat /grub/grub.cfg
Update your mirror and major release pointers,
cd /etc/apt/
#cp sources.list sources.list.lenny
vi sources.list
deb jessie main non-free contrib
or the full thing,
deb jessie main
deb-src jessie main
deb jessie-updates main
deb-src jessie-updates main
deb jessie/updates main
deb-src jessie/updates main
Note. Proceed step by step i.e. from lenny to squeeze to wheezy to jessie…
Note. for older debian release you need to point to the archives, e.g. for Lenny,
deb lenny main non-free contrib
deb-src lenny main non-free contrib
deb lenny/updates main non-free contrib
deb-src lenny/updates main non-free contrib
Other (older) examples for lenny,
deb lenny/updates main
deb-src lenny/updates main
# backports
deb lenny-backports main contrib non-free
# Security updates for "lenny"
deb lenny/updates main contrib non-free
# For Clamav: special "volatile" distrib to get regular updates
deb lenny/volatile main
deb lenny/volatile main
deb-src lenny/volatile main
# Spamassassin is in "slopply"
deb lenny/volatile-sloppy main
examples for squeeze,
# lenny to squeeze
deb squeeze main contrib
#deb-src squeeze main
deb squeeze/updates main contrib
#deb-src squeeze/updates main
deb squeeze-updates main contrib non-free
deb squeeze/updates main contrib non-free
deb squeeze main contrib non-free
deb-src squeeze main contrib non-free
and some more examples,
# stable security
deb stable/updates main contrib non-free
#deb-src stable/updates main contrib non-free
# stable volatile
deb stable/volatile main contrib non-free
#deb-src stable/volatile main contrib non-free
# stable multimedia
deb stable main non-free
#deb-src stable main non-free
Note. for java,
deb precise main
deb-src precise main
Get rid of the packages you don't want anymore,
dpkg -l | grep -i firefox
dpkg -l | grep -i mozilla
dpkg -l | grep -i xserver
dpkg -l | grep -i xorg
#apt-get remove --purge ...
#apt-get autoremove --purge
#apt-get install xauth
Then remove all packages marked as rc by dpkg,
dpkg --list |grep "^rc" | cut -d " " -f 3 | xargs dpkg --purge
Proceed with the upgrade,
apt-get update
apt-get dist-upgrade
apt-get autoremove
Note. alternate,
apt-get dist-upgrade --no-install-recommends
Note. it may be useful to register new GPG keys to the apt system,
gpg --keyserver --recv-key $key
gpg -a --export $key | apt-key add -
unset key
Ref. Debian - Apt-get : NO_PUBKEY / GPG error:
If you just switched to GRUB2,
and generally,
grub-install /dev/sda
ls -l /boot/grub/grub.cfg
#grub-mkconfig -o /boot/grub/grub.cfg
Do not forget to check the timezone configuration,
dpkg-reconfigure tzdata
Troubleshooting -- Packages
If something goes wrong during the upgrades, those may be necessary,
dpkg --configure -a
apt-get install -f
Ref. Problèmes avec les gestionnaires de paquets:
If you get this error while installing or reinstalling a package,
dpkg: error processing archive
with a weired conflict on two packages sharing the same unpacked file, then force the overwrite,
dpkg -i --force-overwrite /var/cache/apt/archives/libgdict-common_3.16.2-1_all.deb
Setup the network,
vi /etc/hostname
vi /etc/hosts
vi /etc/resolv.conf
vi /etc/network/interfaces
auto lo
iface lo inet loopback
#allow-hotplug eth0
auto eth0
#iface eth0 inet dhcp
iface eth0 inet static
address x.x.x.x
netmask 255.255.x.x
gateway x.x.x.x
dns-search example.local
dns-nameservers DNS1 DNS2
Note. if you prefer to setup resolv.conf yourself (with no dns-search and dns-nameservers entries there), you need to disable resolvconf,
systemctl status resolvconf
systemctl stop resolvconf
systemctl disable resolvconf
Enable a service at boot time e.g.,
update-rc.d apache2 defaults
#update-rc.d apache2 enable
chkconfig --list | less
Disable a service at boot time e.g.,
update-rc.d -f apache2 remove
chkconfig --list | less
Switch to init 3 by default (not editing /etc/inittab on debian),
/etc/init.d/gdm stop
update-rc.d -f gdm remove
service lightdm status
update-rc.d -f lightdm remove
Misc -- Packages
To find what package name by file e.g.,
apt-get install apt-file
apt-file update
apt-file search /usr/lib/apache2/modules/
List package content,
dpkg -L package_name 
List package's dependencies,
apt-cache rdepends unity
apt-cache showpkg lightdm
if it is a binary package file,
dpkg -I package.deb
I had this log spam error on an old P2Ved Lenny (not sure it's really related to the P2V anyway),
hdc: drive not ready for command
==> upgraded to Squeeze, and replace by open-vm-tools (contrib) did the trick

(obsolete, see the new doc)