These are various common commands I've pulled together as useful in day to day Debian server management.
To mount a CD:
mount -t iso9660 dev/hdc /cdrom
Debian Upgrades
For simple package refresh, use the following two commands:
apt-get update
apt-get upgrade
The 'apt-file' command allows you to look for
packages to install. You'll need to do an 'apt-file update' first in order to obtain the
package listings.
When performing a major upgrade, use:
apt-get dist-upgrade
If the process generates an error and aborts, the following
command may get things going again:
apt-get -f install
Other useful commands:
apt-get clean - clears cache of downloaded packages
dpkg --purge
apt-get check
At some point during future upgrades, you may encounter an error like:
GPG error: ftp://ftp.us.debian.org/ testing Release: The following signatures couldn't
be verified because the public key is not available: NO_PUBKEY ......
In this case, running the following may solve the problem:
apt-get install debian-archive-keyring
Administrative References
Images with GUI
On some Debian installations, the GUI may be installed. On the one I encountered when I
performed an update, I have to perform the following steps to get the GUI running after a
reboot:
- log in to the machine via ssh
- run 'vncserver' and identify the display number it shows
- on your local machine, run the vnc viewer and connect to the servername:1 (1 is typically used)
- upon connection, you may have a graphical window with terminal mode... type the command 'startkde &' to get the full GUI functional
- once the GUI is started, VMWare Workstation can be started, and any necessary sessions can be started after
Logical Volume Manager
Commands to show logical volume system:
lvm
lvdisplay
vgdisplay
pvdisplay
Command to create volume:
lvcreate --size 16m --snapshot --name snapBase /dev/vg01/lvBase
mkdir /mnt/snap
mount /dev/vg01/lvBase /mnt/snap
Commands to remove volume:
umount /dev/vg01/lvBase
lvremove /dev/vg01/snapBase