Just about all of the linux systems that I work on are a RedHat variant (Scientific Linux or Centos). But in the past few years, more people have been using Ubuntu, so I need to become familiar with it. And yesterday, I had to set up a system to help someone troubleshoot a board that we built. So here are some things about Ubuntu that I’ve learned recently. And just about all of this stuff is done using the command line because that’s how I prefer to work.

Ubuntu doesn’t let you su – to root. Instead it requires you to sudo before commands that you’d run as root. I personally find this annoying, but so be it.

To change the hostname, edit
/etc/hosts
/etc/hostname

To change a network interface to a static ip, edit:
/etc/network/interfaces
If you want to change eth0 to be static, add a section like:

auto eth0
iface eth0 inet static
address 192.168.1.10
netmask 255.255.255.0
network 192.168.1.0
gateway 192.168.1.1
dns-nameservers 192.168.23.50 192.168.25.50
dns-search example.com

Note that if you edit /etc/resolv.conf directly, it will get rewritten on reboot with the values here.

To install packages, use apt-get:
sudo apt-get install gnuplot

To update packages, use:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade

To list packages installed, use:
dpkg -l (can use with grep to find particular packages)

To find a package (where you know the name):

me@alpha:~$ apt-cache search gawk
gawk - GNU awk, a pattern scanning and processing language
mawk - a pattern scanning and text processing language
dpkg-awk - Gawk script to parse /var/lib/dpkg/{status,available} and Packages
gawk-doc - Documentation for GNU awk
skktools - SKK dictionary maintenance tools

apt-cache search . –will list all packages

==Notes about getting the ubuntu client in our ldap domain

For NFS,
$ sudo apt-get install libnfs-dev nfs-common
(NFS mounts files as expected)

== The following stuff didn’t work and I didn’t have time to investigate further.

To try to join our ldap domain, try
$ sudo apt-get install ldap-utils libpam-ldap libnss-ldap nslcd
/etc/ldap$ sudo mkdir cacerts
$ sudo auth-client-config -t nss -p lac_ldap
$ sudo pam-auth-update

$ sudo pam-auth-update
$ sudo /etc/init.d/nscd restart

  • Restarting Name Service Cache Daemon nscd