Difference between revisions of "Pkg"

From GhostBSD Wiki
Jump to: navigation, search
(Introduction)
(Installing and Removing Packages)
Line 35: Line 35:
 
<code># man pkg-install</code>
 
<code># man pkg-install</code>
  
===Installing and Removing Packages===
+
===Installing Packages===
  
 
To install a binary package use the following command, where packagename is the name of the package to install:
 
To install a binary package use the following command, where packagename is the name of the package to install:
Line 42: Line 42:
  
 
This command uses repository data to determine which version of the software to install and if it has any uninstalled dependencies.
 
This command uses repository data to determine which version of the software to install and if it has any uninstalled dependencies.
 +
 +
=== Removing Packages===
 +
 +
Packages that are no longer needed can be removed with pkg delete. For example:
 +
 +
 +
<code># pkg delete packagename</code>
 +
 +
===Upgrading Installed Packages===
 +
 +
Installed packages can be upgraded to their latest versions by running:
 +
 +
<code># pkg upgrade</code>
 +
 +
This command will compare the installed versions with those available in the repository catalogue and upgrade them from the repository.
 +
 +
===Auditing Installed Packages===
 +
 +
Software vulnerabilities are regularly discovered in third-party applications. To address this, pkg includes a built-in auditing mechanism. To determine if there are any known vulnerabilities for the software installed on the system, run:
 +
 +
<code># pkg audit -F</code>
 +
 +
===Automatically Removing Unused Packages===
 +
 +
Removing a package may leave behind dependencies which are no longer required. Unneeded packages that were installed as dependencies (leaf packages) can be automatically detected and removed using:
 +
 +
<code># pkg autoremove</code>
  
 
== For more Information read ==
 
== For more Information read ==

Revision as of 17:33, 15 December 2019

Application Management
pkg Software Station Update Station Ports Applications
Back to the Icon Disti GhostBSD.pngWiki
This page is in maintenance!
Please do not change this page without to contact the author or use Discussion!

Introduction

pkg is the next generation replacement for the traditional FreeBSD package management tools, offering many features that make dealing with binary packages faster and easier. [1]

The package manager pkg is a powerful tool to manipulate pre-compiled copies of all the commands for an application, as well as any configuration files and documentation.

While the two technologies ports and packages are similar, each have their own strengths. Select the technology that meets your requirements for installing a particular application. Package Benefits

  • A compressed package tarball is typically smaller than the compressed tarball containing the source code for the application.
  • Packages do not require compilation time. For large applications, such as Mozilla, KDE, or GNOME, this can be important on a slow system.
  • Packages do not require any understanding of the process involved in compiling software on FreeBSD.

Sorce: 4.2. Overview of Software Installation

Function and Examples

A package can be manipulated with the pkg(8) commands, such as pkg install.

pkg only works with binary packages. By default, pkg uses the binary packages from the GhostBSD/TrueOS package mirrors. "GhostBSD now use TrueOS packages base from ports" [2].

Each pkg command argument is documented in a command-specific manual page. To read the manual page for pkg install, for example, run either of these commands:

# pkg help install

or

# man pkg-install

Installing Packages

To install a binary package use the following command, where packagename is the name of the package to install:

# pkg install packagename

This command uses repository data to determine which version of the software to install and if it has any uninstalled dependencies.

Removing Packages

Packages that are no longer needed can be removed with pkg delete. For example:


# pkg delete packagename

Upgrading Installed Packages

Installed packages can be upgraded to their latest versions by running:

# pkg upgrade

This command will compare the installed versions with those available in the repository catalogue and upgrade them from the repository.

Auditing Installed Packages

Software vulnerabilities are regularly discovered in third-party applications. To address this, pkg includes a built-in auditing mechanism. To determine if there are any known vulnerabilities for the software installed on the system, run:

# pkg audit -F

Automatically Removing Unused Packages

Removing a package may leave behind dependencies which are no longer required. Unneeded packages that were installed as dependencies (leaf packages) can be automatically detected and removed using:

# pkg autoremove

For more Information read