[FreeBSD] Setting up pkgng - BSD

Users browsing this thread: 2 Guest(s)
Amzo
Members
Pkg 1.0 is out now! The betas and RCs are over, say hello to the first release!


You may, or may not have heard of the introduction of FreeBSD's new package manager, which is a huge improvement of the old pkg-* tools.

What is pkgng?

Quote:pkgng is:

a replacement for pkg_* tools
a tool to query/manage installed packages
a tool to deal with binary packages
a tool to upgrade/install packages from a remote repository
a library that provides all the package management in a safe way so one can write a new frontend

INSTALLING:

To install pkgng, you can install directly from the ports tree:

Code:
cd /usr/ports/ports-mgmt/pkg; make install clean

Once installed, you'll need to setup the config.

Code:
mv /usr/local/etc/pkg.conf.sample /usr/local/etc/pkg.conf

the config won't need any editing, it already has a repo setup for it now.

REPO UPDATE:

To update the repo.

PHP Code:
pkg update 

If you've been installing from ports or using the old pkg-* tools. You should register all installed packages in the new database.

PACKAGE REGISTRATION:

Code:
sudo /usr/local/sbin/pkg2ng

This may take awhile depending on how many packages you have installed.

PACKAGE SEARCHING:

Code:
pkg search packagesname

PHP Code:
[amzo@Bahamut ~]$ pkg search slim
slim
-1.3.4_2                   Graphical login manager for X11derived from Login.app 

PACKAGE INSTALLATION:

Code:
sudo pkg install packagename

PHP Code:
[amzo@Bahamut ~]$ sudo pkg install slim
Updating repository catalogue
Repository catalogue is up
-to-dateno need to fetch fresh copy
The following packages will be installed
:

    
Installing pkgconf0.8.5
    Installing perl
5.14.2_2
    Installing slim
1.3.4_2

The installation will 
require 48 MB more space

4 MB to be downloaded

Proceed with installing packages 
[y/N]: 

READING PKGUPDATING:

It is still recommended to read updating when upgrading ports, to solve issues.

PHP Code:
pkg updating pkg-config
20120726
:
  
AFFECTSusers of devel/pkg-config
  AUTHOR
bapt@FreeBSD.org

  devel
/pkg-config has been replaced by devel/pkgconf

  
# portmaster -o devel/pkgconf devel/pkg-config
  
or
  
# portupgrade -fo devel/pkgconf pkg-config-\*

  
pkgng:
  
# pkg set -o devel/pkg-config:devel/pkgconf
  # pkg install -f devel/pkgconf 

PHP Code:
sudo pkg set -o devel/pkg-config:devel/pkgconf
Change origin from devel
/pkg-config to devel/pkgconf for pkg-config-0.25_1? [y/N]: 

PHP Code:
sudo pkg install -f devel/pkgconf
Updating repository catalogue
Repository catalogue is up
-to-dateno need to fetch fresh copy
The following packages will be installed
:

    
Downgrading pkg-config0.25_1 -> 0.8.5

The installation will free 160 kB

0 B to be downloaded

Proceed with installing packages 
[y/N]: y
Checking integrity
... done
Downgrading pkg
-config from 0.25_1 to 0.8.5... done 

VERSION CHECKING:

PHP Code:
pkg version
ORBit2
-2.14.19                     =
Terminal-0.4.8                     <
Thunar-1.2.3                       

UPGRADING:

PHP Code:
sudo pkg upgrade
Updating repository catalogue
Repository catalogue is up
-to-dateno need to fetch fresh copy
The following packages will be upgraded
:

    
Upgrading libiconv1.13.1_1 -> 1.14
    Upgrading xlockmore
5.34 -> 5.40
    Upgrading xorg
-minimal7.5.1 -> 7.5.2

The installation will 
require 459 MB more space

125 MB to be downloaded

Proceed with upgrading packages 
[y/N]: 

I removed loads of package names from the list, the size needed to download is correct. :p

DELETE PACKAGES:

NOTE: WILL UPDATE AND COLORISE IN AN HOUR OR SO, GOTTA GO OUT so just posting what I've done so far. Screw saving drafts.
FreeBSD
Long time nixers
I also book marked and will use a bit later! Thanks!
I do Byte
zygotb
Long time nixers
I don't have a "pkg" directory under /usr/ports/ports-mgmt/
When I cd /usr/ports/ports-mgmt/pkg
I get an error: "No such file or directory."

I'm using FreeBSD 9 RELEASE

What dumb mistake am I making?
Someone doesn't appreciate my php generated image!
Amzo
Members
(19-10-2012, 08:55 AM)29a Wrote: I don't have a "pkg" directory under /usr/ports/ports-mgmt/
When I cd /usr/ports/ports-mgmt/pkg
I get an error: "No such file or directory."

I'm using FreeBSD 9 RELEASE

What dumb mistake am I making?



Did you run a:

portsnap fetch extract?
zygotb
Long time nixers
(19-10-2012, 03:07 PM)NeoTerra Wrote:
(19-10-2012, 08:55 AM)29a Wrote: I don't have a "pkg" directory under /usr/ports/ports-mgmt/
When I cd /usr/ports/ports-mgmt/pkg
I get an error: "No such file or directory."

I'm using FreeBSD 9 RELEASE

What dumb mistake am I making?

Did you type everything perfectly? Happens to me where I'll type the name of something but forget a hyphen or something silly like that.

Nope... I have no "pkg" subdirectory under "/usr/ports/ports-mgmt/"
Someone doesn't appreciate my php generated image!
yebyen
Registered
(19-10-2012, 07:11 PM)29a Wrote:
(19-10-2012, 03:07 PM)NeoTerra Wrote:
(19-10-2012, 08:55 AM)29a Wrote: I don't have a "pkg" directory under /usr/ports/ports-mgmt/
When I cd /usr/ports/ports-mgmt/pkg
I get an error: "No such file or directory."

I'm using FreeBSD 9 RELEASE

What dumb mistake am I making?

Did you type everything perfectly? Happens to me where I'll type the name of something but forget a hyphen or something silly like that.

Nope... I have no "pkg" subdirectory under "/usr/ports/ports-mgmt/"

then... you haven't updated your local ports tree

portsnap fetch update
or if you've never done it before, more likely
portsnap fetch extract

Since I haven't seen it mentioned already, you're going to have problems with whatever tool you're used to using for compiling and upgrading ports (for me it was portmaster) unless you

cd /usr/ports/ports-mgmt/portmaster
make deinstall clean
make config
make install

and enable the PKGNG patch in the config step.