If I want to install the tomcat6 package for example, would it be possible to see a list of files/directories of what/where this package will save?
Also, can I see the actual debian package to learn from it?
You can find the package information at packages.ubuntu.com (e.g. tomcat6), including file lists and download link.
First, download the package you're interested in:
apt-get download tomcat6
Then open the downloaded package with File Roller to inspect it's contents:
file-roller tomcat6*.deb
If package is already installed:
You can see what files from <packagename> are installed to your system by typing:
dpkg-query -L <packagename>
Without installing package:
sudo apt-get clean
sudo apt-get install -d <packagename>
for file in /var/cache/apt/archives/*; do
dpkg-deb -c $file;
done
This clears your local apt cache, then downloads the package without installing it. Then it prints the contents of the package and yet-to-be-installed dependencies to the screen. You might prefer
dpkg-deb -c $file | tee -a <filename>
to write the package contents to a file.