diff --git a/cabal-flatpak.cabal b/cabal-flatpak.cabal
--- a/cabal-flatpak.cabal
+++ b/cabal-flatpak.cabal
@@ -1,6 +1,6 @@
 Cabal-Version:  2.2
 Name:           cabal-flatpak
-Version:        0.1.1
+Version:        0.1.2
 License:        BSD-3-Clause
 License-File:   LICENSE
 Author:         Henning Thielemann <haskell@henning-thielemann.de>
@@ -25,7 +25,7 @@
   flatpak.cabal.json
 
 Source-Repository this
-  Tag:         0.1.1
+  Tag:         0.1.2
   Type:        darcs
   Location:    https://hub.darcs.net/thielema/cabal-flatpak/
 
@@ -37,7 +37,7 @@
   Build-Depends:
     cabal-plan >=0.5 && <0.8,
     cryptohash-sha256 >=0.11 && <0.12,
-    zlib >=0.5.3 && <0.7,
+    zlib >=0.5.3 && <0.8,
     tar >=0.5.0.3 && <0.7,
     http-client-tls >=0.3.5.3 && <0.4,
     http-client >=0.5.12 && <0.8,
@@ -48,6 +48,7 @@
     shell-utility >=0.1 && <0.2,
     optparse-applicative >=0.11 && <0.19,
     pathtype >=0.8 && <0.9,
+    directory >=1.2.3 && <1.4,
     text >=1.2 && <2.2,
     bytestring >=0.9 && <0.13,
     containers >=0.5 && <0.8,
diff --git a/src/Main.hs b/src/Main.hs
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -10,6 +10,7 @@
 
 import qualified System.Path.Directory as PathDir
 import qualified System.Path as Path
+import qualified System.Directory as Dir
 import System.Path ((</>))
 
 import qualified Option
@@ -55,7 +56,24 @@
       ".yml" -> True
       _ -> False
 
+findCabalDir :: IO Path.AbsDir
+findCabalDir = do
+   xdgDir <- Dir.getXdgDirectory Dir.XdgCache "cabal"
+   xdgExists <- Dir.doesDirectoryExist xdgDir
+   if xdgExists
+      then return $ Path.absDir xdgDir
+      else do
+         appDir <- PathDir.getAppUserDataDirectory "cabal"
+         appExists <- PathDir.doesDirectoryExist appDir
+         if appExists
+            then return appDir
+            else
+               fail $
+               "Cabal cache directory not found under one these directories: "
+               ++
+               printf "%s, %s" xdgDir (Path.toString appDir)
 
+
 main :: IO ()
 main = do
    opt <- OP.execParser Option.info
@@ -116,7 +134,7 @@
             sha256 <- Retrieve.ghcHash sha256Map compiler arch
             return (arch, sha256)
 
-   cabalDir <- PathDir.getAppUserDataDirectory "cabal"
+   cabalDir <- findCabalDir
    let hackageDir =
          cabalDir </> Path.dir "packages" </> Path.dir "hackage.haskell.org"
 
