Pkgng: Difference between revisions

From wikinotes
 
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
Originally the selling point of PKGNG (package next-generation), was  
FreeBSD's package manager.
 
Originally the selling point of PKGNG (package next-generation), was
allowing users to use a mix of binary packages and ports. This is not the
allowing users to use a mix of binary packages and ports. This is not the
case, but you can compile your own packages to install on all machines.
case, but you can compile your own packages to install on all machines.
Line 18: Line 20:
pkg install -y <pkg>  # install package without interactive confirmation
pkg install -y <pkg>  # install package without interactive confirmation


pkg info              # show all installed packages
pkg info <pkg>        # info about INSTALLED package
pkg info <pkg>        # info about INSTALLED package
pkg info -r <pkg>    # list packages that depend on pkg


pkg delete <pkg>      # uninstall package
pkg delete <pkg>      # uninstall package
Line 47: Line 51:


</blockquote><!-- Install -->
</blockquote><!-- Install -->
= Installing old package versions =
<blockquote>
<syntaxhighlight lang="bash">
cd /var/cache/pkg
sudo pkg install py39-salt-3006.5.pkg  # some file in repo
</syntaxhighlight>
</blockquote><!-- Installing old package versions -->


= Alternative Repositories =
= Alternative Repositories =
Line 60: Line 72:
I ran into an issue with saltstack pushing updates to pkg which broke it. This enabled
I ran into an issue with saltstack pushing updates to pkg which broke it. This enabled
me to disable the updates.
me to disable the updates.
</blockquote><!-- Alternative Repositories -->


</blockquote><!-- Alternative Repositories -->
= Troubleshooting =
<blockquote>
If, on kernel-updates you have issues, or you need to reinstall all packages:
 
<syntaxhighlight lang="bash">
pkg-static install -f pkg  # force reinstall pkg
pkg upgrade -f            # reinstall all packages
</syntaxhighlight>
</blockquote><!-- Troubleshooting -->

Latest revision as of 23:55, 18 February 2024

FreeBSD's package manager.

Originally the selling point of PKGNG (package next-generation), was allowing users to use a mix of binary packages and ports. This is not the case, but you can compile your own packages to install on all machines.

Documentation

binary packages http://pkg.freebsd.org/

CheatSheet

pkg install    <pkg>  # install package
pkg install -y <pkg>  # install package without interactive confirmation

pkg info              # show all installed packages
pkg info <pkg>        # info about INSTALLED package
pkg info -r <pkg>     # list packages that depend on pkg

pkg delete <pkg>      # uninstall package
pkg autoremove        # delete uneeded deps

pkg update            # update package index

pkg clean             # remove compiled/uneeded binaries
pkg lock/unlock       # pin packages so they are not updated

Install

cd /usr/ports/ports-mgmt/pkgng
make install

Force Update to latest

pkg clean                    # cleans /var/cache/pkg/
rm -rf /var/cache/pkg/*      # just remove it all
pkg update -f                # forces update  of repository catalog
rm /var/db/pkg/repo-*.sqlite # removes all remote repository catalogs
pkg bootstrap -f             # forces reinstall of pkg

Installing old package versions

cd /var/cache/pkg
sudo pkg install py39-salt-3006.5.pkg  # some file in repo

Alternative Repositories

/etc/pkg/FreeBSD.conf/ main freebsd repo
/usr/local/etc/pkg/repos/*.conf alternative freebsd repos

I ran into an issue with saltstack pushing updates to pkg which broke it. This enabled me to disable the updates.

Troubleshooting

If, on kernel-updates you have issues, or you need to reinstall all packages:

pkg-static install -f pkg  # force reinstall pkg
pkg upgrade -f             # reinstall all packages