# Can't find the location /usr/ports/



## Dasiterp (Jan 30, 2022)

Hi, I I'm new on FreeBSD, and my goal is to list all the default packages on the system.


I installed "pkg" and when I try to list all the default packages with "prime-list" or something like this I only have pkg-1.5.... listed
I read everything was located in /usr/ports/, but when I try to access this directory I got and error "not found"...

I'm using FreeBSD 13.0 the latest ISO available on download for VirtualBox

Is somebody know how to list or access all the default packages ? What am I doing wrong ?
Thanks


----------



## im (Jan 30, 2022)

Dasiterp said:


> my goal is to list all the default packages on the system


The minimal FreeBSD installation has no default packages.
The minimal set of files usually named as FreeBSD-base and provided as-is as a single set, without any packages.

What about ports:
ports(7) is an optional component, and it probably was not selected during install process.

You can try to download ports using the commands:
`portsnap fetch
portsnap extract`

Read the manual, *4.5.1. Installing the Ports Collection*








						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




					docs.freebsd.org


----------



## grahamperrin@ (Jan 30, 2022)

Welcome to FreeBSD Forums.

The /usr/ports directory is required only if you want to build software for yourself. As a newcomer, you're unlikely to want this.

Instead, try the command below. As the root user. If a superior version of *pkg* is available, it will automatically download and update itself; then there'll be installation of *tree*:

`pkg install sysutils/tree`

Next:

`tree | less`

– then tap the space bar, repeatedly, until you get bored with viewing the tree of what's on disk. When you get bored, key:

*q*​
FreshPorts is our friend

For example, <https://www.freshports.org/sysutils/tree/> – there's a great deal of information about each _port_.

Packages are the simple approach to installation of software that has been _ported_ to FreeBSD.

The *#add* part of each FreshPorts page for a port focuses on how a package can be added. Examples:

<https://www.freshports.org/sysutils/tree/#add>
<https://www.freshports.org/editors/nano/#add>

Frequently asked questions

A book of answers: <https://docs.freebsd.org/en/books/faq/>


----------



## zirias@ (Jan 30, 2022)

I suspect you don't even want/need ports right now. Packages are built from ports using default build options, so you just want to install some packages.

`pkg prime-list` lists the packages you explicitly installed on your machine. If you didn't install any yet, it will only list pkg itself.

Just install some with `pkg install`. You can search for packages with `pkg search`. You can also browse ports/packages online on https://freshports.org


----------



## Friend Of Jolly Devil (Jan 30, 2022)

Dasiterp said:


> Hi, I I'm new on FreeBSD, and my goal is to list all the default packages on the system.



FreeBSD is not */Linux, it doesn't have any packages installed by default, only the base system, that's why your list is empty.


----------



## grahamperrin@ (Jan 30, 2022)

Friend Of Jolly Devil said:


> … doesn't have any packages installed by default, only the base system, that's why your list is empty.



Not _quite_.

`pkg prime-list` can not produce a list until after pkg is installed.


 

*Postscript*: Friend Of Jolly Devil sorry, the second screenshot above was a late addition. (I was busy capturing a shot of the file system bug, see below.)


----------



## Friend Of Jolly Devil (Jan 30, 2022)

Dasiterp said:


> I installed "pkg"


This.


----------



## grahamperrin@ (Jan 30, 2022)

Dasiterp said:


> … FreeBSD 13.0 the latest ISO available on download for VirtualBox …



If that was FreeBSD-13.0-RELEASE-amd64.vhd.xz (the .vhd for VirtualBox) …

Forewarnings (sorry, in at the deep end):

you might find that FreeBSD panics (crashes), repeatedly, at startup
there's a file system bug with this particular virtual disk image.
To avoid the first problem:

`ee /boot/loader.conf`
add the line below, then save the file.
`kern.smp.disabled=1`

There's no user-friendly workaround for the second problem, which is pictured below.

Better:

discard the virtual machine and the FreeBSD-provided vhd file
download an installer, instead of a virtual disk image
create a new virtual machine, use the installer, choose ZFS instead of UFS.

 

FreeBSD bug 259090 – UFS: bad file descriptor: soft update journaling can not be enabled on FreeBSD-provided disk images for 13.0-RELEASE and 13.0-STABLE – failed to write updated cg


----------



## Dasiterp (Feb 7, 2022)

