LinuxCommandLibrary

update-catalog

Update software package catalog

SYNOPSIS

update-catalog [options]
The command updates the system's SGML and XML catalog files based on installed packages. It usually requires root privileges to modify system-wide catalogs.

PARAMETERS

--verbose, -v
    Output verbose information about actions taken.

--dry-run, -n
    Simulate the catalog update process without making any actual changes. This is useful for previewing what would happen.

--sgml
    Update only SGML catalogs.

--xml
    Update only XML catalogs.

--all
    Update both SGML and XML catalogs. This is the default behavior.

--remove
    Remove stale or invalid entries from the catalogs.

--system
    Update system-wide catalogs (e.g., /etc/sgml/catalog, /etc/xml/catalog). This is the default for root users.

--etc
    Specifically update the main system-wide catalogs located in /etc/.

--quiet, -q
    Suppress all output except for errors.

DESCRIPTION

The update-catalog command is a utility designed to manage and update system-wide and user-specific SGML and XML catalogs. These catalogs are crucial for resolving Public Identifiers (PIs) and System Identifiers (SIDs) used in SGML and XML documents, mapping them to local file paths for DTDs (Document Type Definitions), entities, and stylesheets.

Primarily part of the Debian/Ubuntu sgml-base and xml-core packages, update-catalog is typically invoked automatically by package post-installation scripts whenever new SGML or XML resources are installed or removed. This automation ensures that applications using SGML/XML parsers can correctly locate and validate documents against the available definitions. While it can be run manually, its main purpose is to maintain consistency in the system's catalog files, such as /etc/sgml/catalog and /etc/xml/catalog, reflecting the current state of installed resources.

CAVEATS

update-catalog is primarily an internal system utility, often invoked automatically by package management scripts during installation or removal of SGML/XML-related software.

Manual invocation is typically only needed for debugging or specific system maintenance by experienced administrators. It relies on packages correctly registering their SGML/XML resources during installation. Its behavior and specific options may vary slightly between different Linux distributions or versions of the sgml-base/xml-core packages.

WHAT ARE SGML/XML CATALOGS?

SGML/XML catalogs provide a mapping mechanism for Public Identifiers (PIs) and System Identifiers (SIDs) to local file paths. This allows XML or SGML parsers to locate DTDs, external entities, or stylesheets referenced in documents without requiring a direct network connection or a hardcoded local path. Catalogs enable flexible and robust document processing, especially when documents need to be portable or validated against shared resources.

SYSTEM-WIDE VS. USER-SPECIFIC CATALOGS

update-catalog primarily manages system-wide catalogs (e.g., /etc/sgml/catalog, /etc/xml/catalog), which are used by all applications on the system. However, users can also define their own catalogs, typically via environment variables (like SGML_CATALOG_FILES or XML_CATALOG_FILES), allowing for project-specific or user-specific resource mappings that override or extend the system catalogs.

HISTORY

The update-catalog command emerged as a component of the Debian/Ubuntu packaging system, designed to simplify the management of SGML and later XML document resources. As the use of SGML (and subsequently XML) for configuration, documentation, and data exchange grew within the Linux ecosystem, a robust mechanism was needed to ensure that parsers could consistently locate required DTDs and entities. This utility automates the process of maintaining central catalog files, replacing manual and error-prone updates, thereby improving system stability and application compatibility when dealing with structured documents.

SEE ALSO

sgml-base(7), xml-core(7), install-catalog(8), remove-catalog(8)

Copied to clipboard