Skip to content

Commit f837387

Browse files
authored
Fix 3315 - package loading (#3317)
1 parent bab3653 commit f837387

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

archinstall/lib/packages/packages.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
from ..exceptions import PackageError, SysCallError
1010
from ..models.packages import AvailablePackage, LocalPackage, PackageSearch, PackageSearchResult, Repository
11+
from ..output import debug
1112
from ..pacman import Pacman
1213

1314
BASE_URL_PKG_SEARCH = 'https://archlinux.org/packages/search/json/'
@@ -125,7 +126,12 @@ def list_available_packages(
125126
current_package: list[str] = []
126127
filtered_repos = [name for repo in repositories for name in repo.get_repository_list()]
127128

128-
for line in Pacman.run('-Sy --info'):
129+
try:
130+
Pacman.run("-Sy")
131+
except Exception as e:
132+
debug(f'Failed to sync Arch Linux package database: {e}')
133+
134+
for line in Pacman.run('-S --info'):
129135
dec_line = line.decode().strip()
130136
current_package.append(dec_line)
131137

0 commit comments

Comments
 (0)