Thank very much everybody for all your answers.

But, there should exist a list of default "modules/packages" installed by default somewhere ? For example IPV6 from the kernel, or openSSL module, etc

https://www.freebsd.org/security/advisories/FreeBSD-SA-20:24.ipv6.asc
https://www.freebsd.org/security/advisories/FreeBSD-SA-21:03.pam_login_access.asc

I checked, openSSL is available by default if you write it in the terminal

My question is more "How to know exactly all that default modules/packages that can be impacted by a vulnerability on the default system ?"
In the core or in openSSL for example

And is somebody know if Freshport is giving a list of all the packages existing ? because I found only this "https://www.freshports.org/categories.php", but it would be better if there is a text file on Github or somewhere else with all available packages.


----------



## grahamperrin@ (Feb 7, 2022)

Dasiterp said:


> ဖ… a list of all the packages existing ? …



Good question. It should be added to the book.

FreeBSD bug 247998 – pkg.freebsd.org subfolders indexes are forbidden was _not a bug_;



> … generation of these indexes was causing excessive CPU load on the servers.
> 
> The pkg mirrors are not meant to be used in this way. …



I should not expect FreshPorts to provide anything like equivalent indices or listings for the gamut of supported platforms.


FreeBSD bug 261765 – FAQ: ports: explain that there is no FreeBSD-provided human-readable list/index of all ports (or all packages) for any platform


----------



## zirias@ (Feb 7, 2022)

Dasiterp said:


> My question is more "How to know exactly all that default modules/packages that can be impacted by a vulnerability on the default system ?"





Friend Of Jolly Devil said:


> it doesn't have any packages installed by default



Just in case: *There are no "default packages"* on FreeBSD. There's a base system, which is a single project and source tree.

For completeness: There are attempts to build packages out of the base system, called pkg-base. It's not official yet. Benefit would be that you could only install what you want without compiling yourself.

edit, about pkg-base, there's not THAT much to gain anyways. Sure, there are some components in base not everyone will use (e.g. sendmail), but you will need _most_ of them anyways to have a working system. That's the whole point of a full operating system, there's a single source tree containing everything, and that's btw the traditional Unix way. GNU/Linux is the "exotic" thing here, as it's built by combining bits and pieces from many more-or-less unrelated projects. That's why you can't have a GNU/Linux system without a distribution (or a LOT of manual work).


----------



## grahamperrin@ (Feb 7, 2022)

Dasiterp said:


> … "modules/packages" installed by default …



For FreeBSD 13.0-RELEASE-p7, on AMD64, some of this type of information can be inferred from names of files at e.g. <https://alpha.pkgbase.live/release/FreeBSD:13:amd64/13.0p7/>

For something more definite (not inference), we have comments in packagesite.yaml in packagesite.tzst, for example: 





Afterthought: the debug packages in base might be installed by default but not active by default, depending on which kernel is chosen at boot time. I haven't paid attention to PkgBase for a while.


----------



## mer (Feb 7, 2022)

Dasiterp said:


> My question is more "How to know exactly all that default modules/packages that can be impacted by a vulnerability on the default system ?"


Minor bit of work, but easily done:
freebsd-version -kru
That will tell you the exact version of the kernel (installed and currently running) and userland you are running.
Goto to the project home page and look at the "Security Advisories".  Look at the "Corrected" section.  If your freebsd-version is not at least the version under "Corrected" you should update.









						The FreeBSD Project
					

FreeBSD is an operating system used to power modern servers, desktops, and embedded platforms.




					www.freebsd.org


----------



## grahamperrin@ (Feb 7, 2022)

FreeBSD Patch Level Table ▶<https://bokut.in/freebsd-patch-level-table/#releng/13.0>

More officially, subscription to this list should be a requirement: <https://lists.freebsd.org/subscription/freebsd-announce>


----------



## mer (Feb 7, 2022)

Yep, the security/security-notifications are also good ones to follow/subscribe too.


----------



## ondra_knezour (Feb 7, 2022)

Dasiterp said:


> How to know exactly all that default modules/packages that can be impacted by a vulnerability on the default system ?


Don't be on constant lookout for errors in any system component, let machines do the work for you and only read results  security/base-audit


Dasiterp said:


> And is somebody know if Freshport is giving a list of all the packages existing ?


Not exactly elegant, but this may work for you `pkg search .`


----------

