Formatting code for LinuxDebian
{{parent page="Linux"}}
===Debian quick installation tips===
==query version==
%%
lsb_release -a
%%
==Network configuration files==
One can config the network interfaces by editing the file /etc/network/interfaces. here's a sample file:
%%
# The loopback network interface
auto lo eth1 eth2 eth1:0
iface lo inet loopback
# The primary network interface
allow-hotplug eth1
iface eth1 inet static
address 1.2.3.4
netmask 255.255.255.0
network 1.2.3.0
broadcast 1.2.3.255
gateway 1.2.3.254
dns-nameservers 1.2.3.1
dns-search mydomain.com
up route add -net 192.168.2.0 netmask 255.255.255.0 gw 1.2.3.253
down route del -net 192.168.2.0 netmask 255.255.255.0 gw 1.2.3.253
iface eth1:0
address 1.2.3.5
netmask 255.255.248.0
iface eth2 inet static
address 192.168.33.137
netmask 255.255.248.0
%%
After editing the file, bring up the interface with the standard command **ifup -a**
===hostname===
edit /etc/hostname
==NIC bonding==
%%
aptitude install ifenslave
%%
Next, add these to /etc/modules.d/alias
%%
alias bond0 bonding
options bonding mode=6 miimon=100
%%
Then configure the interface via /etc/network/interfaces
%%
auto lo bond0 eth0 eth1
# bonded interface
iface bond0 inet static
slaves eth0 eth1
pre-up modprobe bond0
address 192.168.18.13
netmask 255.255.255.0
network 192.168.18.0
broadcast 192.168.18.255
gateway 192.168.18.1
dns-nameservers 1.2.3.4
dns-search domain.tld
up ifenslave bond0 eth0 eth1
down ifenslave -d bond0 eth0 eth1
iface bond0:0 inet static
address 192.168.18.11
netmask 255.255.255.255
# these prevents networkmanager from messing with you
iface eth0 inet manual
iface eth1 inet manual
%%
==Network updates==
On can update the Debian packages using apt-get. Before using it, one must first supply the server to retrieve updates. Edit the file **/etc/apt/sources.list**
%%
deb http://smarden.org/pape/Debian/ sarge unofficial
deb-src http://smarden.org/pape/Debian/ sarge unofficial
deb http://http.us.debian.org/debian stable main contrib non-free
deb http://non-us.debian.org/debian-non-US stable/non-US main contrib non-free
%%
To get a closer mirror, find one from http://www.debian.org/mirror/mirrors_full
Then run
%%(bash)
aptitude update
aptitude dist-upgrade
%%
Then you can use apt-get as usual. For example, **apt-get install openssh-server**
===Debian dist upgrade===
http://www.debian.org/releases/stable/i386/release-notes/ch-upgrading.en.html
%%
# apt-get upgrade
# apt-get dist-upgrade
# apt-get update
# apt-get -t stable upgrade
# apt-get -t stable dist-upgrade
%%
===Debian rc update===
%%
update-rc.d -f gdm remove
update-rc.d atftpd defaults
invoke-rc.d dhcp3-server restart
%%
===Debian and hpacucli===
%%
aptitude install libstdc++6-dev libstdc++2.10-dev
%%
===Debian quick installation tips===
==query version==
%%
lsb_release -a
%%
==Network configuration files==
One can config the network interfaces by editing the file /etc/network/interfaces. here's a sample file:
%%
# The loopback network interface
auto lo eth1 eth2 eth1:0
iface lo inet loopback
# The primary network interface
allow-hotplug eth1
iface eth1 inet static
address 1.2.3.4
netmask 255.255.255.0
network 1.2.3.0
broadcast 1.2.3.255
gateway 1.2.3.254
dns-nameservers 1.2.3.1
dns-search mydomain.com
up route add -net 192.168.2.0 netmask 255.255.255.0 gw 1.2.3.253
down route del -net 192.168.2.0 netmask 255.255.255.0 gw 1.2.3.253
iface eth1:0
address 1.2.3.5
netmask 255.255.248.0
iface eth2 inet static
address 192.168.33.137
netmask 255.255.248.0
%%
After editing the file, bring up the interface with the standard command **ifup -a**
===hostname===
edit /etc/hostname
==NIC bonding==
%%
aptitude install ifenslave
%%
Next, add these to /etc/modules.d/alias
%%
alias bond0 bonding
options bonding mode=6 miimon=100
%%
Then configure the interface via /etc/network/interfaces
%%
auto lo bond0 eth0 eth1
# bonded interface
iface bond0 inet static
slaves eth0 eth1
pre-up modprobe bond0
address 192.168.18.13
netmask 255.255.255.0
network 192.168.18.0
broadcast 192.168.18.255
gateway 192.168.18.1
dns-nameservers 1.2.3.4
dns-search domain.tld
up ifenslave bond0 eth0 eth1
down ifenslave -d bond0 eth0 eth1
iface bond0:0 inet static
address 192.168.18.11
netmask 255.255.255.255
# these prevents networkmanager from messing with you
iface eth0 inet manual
iface eth1 inet manual
%%
==Network updates==
On can update the Debian packages using apt-get. Before using it, one must first supply the server to retrieve updates. Edit the file **/etc/apt/sources.list**
%%
deb http://smarden.org/pape/Debian/ sarge unofficial
deb-src http://smarden.org/pape/Debian/ sarge unofficial
deb http://http.us.debian.org/debian stable main contrib non-free
deb http://non-us.debian.org/debian-non-US stable/non-US main contrib non-free
%%
To get a closer mirror, find one from http://www.debian.org/mirror/mirrors_full
Then run
%%(bash)
aptitude update
aptitude dist-upgrade
%%
Then you can use apt-get as usual. For example, **apt-get install openssh-server**
===Debian dist upgrade===
http://www.debian.org/releases/stable/i386/release-notes/ch-upgrading.en.html
%%
# apt-get upgrade
# apt-get dist-upgrade
# apt-get update
# apt-get -t stable upgrade
# apt-get -t stable dist-upgrade
%%
===Debian rc update===
%%
update-rc.d -f gdm remove
update-rc.d atftpd defaults
invoke-rc.d dhcp3-server restart
%%
===Debian and hpacucli===
%%
aptitude install libstdc++6-dev libstdc++2.10-dev
%%