SL to Ubuntu Cheat Sheet

On Ubuntu and Debian, some logs and other files are in different places from what you're used to in SL, and some commands are quite different. Here's a quick guide for the bewildered. Please add to it. If you do, you can get as detailed as you like but please start simple. Thanks!

See also

Your shell PATH

Our PATH variable is still set by pathfix (via the setpath command) but on Ubuntu the path you get is now a lot simpler. The minimum you'll get is just /usr/bin. If you have a $HOME/bin directory, that'll get added too. If you want anything else in your path - for example /usr/sbin - then add it using a setpath command in your ~/.benv file like this:
setpath /usr/sbin 
You may find several other directories in your PATH - they're being added by bits of the shell environment we haven't yet tracked down. If you spot anything wrong there, let the Ubuntu team know please.

Elevating privilege, etc.

SL Ubuntu
nsu ksu
ksu ksu

That's right! There is no nsu on Ubuntu! This is deliberate. Get used to ksu. To become root on Ubuntu you can simply type ksu but there are other forms too - here's a reminder:

ksu
or
ksu root -n uun/root
Get superuser privilege
ksu . -n uun/root Get access to admin stuff

Alternatively, on your own machine you could use the sudo component to give yourself sudo access, if you wanted.

LCFG directories

SL Ubuntu
/var/lcfg/log /var/log/lcfg
/var/lcfg/tmp /var/tmp/lcfg
/var/lcfg/conf /var/lib/lcfg/conf
/usr/lib/lcfg /usr/share/lcfg

Notes:

  • To help with training the fingers, compatibility symlinks have been added on SL7 for /var/log/lcfg/ and /var/lib/lcfg.
  • On Ubuntu these directories are more tightly protected. In time, computing staff accounts will have access, but for now you'll need to ksu to be able to read the logs; sorry.

Package installing

Package files

Debian and Ubuntu use deb rather than rpm packages.
SL Ubuntu
whatever.x86_64.rpm whatever_amd64.deb Binary
whatever.noarch.rpm whatever_all.deb Architecture-independent.
whatever.src.rpm whatever.dsc Source

Note that due to a bug in the LCFG mkxprof we currently need to use noarch rather than all for package specifications in LCFG profiles. This is translated back on the client side.

Package commands

There's more than one way to do things. If your preferred command is missing, feel free to add it (maybe with a br tag).
SL Ubuntu Does this
rpm -qa apt list --installed List the installed packages.
rpm -qi foo apt show foo Tell me about package foo.
rpm -ql foo dpkg -L foo List the files installed by package foo.
rpm -qlp foo.rpm dpkg -c foo.deb List the files in this package file.
rpm -qf foo.txt dpkg -S foo.txt What package installed that file?
rpm -q --requires foo
rpm -qR foo
apt depends foo What does package foo depend on? Note that while rpm dependencies can be package names or capabilities, apt dependencies are always package names.
rpm -q --whatrequires foo apt rdepends foo Which packages depend on foo?
om updaterpms run -- -t om apt run -- -t List what changes a "run" would make.
whererpms foo
(in cos utils)
apt policy foo
then look at the last word in the URL
("ubuntu", "inf", "lcfg" etc.)
Which repository bucket is this package in?
whererpms "foo*"
(in cos utils)
apt list "foo*"
apt search "^foo.*"
('apt search' uses regexes)
Locate available packages using a wildcarded name
rpm -i foo.rpm dpkg -i foo.deb Install this package file on this machine.
rpm -U foo.rpm Install this package file on this machine, updating any existing installation of the foo package.
rpm -e foo dpkg -r foo Remove package foo from this machine.

Package utilities

SL Ubuntu Use
rpm dpkg Manipulate a package - install, remove, query, etc.
yum apt Explore our package repositories, and maybe install packages you find there.
updaterpms apteryx Controls our machine's (LCFG-configured) package set.
yummy soy Construct package lists automatically.
  aptly Manage package repositories - mirror remote repositories locally and configure local repositories.
pkgsubmit dput Submit a package you've built. See below for the syntax.

Package spec format

In package list files and in LCFG files:
SL Ubuntu Comments
name-version-release name=version-release
  name=version If there's no release, you can miss it out.
  name=epoch:version-release If an epoch has been specified, it must be there.

The requirement to include any epoch in the version string can occasionally cause problems with parsing the specification when there is no release (these are debian native packages). The recommended solution is to add a wildcard release (e.g. append a -*).

Package building

This is a huge topic. There are many ways to build a package, and many possible problems. If you're lucky you'll be able to manage with lcfg-reltool and pkgforge - see below.

Submitting a package

SL Ubuntu
To submit to Package Forge:
pkgforge submit -B lcfg /path/to/source/package.src.rpm

pkgforge submit -B lcfg -p ubuntu /path/to/source/package.dsc
To submit a package you've built yourself:
pkgsubmit -B world /path/to/file.x86_64.rpm

dput inf-focal-world /path/to/file_amd64.changes

dput knows the buckets as inf-focal-lcfg, inf-focal-world, inf-focal-inf, inf-focal-uoe and inf-focal-devel.
And note that on Ubuntu, dev packages can only be submitted to the devel bucket.

lcfg-reltool commands

SL Ubuntu Comments
lcfg-reltool srpm lcfg-reltool pack or lcfg-reltool devpack Make a source package (works on SL7 as well as Ubuntu).
lcfg-reltool rpm lcfg-reltool deb
or more fully
lcfg-reltool debianpkg
Make a package from the files in the repository.
lcfg-reltool devrpm lcfg-reltool devdeb
or more fully
lcfg-reltool devdebianpkg
Make a package from the files in your working copy.
And note that on Ubuntu, dev packages can only be submitted to the devel bucket.
  lcfg-reltool gendeb Generate debian package metadata from lcfg.yml. (Probably only needed once per package.)

Graham's packaging recipes

Graham's written up some packaging recipes in his Ubuntu notes.

Installing Ubuntu DICE

It's pretty similar to SL7 DICE. Make an LCFG file with this as the "os" line:
#include <dice/os/ubuntu/focal.h>
PXE should work pretty much as normal. The installation is largely automatic, but you'll need to answer a couple of questions. Once it's finished, reboot the machine one extra time or you may not be able to login. To reboot a VM:
  1. kvmtool shutdown --name myvm
  2. Keep running kvmtool info --name myvm until it says that the VM isn't running any more
  3. kvmtool start --name myvm
Topic revision: r23 - 13 Oct 2020 - 14:11:34 - IanDurkacz
 
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback
This Wiki uses Cookies