Basic Linux Admin Tasks (Debian/Ubuntu)
How do I...
Become root?
Best way is to log in as yourself and type "sudo -s". (Or "sudo tcsh" or some other shell of your choice.) It'll ask for a password, use your regular login password. If that still doesn't work, contact your supervisor or group's CSCF Research Point of Contact.
See if a package is installed?
Try:
dpkg -l "*PKGNAME*"
(that's a lower case L option, not the digit One)
Install a piece of software?
Best way is to become root, then run
apt-get update
to update the list of possible packages. After, you can search for Debian package names with
apt-cache search foo
. Once you have a package name, try
apt-get install packagename
.
Install a package from source, the Debian/Ubuntu way?
Sometimes, you want to hand-compile a package yourself instead of using the existing .deb package. apt-get can help. As root, run
apt-get build-dep [packagename]
You will receive all of the dependencies with their source code. You may then download the source from your preferred location and customize it. An example:
# apt-get build-dep f-spot
Reading package lists... Done
Building dependency tree... Done
The following packages will be REMOVED:
liblinc-dev
The following NEW packages will be installed:
build-essential cdbs cli-common dpatch g++ g++-4.0 libbonobo2-dev
libbonoboui2-dev libexif-dev libgconf2-dev libgnome-keyring-dev
libgnome2-dev libgnomecanvas2-dev libgnomeui-dev libgnomevfs2-dev
libgphoto2-2-dev libidl-dev libmono-dev liborbit2-dev libsqlite0-dev
libstdc++6-4.0-dev mono-mcs mono-utils
0 upgraded, 23 newly installed, 1 to remove and 98 not upgraded.
Need to get 10.5MB of archives.
[...]
To use the standard debian/ubuntu source for this package:
# cd /usr/src
# wget [package source url] # or:
# apt-get source [package-name] # ...and follow the normal source building process
[...]
Update my install?
Try
apt-get update
followed by
apt-get upgrade
to upgrade currently installed packages.
If you want to get all of the recommended packages for a complete distribution upgrade, do
apt-get dist-upgrade
or
apt-get -f dist-upgrade
to fix any dependency problems.
Find out what package "owns" a file?
Do
dpkg -S /path/to/file
.
Use a CD for Package updating?
- you need a debian packages CD
- as root:
apt-cdrom add
apt-get update
apt-get [upgrade|install|dist-upgrade]
What should my =/etc/apt/sources.list file look like?
If your question isn't answered here, try
DebianHowTo or
HowToQuestions.