ts-apt - v1.1.2
    Preparing search index...

    Interface PackageManager

    Package manager contract implemented by APT and APT-fast managers.

    interface PackageManager {
        install(
            pkgs: readonly PackageName[],
            timeoutMs?: number,
        ): Promise<PackageInfo[]>;
        remove(
            pkgs: readonly PackageName[],
            autoremoveEnabled?: boolean,
            timeoutMs?: number,
        ): Promise<PackageInfo[]>;
        search(keywords: string[], namesOnly?: boolean): Promise<PackageInfo[]>;
        listInstalledFiles(pkg: PackageName): Promise<string[]>;
        getNativeArchitecture(): Promise<string>;
        listInstalled(): Promise<PackageInfo[]>;
        listUpgradable(): Promise<PackageInfo[]>;
        upgrade(
            pkgs?: readonly PackageName[],
            timeoutMs?: number,
        ): Promise<PackageInfo[]>;
        upgradeAll(timeoutMs?: number): Promise<PackageInfo[]>;
        update(timeoutMs?: number): Promise<number>;
        getPackageInfo(pkgs: readonly PackageName[]): Promise<PackageInfo[]>;
        autoClean(timeoutMs?: number): Promise<void>;
        autoRemove(timeoutMs?: number): Promise<PackageInfo[]>;
    }
    Index
    • Installs one or more packages via <mutating-binary> install --fix-broken <package...>.

      Example output (parsed):

      Setting up curl:amd64 (8.5.0-2ubuntu10.6) ...
      Setting up ca-certificates (20240203) ...
      

      Parameters

      • pkgs: readonly PackageName[]

        Package names.

      • OptionaltimeoutMs: number

        Command timeout in milliseconds, default is -1 for no timeout.

      Returns Promise<PackageInfo[]>

      List of installed packages.

    • Removes one or more packages via <mutating-binary> remove --fix-broken <package...>.

      Example output (parsed):

      Removing curl (8.5.0-2ubuntu10.6) ...
      Removing libcurl4:amd64 (8.5.0-2ubuntu10.6) ...
      

      Parameters

      • pkgs: readonly PackageName[]

        Package names.

      • OptionalautoremoveEnabled: boolean

        Whether to also remove orphaned dependencies. Defaults to true.

      • OptionaltimeoutMs: number

        Command timeout in milliseconds, default is -1 for no timeout.

      Returns Promise<PackageInfo[]>

      List of removed packages.

    • Searches package repositories via apt search <keywords...>.

      Example output (parsed):

      curl/jammy-updates,jammy-security 8.5.0-2ubuntu10.6 amd64
        command line tool for transferring data with URL syntax
      

      Parameters

      • keywords: string[]

        Search terms.

      • OptionalnamesOnly: boolean

        Whether to return only package names.

      Returns Promise<PackageInfo[]>

    • Lists files installed by a package via dpkg-query -L <package>.

      Example output:

      /.
      /usr
      /usr/bin/curl
      /usr/share/doc/curl/changelog.Debian.gz
      

      Parameters

      Returns Promise<string[]>

      List of installed file paths for the package.

    • Gets the system's native package architecture via dpkg --print-architecture.

      Packages installed for this architecture may omit it from their name, while foreign-arch packages (e.g. libc6:i386 on amd64) need it.

      Example output:

      amd64
      

      Returns Promise<string>

      Debian architecture name (e.g. amd64, arm64).

    • Lists installed packages via dpkg-query -W -f '${Package}:${Architecture}=${Version}\\n'.

      Each line uses the same name:arch=version form as PackageName.serialize.

      Example output (parsed):

      curl:amd64=8.5.0-2ubuntu10.6
      libc6:amd64=2.39-0ubuntu8.4
      

      Returns Promise<PackageInfo[]>

      List of installed packages.

    • Lists upgradable packages via apt list --upgradable.

      Example output (parsed):

      curl/jammy-updates,jammy-security 8.5.0-2ubuntu10.6 amd64 [upgradable from: 8.5.0-2ubuntu10.5]
      

      Returns Promise<PackageInfo[]>

      List of upgradable packages.

    • Upgrades selected packages or all packages when no names are provided.

      Commands executed:

      • Specific packages: <mutating-binary> install <package...>
      • All packages: <mutating-binary> upgrade

      Example output (parsed):

      Setting up openssl (3.0.13-0ubuntu3.5) ...
      Setting up libc6:amd64 (2.39-0ubuntu8.4) ...
      

      Parameters

      • Optionalpkgs: readonly PackageName[]

        Optional package names.

      • OptionaltimeoutMs: number

        Command timeout in milliseconds, default is -1 for no timeout.

      Returns Promise<PackageInfo[]>

    • Upgrades all packages via <mutating-binary> upgrade.

      Example output (parsed):

      Setting up openssl (3.0.13-0ubuntu3.5) ...
      Setting up libc6:amd64 (2.39-0ubuntu8.4) ...
      

      Parameters

      • OptionaltimeoutMs: number

        Command timeout in milliseconds, default is -1 for no timeout.

      Returns Promise<PackageInfo[]>

      List of upgraded packages.

    • Updates package index metadata via <mutating-binary> update.

      Example output (parsed):

      12 packages can be upgraded. Run 'apt list --upgradable' to see them.
      

      Parameters

      • OptionaltimeoutMs: number

        Command timeout in milliseconds, default is -1 for no timeout.

      Returns Promise<number>

      Number of packages that can be upgraded.

    • Retrieves package metadata via apt-cache --quiet=0 --no-all-versions show <package...>.

      Example output (parsed):

      Package: curl
      Version: 8.5.0-2ubuntu10.6
      Architecture: amd64
      Description: command line tool for transferring data with URL syntax
      

      Parameters

      Returns Promise<PackageInfo[]>

    • Cleans local apt cache data via <mutating-binary> autoclean.

      Example output:

      Reading package lists... Done
      Building dependency tree... Done
      Del old downloaded archive files
      

      Parameters

      • OptionaltimeoutMs: number

        Command timeout in milliseconds, default is -1 for no timeout.

      Returns Promise<void>

    • Removes orphaned dependencies via <mutating-binary> autoremove.

      Example output (parsed):

      Removing libfoo1:amd64 (1.2.3-1ubuntu1) ...
      Removing bar-data (0.9.0-2) ...
      

      Parameters

      • OptionaltimeoutMs: number

        Command timeout in milliseconds, default is -1 for no timeout.

      Returns Promise<PackageInfo[]>

      List of removed packages.