diff --git a/assemble_image.sh b/assemble_image.sh
index 13de324340b57a4be6261a0838a2ef531434c4df..f9dd3880374c26053bb8dd49f5be923886199986 100755
--- a/assemble_image.sh
+++ b/assemble_image.sh
@@ -24,6 +24,7 @@ mv "$workspace/part_files"/grub/* "$workspace/part_files"/boot/grub/
 rm -rf "$workspace/part_files"/grub
 
 cp "$iso_file" "$workspace/part_files/kubuntu.iso"
+./create_offlinerepo.sh "$workspace/part_files/archive" "$iso_file" vim htop
 
 rm -f "$workspace/part.img"
 truncate -s "$image_size" "$workspace/part.img"
diff --git a/create_offlinerepo.sh b/create_offlinerepo.sh
index a89c11e61fe45eb2b145444e38794b358eda9cbb..5e5891c74cfeccf7b1363b58b986a65f34bcc748 100755
--- a/create_offlinerepo.sh
+++ b/create_offlinerepo.sh
@@ -17,24 +17,52 @@ shift || usage
 packages="$@"
 
 workspace="/workspace"
+APT_SOURCE_URL_OVERRIDE="http://ftp.halifax.rwth-aachen.de/ubuntu/"
 
 rm -rf "$workspace"/offlinerepo
 mkdir -p "$workspace"/offlinerepo
+mkdir -p "$dest"
 
 7z e -so "$iso_file" casper/filesystem.squashfs > "$workspace"/offlinerepo/filesystem.squashfs
 unsquashfs -no-xattrs -d "$workspace"/offlinerepo/squashfs-root "$workspace"/offlinerepo/filesystem.squashfs 
 
+ISO_RELEASE="$(grep DISTRIB_CODENAME "$workspace/offlinerepo/squashfs-root/etc/lsb-release" | cut -d= -f 2-)"
+ISO_VERSION="$(grep DISTRIB_RELEASE "$workspace/offlinerepo/squashfs-root/etc/lsb-release" | cut -d= -f 2-)"
+ISO_DESCRIPTION="$(grep DISTRIB_DESCRIPTION "$workspace/offlinerepo/squashfs-root/etc/lsb-release" | cut -d'"' -f 2)"
+echo "deb $APT_SOURCE_URL_OVERRIDE ${ISO_RELEASE} main restricted universe multiverse" > "$workspace/offlinerepo/squashfs-root/etc/apt/sources.list"
+echo "deb $APT_SOURCE_URL_OVERRIDE ${ISO_RELEASE}-security main restricted universe multiverse" >> "$workspace/offlinerepo/squashfs-root/etc/apt/sources.list"
+echo "deb $APT_SOURCE_URL_OVERRIDE ${ISO_RELEASE}-updates main restricted universe multiverse" >> "$workspace/offlinerepo/squashfs-root/etc/apt/sources.list"
 apt-get -o Dir="$workspace"/offlinerepo/squashfs-root update
 
 {
 	apt-get -o Dir="$workspace"/offlinerepo/squashfs-root upgrade --print-uris -qq
 	apt-get -o Dir="$workspace"/offlinerepo/squashfs-root install --reinstall --print-uris -qq $packages
 } | cut -d"'" -f2 | while read url; do wget -nc -P "$dest" "$url"; done
+apt-get -o Dir="$workspace"/offlinerepo/squashfs-root install --reinstall --print-uris -qq $packages
 
-{
-	cd "$dest"
-	rm -rf "$dest"/Packages.*
-	dpkg-scanpackages . | gzip > Packages.gz
-}
+mkdir -p "$dest/dists/$ISO_RELEASE/lip/binary-amd64"
+( cd "$dest" && dpkg-scanpackages . | gzip > "dists/$ISO_RELEASE/lip/binary-amd64/Packages.gz" )
+
+cat <<EOF > "$dest/dists/$ISO_RELEASE/lip/binary-amd64/Release"
+Archive: $ISO_RELEASE
+Version: $ISO_VERSION
+Component: lip
+Origin: Ubuntu
+Label: Ubuntu
+Architecture: amd64
+EOF
+
+touch "$dest/.aptignr"
+cat <<EOF > "$dest/Release"
+Origin: Ubuntu
+Label: LIP Ubuntu Extra Packages
+Suite: $ISO_RELEASE
+Version: $ISO_VERSION
+Codename: $ISO_RELEASE
+Date: $(LC_ALL=C date -u)
+Architectures: amd64
+Components: lip
+Description: $ISO_DESCRIPTION
+EOF
 
 # Maybe sort files into the usual directory structure ("pool/main/g/glib2.0...")