Pacman

From J Wiki
Jump to navigation Jump to search

Overview

Package Manager (pacman) manages an installation. Pacman installs and upgrades addons, GUIs, and the J Engine, as well other aspects of an installation.

Jqt (Tools|Package Manager) and JHS (ide|pacman) GUIs provide interfaces to most of the pacman functionality.

Pacman verb jpkg (used without a GUI) provides the same functionality plus a few special features.

  • to upgrade JE (jengine) you must use jpkg
  • to upgrade Jqt QT binaries you must use jpkg in Jconsole

Pacman is also referred to as JAL (J Active Library) but pacman is the preferred term.

Load pacman

   load'pacman' NB. load pacman jpkg services

Install/Update Everything

After a new install (or any time you like) you can bring your system to the latest level with:

  'install' jpkg '*'

This installs the base system (standard library), all addons, Jqt ide (QT binaries), upgrades the JE (jengine), and creates desktop launch icons.

Should usually be run in jconsole. If run in Jqt, the QT binaries won't be updated as they are in use.

Installing Desktop Shortcuts

Install desktop shortcuts:

  'shortcut' jpkg 'jqt'
  'shortcut' jpkg 'jhs'
  'shortcut' jpkg 'jc'

Manage Addons

   <option> jpkg <addon name(s)>

<option>:

  • 'help' - list valid options
  • 'history' - list changelog
  • 'install' - install specified addons
  • 'manifest - list manifest
  • 'reinstall- shortcut for remove and then install
  • 'remove' - remove
  • 'search' - list of addons that contain the any of the words
  • 'show' - list summary
  • 'showinstalled' - list installed addons
  • 'shownotinstalled' - list addons not installed
  • 'showupgrade' - list addons with later versions available
  • 'status' - list addon and base library status
  • 'update' - update local copy of addon info from pacman server
  • 'upgrade' - upgrade

<addon name(s)>:

  • space-delimited literal list of addon names
  • list of boxed literal addon names
  • zero length literal list - if specified with 'upgrade', all installed addons with later versions available will be upgraded.

The following options require write access to the ~addons directory:

  • 'remove'

The following options require internet access as well as write access to the ~addons directory:

'install' , 'reinstall' , 'update' , 'upgrade'

All other options only require read access to the ~addons directory.

jpkg Usage

   load 'pacman'
   'update' jpkg '' NB. update info from server - always work with latest info
...
   'status' jpkg ''
...
   'install' jpkg 'convert/misc'
...
   'install' jpkg 'stats/base tables/csv'
...
   'install' jpkg 'base library' NB. "base library " handled specially
...
   'search' jpkg 'xml'
...
   'search' jpkg 'xml/ pcall nuri'
...
   'show' jpkg 'search' jpkg 'tara'
...

Github

Code from github can be installed as an addon if it has the same layout as a pacman addon. In particular it needs a manifest.ijs that contains a FOLDER definition.

   install 'github:owner/repo[@commit]' NB. commit defaults to master.

If it is not in the official list from Jsoftware, it will not be shown in the Tools|Package Manager menu, but otherwise can be installed and used like any other addon.

For example, suppose you have a folder of scripts for Rosetta code problems, and want to distribute a new script for solving Life. You should first have set up a github repo for this. Then you can add the new script, update the manifest, and commit the changes. Others can access the script like:

  install 'github:myname/rosetta'
  load 'myname/rosetta/life'

Note that the same syntax works for the official addons, for example:

   install 'github:cdburke/convert_pjson'
...

Connection problems

We have had occasional reports of connection problems when using pacman on Windows to get addons from our server.

Here are some possible reasons for this. Note that the server SSL certificates are automatically kept up to date so they should not be at fault.

1. Avast

The Avast antivirus program sometimes intercepts https connections and gives a false problem report. If you are running Avast, then try disabling it temporarily while you use pacman.

2. Windows 10/11 Version

Microsoft included curl starting with Windows 10, and pacman uses curl if present. The early versions of curl were not standard and several problems were reported. Recent versions of curl should work fine. They should be available if your Windows version is kept up to date.

To check your Windows version, get the exact version in J with:

  wd'qosver'

Then look up the version on https://learn.microsoft.com/en-us/windows/release-health/ or google it to see the version status.

Also you can test curl outside of J, by trying to read a small file in a terminal:

  c:\> curl https://www.jsoftware.com/download/testsock.txt

3. Windows prior to Version 10

For these earlier versions, pacman uses wget from busybox. This uses an http connection and can be tested in a terminal, for example with (use the correct path to the J9 folder):

 c:\J9\tools\ftp\busybox.exe wget -O t1.txt http://www.jsoftware.com/download/testsock.txt

If this doesn't work, then it is possible that busybox.exe may be out of date. Just running it in the terminal gives the version, e.g.

 c:\J9\tools\ftp\busybox.exe wget
 BusyBox v1.37.0-FRP-5301-gda71f7c57 (2024-02-20 13:56:32 GMT)

If you have an earlier version, download the latest version used in J from busybox.exe