Difference between revisions of "Pkg"

From GhostBSD Wiki
Jump to: navigation, search
Line 1: Line 1:
 
{{:Navbar Application Management}}
 
{{:Navbar Application Management}}
  
== Differences between pkg (old version) and pkgng (new generation) ==
+
== Explanation ==
  
If you like to know more about the differences between pkg (old version) and pkgng (new generation) please look in the [https://wiki.freebsd.org/PkgPrimer FreeBSD Wiki]
+
For beginners with GhostBSD it is a bit confusing which package manager is now working on my computer.
  
== Introduction ==
+
For now '''pkgng''' is like a synonym for '''pkg'''. 
  
'''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. [[File:Icon FreeBSD.png|50px|link=https://www.freebsd.org/doc/handbook/pkgng-intro.html]]
+
It describes, that the package manager '''pkgng'''   is a new  version and designed to work with versions of FreeBSD starting with 10.X. [https://www.freebsd.org/doc/handbook/pkgng-intro.html see also 4.4.1. Getting Started with pkg on the FreeBSD Handbook]
  
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.
+
That means:
  
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.
+
To install a package '''with the older version of pkg''' you had to write:
Package Benefits
+
<code>pkg_add package name</code>
 +
With the '''new generation of pkg''' you have to write:
 +
<code>pkg install package name</code> 
  
* 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.
+
== More Differences between pkg and pkgng ==
  
* Packages do not require any understanding of the process involved in compiling software on FreeBSD.
+
If you like to know more about the differences between pkg (old version) and pkgng (new generation) please look in the [https://wiki.freebsd.org/PkgPrimer FreeBSD Wiki]
 
+
Sorce: [[File:Icon FreeBSD.png|50px|link=https://www.freebsd.org/doc/handbook/ports-overview.html]]'''Handbook: 4.2. Overview of Software Installation'''
+
 
+
== Function and Examples ==
+
 
+
A package can be manipulated with the [https://www.freebsd.org/cgi/man.cgi?query=pkg&sektion=8&manpath=freebsd-release-ports 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." See: [https://ghostbsd.org/19.09_release_announcement What changed since 19.04].
+
 
+
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:
+
 
+
<code># pkg help install</code>
+
 
+
or
+
 
+
<code># man pkg-install</code>
+
 
+
===Installing Packages===
+
 
+
To install a binary package use the following command, where packagename is the name of the package to install:
+
 
+
<code># pkg install packagename</code>
+
 
+
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>
+
 
+
===Repositories===
+
 
+
The pkg mirrors are located in
+
* in France: <code>http://pkg.fr.ghostbsd.org/stable/FreeBSD:12:amd64/</code>
+
* in Canada: <code>http://pkg.ghostbsd.org/stable/FreeBSD:12:amd64/</code>
+
* in US:  <code>http://pkg.us.ghostbsd.org/stable/FreeBSD:12:amd64/</code>
+
 
+
For upgrading your system chose the nearest mirror to your location.
+
 
+
To change the mirror go to the file <code>/usr/local/etc/pkg/repos/GhostBSD.conf</code> and change the URL.
+
 
+
== For more Information ==
+
  
Source: *[https://www.freebsd.org/doc/handbook/pkgng-intro.html FreeBSD Handbook/chapter 4.4. Using pkg for Binary Package Management]
 
  
  

Revision as of 17:17, 8 January 2020

Application Management
pkg Software Station Update Station Ports Applications
Back to the Icon Disti GhostBSD.pngWiki

Explanation

For beginners with GhostBSD it is a bit confusing which package manager is now working on my computer.

For now pkgng is like a synonym for pkg.

It describes, that the package manager pkgng is a new version and designed to work with versions of FreeBSD starting with 10.X. see also 4.4.1. Getting Started with pkg on the FreeBSD Handbook

That means:

To install a package with the older version of pkg you had to write:

pkg_add package name

With the new generation of pkg you have to write:

pkg install package name  


More Differences between pkg and pkgng

If you like to know more about the differences between pkg (old version) and pkgng (new generation) please look in the FreeBSD Wiki