diff --git a/src/cmd-install.c b/src/cmd-install.c
index 29e72b8..548c06e 100644
--- a/src/cmd-install.c
+++ b/src/cmd-install.c
@@ -646,7 +646,7 @@ gint cmd_install(const gchar* pkgfile, const struct cmd_options* opts, struct er
     }
     else if (!strcmp(sane_path, "install/doinst.sh"))
     {
-      if (tgz->f_size > 1024*512) /* 512K is enough for all. :) */
+      if (tgz->f_size > 1024*1024*4) /* 4M is enough for all. :) now, really! */
       {
         e_set(E_ERROR, "Installation script is too big. (%ld kB)", tgz->f_size / 1024);
         goto err3;
diff --git a/src/cmd-upgrade.c b/src/cmd-upgrade.c
index 178e65b..bf55c43 100644
--- a/src/cmd-upgrade.c
+++ b/src/cmd-upgrade.c
@@ -787,7 +787,7 @@ gint cmd_upgrade(const gchar* pkgfile, const struct cmd_options* opts, struct er
     }
     else if (!strcmp(sane_path, "install/doinst.sh"))
     {
-      if (tgz->f_size > 1024*512) /* 512K is enough for all. :) */
+      if (tgz->f_size > 1024*1024*4) /* 4M is enough for all. :) now, really! */
       {
         e_set(E_ERROR, "Installation script is too big. (%ld kB)", tgz->f_size / 1024);
         goto err3;
diff --git a/src/pkgdb.c b/src/pkgdb.c
index 7259dce..756989d 100644
--- a/src/pkgdb.c
+++ b/src/pkgdb.c
@@ -816,7 +816,7 @@ struct db_pkg* db_get_pkg(gchar* name, db_get_type type)
 
   fseek(fs, 0, SEEK_END);
   guint script_size = ftell(fs);
-  if (script_size > 512*1024)
+  if (script_size > 4*1024*1024)
   {
     e_set(E_ERROR, "Script file is too big %s. (%u kB)", p->name, script_size / 1024);
     goto err_1;
