# new freebsd 12.1 trying to get it going.



## billcu (May 16, 2020)

Can you just use pkg and not mess with portsnap? Portsnap downloads a bunch of stuff I don't want. And it takes forever to install ports. I have just started using this with virtual machine. I also want to install bind. pkg doesn't know where it is and portsnap doesn't either without "index-12" whatever that does. I have the 12.1 disc version.


----------



## digifuzzy (May 16, 2020)

My recent experience with pkg was positive. Everything was there and with sane defaults. 
Do the first `pkg update` command to get stuff going. Then go wild. 

I had a computer course that actually had in the notes:


> If you haven't blown up an operating system lately, you're not trying hard enough.


caveat emptor YMMV


----------



## a6h (May 16, 2020)

Update the base
`freebsd-update fetch install`
Use the pkg() to install everything.
Keep packages up to date
`pkg upgrade`
Audit installed packages from time to time
`pkg audit -F`
Maintain a fresh copy of ports tree
`portsnap fetch update`
*WHY? *Because in rare cases you have to build some ports from the ports tree. e.g.
Last time I had to install graphics/drm-fbsd12.0-kmod from ports tree
`cd /usr/ports/graphics/drm-fbsd12.0-kmod`
`make install clean`
Do not mix the ports and packages, unless in very rare cases, like above example, in which the build does not install a bag of dependencies.
By default packages are fetch and installed from the quarterly repository which is not the latest version of ports.
Therfore if you have problem with installed version, you can change the repository from quarterly to latest
`mkdir -p /usr/local/etc/pkg/repos`
`cp /etc/pkg/FreeBSD.conf /usr/local/etc/pkg/repos`
Edit the /usr/local/etc/pkg/repos/FreeBSD.conf and change *quarterly* to *latest*

```
FreeBSD: { url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest",
mirror_type: "srv",
signature_type: "fingerprints",
fingerprints: "/usr/share/keys/pkg",
enabled: yes
}
```
`pkg update -f`


----------



## billcu (May 17, 2020)

vigole said:


> Update the base
> `freebsd-update fetch install`
> Use the pkg() to install everything.
> Keep packages up to date
> ...


So there's really no way out of that "extract" taking forever? I thought it all could be done with pkg.


----------



## getopt (May 17, 2020)

Looks like you need to read








						Chapter 4. Installing Applications: Packages and Ports
					

FreeBSD provides two complementary technologies for installing third-party software: the FreeBSD Ports Collection, for installing from source, and packages, for installing from pre-built binaries




					www.freebsd.org
				




If you choose Pkg to install binaries from a repository you don't need a ports-tree and therefore you dont't need Portsnap. If you ever need something like INDEX-* in /usr/ports/ you can fetch like this:


```
cd /usr/ports
fetch https://www.FreeBSD.org/ports/INDEX-12.bz2
bunzip2 INDEX-12.bz2
```
If you have an uptodate  INDEX-*  you can do i.e. `pkg version vL=` without having a complete ports tree installed.

If you want to build from ports yourself and you do not like Portsnap, you can use Subversion instead.


----------



## billcu (May 19, 2020)

billcu said:


> So there's really no way out of that "extract" taking forever? I thought it all could be done with pkg.


This is the first time I have seen a "freebsd-update" option, or command. It's usually pkg something or portsnap something. I am interested in using Bind though. The ports or pkg doesn't seem to have as I can see a package.


----------



## billcu (May 19, 2020)

getopt said:


> Looks like you need to read
> 
> 
> 
> ...


OK I can look into the subversion options. I don't like the portsnap tree if I can avoid it. It takes so long to download and seems more complicated that the pkg option.


----------



## Sevendogsbsd (May 19, 2020)

`freebsd-update` is to update the base OS, not any of the ports or packages. FreeBSD separates end user installed software from the base OS and has a separate set of tools to manage each. Unlike Linux, which just munges everything together...

EDIT - as a new user, just use pkg. So much easier. Once you get more experienced and want to try them, change over to ports. Try not to mix them or you will most likely have issues because of dependency versions. In the end, they are the same, with the exception being ports are slightly newer and you get to choose the build options.


----------



## ondra_knezour (May 20, 2020)

billcu said:


> I am interested in using Bind though. The ports or pkg doesn't seem to have as I can see a package.




```
pkg search bind9
bind9-devel-9.17.0.a0.2020.03.30 BIND DNS suite with updated DNSSEC and DNS64
bind911-9.11.18                BIND DNS suite with updated DNSSEC and DNS64
bind914-9.14.11                BIND DNS suite with updated DNSSEC and DNS64
bind916-9.16.2                 BIND DNS suite with updated DNSSEC and DNS64
```


----------

