diff --git a/cabal-cache.cabal b/cabal-cache.cabal
--- a/cabal-cache.cabal
+++ b/cabal-cache.cabal
@@ -1,7 +1,7 @@
 cabal-version:          2.2
 
 name:                   cabal-cache
-version:                1.0.1.0
+version:                1.0.1.1
 synopsis:               CI Assistant for Haskell projects
 description:            CI Assistant for Haskell projects.  Implements package caching.
 homepage:               https://github.com/haskell-works/cabal-cache
diff --git a/src/App/Commands/SyncFromArchive.hs b/src/App/Commands/SyncFromArchive.hs
--- a/src/App/Commands/SyncFromArchive.hs
+++ b/src/App/Commands/SyncFromArchive.hs
@@ -20,8 +20,9 @@
 import Data.Generics.Product.Any        (the)
 import Data.Maybe
 import Data.Semigroup                   ((<>))
+import Foreign.C.Error ( eXDEV )
 import HaskellWorks.CabalCache.AppError
-import HaskellWorks.CabalCache.IO.Error (exceptWarn, maybeToExcept)
+import HaskellWorks.CabalCache.IO.Error (exceptWarn, maybeToExcept, catchErrno)
 import HaskellWorks.CabalCache.Location ((<.>), (</>))
 import HaskellWorks.CabalCache.Metadata (loadMetadata)
 import HaskellWorks.CabalCache.Show
@@ -153,7 +154,8 @@
                         when confPathExists $ do
                           confContents <- liftIO $ LBS.readFile theConfPath
                           liftIO $ LBS.writeFile tempConfPath (replace (LBS.toStrict oldStorePath) (C8.pack storePath) confContents)
-                          liftIO $ IO.renamePath tempConfPath theConfPath
+                          liftIO $ catchErrno [eXDEV] (IO.renameFile tempConfPath theConfPath) (IO.copyFile tempConfPath theConfPath >> IO.removeFile tempConfPath)
+
                         return True
           Nothing -> do
             CIO.hPutStrLn IO.stderr $ "Warning: Invalid package id: " <> packageId
diff --git a/src/HaskellWorks/CabalCache/Core.hs b/src/HaskellWorks/CabalCache/Core.hs
--- a/src/HaskellWorks/CabalCache/Core.hs
+++ b/src/HaskellWorks/CabalCache/Core.hs
@@ -94,5 +94,8 @@
     }
 
 getLibFiles :: FilePath -> FilePath -> Text -> IO [Library]
-getLibFiles relativeLibPath libPath libPrefix =
-  fmap (relativeLibPath </>) . filter (List.isPrefixOf (T.unpack libPrefix)) <$> IO.listDirectory libPath
+getLibFiles relativeLibPath libPath libPrefix = do
+  libExists <- IO.doesDirectoryExist libPath
+  if libExists
+     then fmap (relativeLibPath </>) . filter (List.isPrefixOf (T.unpack libPrefix)) <$> IO.listDirectory libPath
+     else pure []
diff --git a/src/HaskellWorks/CabalCache/IO/Error.hs b/src/HaskellWorks/CabalCache/IO/Error.hs
--- a/src/HaskellWorks/CabalCache/IO/Error.hs
+++ b/src/HaskellWorks/CabalCache/IO/Error.hs
@@ -6,10 +6,20 @@
   , exceptWarn
   , maybeToExcept
   , maybeToExceptM
+  , catchErrno
   ) where
 
 import Control.Monad.Except
+import Foreign.C.Error
+  (
+    getErrno
+  , Errno
+  )
 import HaskellWorks.CabalCache.AppError
+import System.IO.Error
+  (
+    catchIOError
+  )
 
 import qualified HaskellWorks.CabalCache.IO.Console as CIO
 import qualified System.Exit                        as IO
@@ -33,3 +43,19 @@
 
 maybeToExceptM :: Monad m => AppError -> m (Maybe a) -> ExceptT AppError m a
 maybeToExceptM message = ExceptT . fmap (maybe (Left message) Right)
+
+
+-- |Carries out an action, then checks if there is an IOException and
+-- a specific errno. If so, then it carries out another action, otherwise
+-- it rethrows the error.
+catchErrno :: [Errno] -- ^ errno to catch
+           -> IO a    -- ^ action to try, which can raise an IOException
+           -> IO a    -- ^ action to carry out in case of an IOException and
+                      --   if errno matches
+           -> IO a
+catchErrno en a1 a2 =
+  catchIOError a1 $ \e -> do
+    errno <- getErrno
+    if errno `elem` en
+      then a2
+      else ioError e
