Can't find the location /usr/ports/

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
 
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
 
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:

Frequently asked questions

A book of answers: <https://docs.freebsd.org/en/books/faq/>
 
  • Like
Reactions: mer
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
 
  • Like
Reactions: mer
… 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.

1643536760645.png 1643538060210.png

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.)
 
… 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:
  1. ee /boot/loader.conf
  2. 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.

1643537361346.png 1643537393879.png

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
 
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.
 
ဖ… 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
 
My question is more "How to know exactly all that default modules/packages that can be impacted by a vulnerability on the default system ?"
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).
 
  • Like
Reactions: mer
… "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:

1644224052637.png


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.
 
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.

 
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
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 .
 
Back
Top