Don't use python APT module, install ogagent dependencies #3

Merged
nserrano merged 2 commits from no-apt-module into main 2024-10-03 14:14:05 +02:00
2 changed files with 7 additions and 27 deletions

View File

@ -58,30 +58,8 @@ def cache_search (pkgs):
return res
def install (pkgs, opts={}):
apt_pkg.init()
if opts:
apt_pkg.init_config()
for k in opts:
apt_pkg.config.set (k, opts[k])
cache = apt_pkg.Cache()
sl = apt_pkg.SourceList()
sl.read_main_list()
cache.update (apt.progress.base.AcquireProgress(), sl)
_to_install = []
dep_cache = apt_pkg.DepCache(cache)
for p in pkgs:
package = cache[p]
if not package:
print (f'package "{p}" not found')
continue
_to_install.append (p)
dep_cache.mark_install(package)
if _to_install:
print ('about to install these packages: "{}"'.format (' '.join (_to_install)))
fetcher = apt_pkg.Acquire()
install_progress = apt.progress.base.InstallProgress()
dep_cache.commit(fetcher, install_progress)
opts_list = []
for k in opts: opts_list += ['-o', f'{k}={opts[k]}']
print ('about to install these packages: "{}"'.format (' '.join (pkgs)))
import subprocess
subprocess.run (['apt-get', '--yes', 'install'] + pkgs + opts_list)

View File

@ -68,6 +68,8 @@ isolinux_template =
[Packages]
agent = policykit-1 python3 python3-pyqt6 python3-requests python3-six python3-prctl python3-distro libxss1 zenity
basic =
dialog man-db fbset gdebi-core bash-static busybox-static locales lshw gawk git python3-openssl python3 php-cli dmidecode rpm sqlite3 os-prober moreutils jq
#console-data # ogLive anterior a Ubuntu 20.04