From 3fc5e57fef885dcd89fc5270ab0550056cb2e4c8 Mon Sep 17 00:00:00 2001
From: Antonio Andelic <antonio2368@users.noreply.github.com>
Date: Thu, 14 Oct 2021 15:16:32 +0200
Subject: [PATCH] Update dependency source when package all is called (#272)

---
 environment/os/debian-11.sh | 1 +
 release/debian/copyright    | 2 +-
 release/package/run.sh      | 9 +++++++--
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/environment/os/debian-11.sh b/environment/os/debian-11.sh
index 3db22f8ec..bc79c1f5f 100755
--- a/environment/os/debian-11.sh
+++ b/environment/os/debian-11.sh
@@ -24,6 +24,7 @@ TOOLCHAIN_RUN_DEPS=(
     zlib1g # zlib library used for all builds
     libexpat1 libipt2 libbabeltrace1 liblzma5 python3 # for gdb
     libcurl4 # for cmake
+    file # for CPack
     libreadline8 # for cmake and llvm
     libffi7 libxml2 # for llvm
 )
diff --git a/release/debian/copyright b/release/debian/copyright
index 7eabdb1c2..30cff7403 120000
--- a/release/debian/copyright
+++ b/release/debian/copyright
@@ -1 +1 @@
-../LICENSE.md
\ No newline at end of file
+../../LICENSE
\ No newline at end of file
diff --git a/release/package/run.sh b/release/package/run.sh
index 9c3767aec..af6ef5154 100755
--- a/release/package/run.sh
+++ b/release/package/run.sh
@@ -18,14 +18,21 @@ print_help () {
 
 make_package () {
     os="$1"
+
+    build_container="mgbuild_$os"
+    echo "Building Memgraph for $os on $build_container..."
+
     package_command=""
     if [[ "$os" =~ ^"centos".* ]]; then
+        docker exec "$build_container" bash -c "yum -y update"
         package_command=" cpack -G RPM --config ../CPackConfig.cmake && rpmlint memgraph*.rpm "
     fi
     if [[ "$os" =~ ^"debian".* ]]; then
+        docker exec "$build_container" bash -c "apt update"
         package_command=" cpack -G DEB --config ../CPackConfig.cmake "
     fi
     if [[ "$os" =~ ^"ubuntu".* ]]; then
+        docker exec "$build_container" bash -c "apt update"
         package_command=" cpack -G DEB --config ../CPackConfig.cmake "
     fi
     telemetry_id_override_flag=""
@@ -39,8 +46,6 @@ make_package () {
           exit
         fi
     fi
-    build_container="mgbuild_$os"
-    echo "Building Memgraph for $os on $build_container..."
 
     echo "Copying project files..."
     # If master is not the current branch, fetch it, because the get_version