{"id":74717,"date":"2024-04-08T16:21:03","date_gmt":"2024-04-08T10:51:03","guid":{"rendered":"http:\/\/198.58.113.91\/blog\/?p=74717"},"modified":"2025-02-05T08:53:32","modified_gmt":"2025-02-05T03:23:32","slug":"get-appxpackage-database-disk-image-malformed","status":"publish","type":"post","link":"https:\/\/www.winhelponline.com\/blog\/get-appxpackage-database-disk-image-malformed\/","title":{"rendered":"Get-AppxPackage: The database disk image is malformed"},"content":{"rendered":"<p>You may be unable to install or update Store apps. Also, when you run the Get-AppxPackage command, the following error may appear:<\/p>\n<pre class=\"err\">Get-AppxPackage : The database disk image is malformed\nThe database disk image is malformed\nAt line:1 char:1\n+ Get-AppxPackage\n+ ~~~~~~~~~~~~~~~\n+ CategoryInfo : NotSpecified: (:) [Get-AppxPackage], Exception\n+ FullyQualifiedErrorId : System.Exception,Microsoft.Windows.Appx.PackageManager.Commands.GetAppxPackageCommand<\/pre>\n<p><!--more--><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2024\/04\/get-appxpackage_malformed.jpg\" alt=\"get-appxpackage database disk image malformed\" width=\"750\" height=\"227\" class=\"alignnone size-full wp-image-77796\" \/><\/p>\n<p>In some cases, the database may be full or oversized. Add-ProvisionedAppPackage command may throw the following error:<\/p>\n<pre class=\"err\">\nAdd-ProvisionedAppPackage : Insertion failed because database is full\nAt line:1 char:1\n+ Add-ProvisionedAppPackage -online -PackagePath \"C:\\Apps\\DesktopAppIns ...\n+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n+ CategoryInfo : NotSpecified: (:) [Add-AppxProvisionedPackage], COMException\n+ FullyQualifiedErrorId : Microsoft.Dism.Commands.AddAppxProvisionedPackageCommand\n<\/pre>\n<h2>Cause<\/h2>\n<p>The &#8220;The database disk image is malformed&#8221; or the &#8220;database is full&#8221; error occurs if the State Repository database is corrupt. This database stores information about every Store app installed on the computer. The database file names are below:<\/p>\n<ul>\n<li>StateRepository-Deployment.srd<\/li>\n<li>StateRepository-Deployment.srd-shm<\/li>\n<li>StateRepository-Deployment.srd-wal<\/li>\n<li>StateRepository-Machine.srd<\/li>\n<li>StateRepository-Machine.srd-shm<\/li>\n<li>StateRepository-Machine.srd-wal<\/li>\n<\/ul>\n<p>Unfortunately, a repair installation using an in-place upgrade using the ISO <a href=\"https:\/\/answers.microsoft.com\/en-us\/windows\/forum\/windows_10-update\/xc1900101-0x4000d-the-installation-failed-in-the\/01198016-9a10-4b07-a0d2-c226331e6c62\" rel=\"noopener nofollow\" target=\"_blank\">may not resolve<\/a> the issue.<\/p>\n<p>However, resetting the StateRepository databases manually should fix the issue.<\/p>\n<h2>Resolution<\/h2>\n<p>To fix the error &#8220;The database disk image is malformed&#8221;, rebuild the State Repository database.<\/p>\n<p><em><strong>Important:<\/strong> The procedure will erase your Store apps. The Start menu and Settings might become inaccessible. However, a repair installation (after rebuilding the app repository) should fix all the issues.<\/em><\/p>\n<h3>Step 1: Rebuilding the State Repository database<\/h3>\n<ol>\n<li>Download <a href=\"https:\/\/www.nirsoft.net\/utils\/advanced_run.html\" target=\"_blank\" rel=\"noopener nofollow\">AdvancedRun<\/a> from Nirsoft.net.<\/li>\n<li>Using AdvancedRun, open a TrustedInstaller Command Prompt. See the screenshot below.<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-31199\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/08\/advancedrun-screen.png\" alt=\"advancedrun - trustedinstaller\" width=\"760\" height=\"585\" \/><\/p>\n<div class=\"rp\"><strong>RELATED:<\/strong> <a href=\"https:\/\/www.winhelponline.com\/blog\/run-program-as-trustedinstaller-locked-registry-keys-files\/#advancedrun\">How to Run Programs as TrustedInstaller<\/a><\/div>\n<\/li>\n<li>After the Command Prompt window opens, close the AdvancedRun utility.<\/li>\n<li>In the TrustedInstaller Command Prompt, run the following commands:\n<pre class=\"cmd\">md C:\\SRBackup<\/pre>\n<pre class=\"cmd\">cd \/d C:\\ProgramData\\Microsoft\\Windows\\AppRepository<\/pre>\n<pre class=\"cmd\">sc config staterepository start= disabled<\/pre>\n<pre class=\"cmd\">net stop StateRepository<\/pre>\n<p><em><strong>Note:<\/strong> If you&#8217;re prompted to stop the <strong>Appx Deployment Service (AppxSVC)<\/strong> service, press <strong>Y<\/strong> to proceed. And, if the above command does not stop the State Repository service, you&#8217;ll get the error &#8220;The StateRepository service could not be stopped&#8221;. In that case, rerun the above command again.<\/em><\/p>\n<div class=\"newline\">Then, run these commands:<\/div>\n<pre class=\"cmd\">move StateRepository-*\u00a0  C:\\SRBackup<\/pre>\n<pre class=\"cmd\">sc config staterepository start= demand<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2024\/04\/staterepository_rebuild_cmds.png\" alt=\"staterepository rebuild commands\" width=\"751\" height=\"489\" class=\"alignnone size-full wp-image-75511\" \/>\n<\/li>\n<\/ol>\n<p>The above procedure moves the existing State Repository database files to a folder for backup purposes.<\/p>\n<p>Restart Windows. Or, click the Start button or an item in your notification area. This starts the <strong>State Repository service<\/strong> automatically and <strong>rebuilds<\/strong> the databases. A fresh set of  StateRespository-* databases will be created. The newly built database will not contain information about your previously installed Store apps.<\/p>\n<hr>\n<h3>Step 2: Repair install Windows 10\/11 using the ISO<\/h3>\n<h4>Instructions to repair install Windows 10<\/h4>\n<p>1) Download Windows 10 Media Creation Tool (MCT) from this link:<br \/>\nhttps:\/\/go.microsoft.com\/fwlink\/?LinkId=2265055<\/p>\n<p>2) Run MCT and accept the license agreement.<\/p>\n<p>3) Click &#8220;Upgrade this PC now&#8221;. This starts the repair installation.<\/p>\n<p>Your apps, settings, and files will be kept by default during a repair install\/in-place upgrade.<\/p>\n<h4>Instructions to repair install Windows 11<\/h4>\n<p>1) Download Windows 11 Media Creation Tool (MCT) from this link:<br \/>\nhttps:\/\/go.microsoft.com\/fwlink\/?linkid=2156295<\/p>\n<p>2) Run MCT and download the ISO it recommends for your system. Do <em>not<\/em> uncheck &#8220;Use the recommended options for this PC&#8221;.<br \/>\nhttps:\/\/www.winhelponline.com\/blog\/how-to-download-windows-11-iso\/ (screenshots)<\/p>\n<p>3) Right-click on the downloaded ISO and choose &#8220;Mount.&#8221; This assigns the ISO a drive letter.<\/p>\n<p>4) Run setup.exe from the ISO drive. This starts the in-place upgrade\/repair installation.<\/p>\n<p>(Your files, settings and applications will be preserved if you use the ISO recommended for your system by the Media Creation Tool.)<\/p>\n<p>This resolves the errors &#8220;The database disk image is malformed&#8221; and &#8220;Insertion failed because database is full&#8221; by rebuilding the StateRepository databases and allows you to install the Store apps.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You may be unable to install or update Store apps. Also, when you run the Get-AppxPackage command, the following error may appear: Get-AppxPackage : The database disk image is malformed The database disk image is malformed At line:1 char:1 + Get-AppxPackage + ~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Get-AppxPackage], Exception + FullyQualifiedErrorId : System.Exception,Microsoft.Windows.Appx.PackageManager.Commands.GetAppxPackageCommand<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[8,869],"tags":[106,191,396],"class_list":["post-74717","post","type-post","status-publish","format-standard","hentry","category-windows-10","category-windows-11","tag-command-prompt","tag-error-messages","tag-powershell"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":75425,"url":"https:\/\/www.winhelponline.com\/blog\/install-store-app-for-all-users\/","url_meta":{"origin":74717,"position":0},"title":"How to Install a Store App package for all users","author":"Ramesh","date":"June 6, 2024","format":false,"excerpt":"When you install a Store app package by double-clicking on the package or by running the Add-AppxPackage cmdlet in PowerShell, the package is installed for the current user only. This article tells you how to install or provision a Store app package for all user accounts that exist on the\u2026","rel":"","context":"In &quot;Windows 10&quot;","block_context":{"text":"Windows 10","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/windows-10\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":20265,"url":"https:\/\/www.winhelponline.com\/blog\/error-0x80073cfa-uninstall-app-removal-failed\/","url_meta":{"origin":74717,"position":1},"title":"Fix for Error 0x80073CFA when Uninstalling an App in Windows 10","author":"Ramesh","date":"December 9, 2020","format":false,"excerpt":"When uninstalling a Store app in Windows 10, you may get the error 0x80073CFA. This happens whether you use the Apps & Features GUI or PowerShell command to remove the app. Many users have indicated that the error happens when uninstalling some game apps like Forza Motorsport, Forza Horizon, Asphalt:\u2026","rel":"","context":"In &quot;Utilities&quot;","block_context":{"text":"Utilities","link":"https:\/\/www.winhelponline.com\/blog\/category\/utilities\/"},"img":{"alt_text":"0x80073CFA store app remove using python script","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2020\/12\/0x80073cfa-remove-package-nonremovable-2.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2020\/12\/0x80073cfa-remove-package-nonremovable-2.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2020\/12\/0x80073cfa-remove-package-nonremovable-2.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2020\/12\/0x80073cfa-remove-package-nonremovable-2.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":2506,"url":"https:\/\/www.winhelponline.com\/blog\/start-and-taskbar-stuck-windows-10-fix-shellexperiencehost\/","url_meta":{"origin":74717,"position":2},"title":"Reinstall or Repair stuck Windows 10 Start Menu &#038; Taskbar, and Fix &#8220;Critical Error&#8221;","author":"Ramesh","date":"March 30, 2016","format":false,"excerpt":"Occasionally, the Start button, Taskbar, and the Notification area icons may get stuck or frozen; clicking them does nothing. When the items in the Notification area are frozen, you wouldn't be able to access Action Center, Wi-fi network settings, etc. If the Windows 10 Start Menu is frozen or non-responsive\u2026","rel":"","context":"In &quot;Windows 10&quot;","block_context":{"text":"Windows 10","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/windows-10\/"},"img":{"alt_text":"reinstall start menu startmenuexperiencehost start","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/03\/startmenuexperience-host-start-processes.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":27647,"url":"https:\/\/www.winhelponline.com\/blog\/cant-run-appx-appxbundle-msixbundle\/","url_meta":{"origin":74717,"position":3},"title":"Fix: Can&#8217;t Install Appx, AppxBundle, and Msixbundle Files in Windows","author":"Ramesh","date":"August 27, 2022","format":false,"excerpt":"The file types .Appx, .AppxBundle, and .Msixbundle are app installer or setup packages. On a default Windows 10 or 11 installation, you can double-click these file types to run them. But, if the App Installer (a.k.a, \"Desktop Installer\") Store app is removed from the system, the .Appx, .AppxBundle, and .Msixbundle\u2026","rel":"","context":"In &quot;Windows 10&quot;","block_context":{"text":"Windows 10","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/windows-10\/"},"img":{"alt_text":"app installer - store app screenshot","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2022\/08\/appx-package-installer-screen.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2022\/08\/appx-package-installer-screen.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2022\/08\/appx-package-installer-screen.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2022\/08\/appx-package-installer-screen.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":4855,"url":"https:\/\/www.winhelponline.com\/blog\/restore-windows-store-windows-10-uninstall-with-powershell\/","url_meta":{"origin":74717,"position":4},"title":"Restore Microsoft Store in Windows 10\/11 after uninstalling it with PowerShell","author":"Ramesh","date":"December 21, 2016","format":false,"excerpt":"Windows 10 and 11 come with many built-in Store apps that may not be useful to you. As you may have known, PowerShell allows you to uninstall individual apps or all apps using a single command. If you had used the following command to uninstall all bundled apps in Windows\u2026","rel":"","context":"In &quot;Windows 10&quot;","block_context":{"text":"Windows 10","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/windows-10\/"},"img":{"alt_text":"Microsoft Store app installer from AppStore.","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/12\/store-installer-appstore.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/12\/store-installer-appstore.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/12\/store-installer-appstore.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/12\/store-installer-appstore.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":8675,"url":"https:\/\/www.winhelponline.com\/blog\/windows-10-store-apps-uninstaller-preinstalled-apps\/","url_meta":{"origin":74717,"position":5},"title":"How to Uninstall Preinstalled Apps in Windows 10\/11","author":"Ramesh","date":"April 15, 2019","format":false,"excerpt":"In early builds of Windows 10, no user interface option was provided in the Settings to remove a preinstalled Store app (UWP). On those builds, the only way was to use PowerShell to remove or reinstall the apps. Later Windows 10 builds facilitated the reset or uninstallation of apps via\u2026","rel":"","context":"In &quot;Windows 10&quot;","block_context":{"text":"Windows 10","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/windows-10\/"},"img":{"alt_text":"uninstall built-in apps powershell","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2019\/04\/powershell-uninstall-apps-gridview-passthru.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2019\/04\/powershell-uninstall-apps-gridview-passthru.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2019\/04\/powershell-uninstall-apps-gridview-passthru.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2019\/04\/powershell-uninstall-apps-gridview-passthru.png?resize=700%2C400&ssl=1 2x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/posts\/74717","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/comments?post=74717"}],"version-history":[{"count":0,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/posts\/74717\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/media?parent=74717"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/categories?post=74717"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/tags?post=74717"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}