If pkg
is the fast-food way to install apps, then Ports Collection is the professional chef's method — you're building the software from raw ingredients, aka source code! Exciting, right? Perfect for tinkerers, customizers, or people who just want to brag, "I compiled it myself, bro!"
What is the Ports Collection?
The FreeBSD Ports Collection is a system that lets you compile and install software from source code easily. You just enter a directory, type make install clean
, and boom, your app is installed!
Setting Up the Ports Tree
Ports aren't always installed by default. But you can fetch them with:
portsnap fetch
portsnap extract
If you already have it and want to update:
portsnap fetch update
The Ports tree will be located in:
/usr/ports
Inside? Thousands of application categories — from browsers, servers, games, to text editors.
Searching for Applications in Ports
To search manually:
cd /usr/ports
make search name=app_name
Example:
make search name=vim
Or, for a faster option:
pkg search vim
Then match the result with the correct location under /usr/ports
.
Installing Applications from Ports
Let’s say you want to install htop
, just do:
cd /usr/ports/sysutils/htop
make install clean
This command will:
- Download the source code
- Compile it
- Install it
- Clean up the build files afterward
Heads up: This can take time depending on the app size and your computer's horsepower. Don’t blame the CPU if it starts wheezing.
Customize the Build (Make Options)
One of Ports’ biggest advantages: You can enable or disable features before building!
cd /usr/ports/editors/nano
make config
A menu will pop up with checkboxes. Choose the features you want before running make install
.
Uninstalling Applications from Ports
Had enough?
cd /usr/ports/sysutils/htop
make deinstall
Or use pkg delete
, since even Ports-installed apps are tracked by pkg
.
Pro
-
Avoid modifying ports directly under
/usr/ports
if you update frequently — use portmaster or poudriere for safer, smarter builds. -
If you're on a weak machine (like a potato-tier laptop), it's better to stick with
pkg
— way faster and less stressful.
Method | Advantages | Drawbacks |
---|---|---|
pkg |
Fast, easy, ready to use | Less flexibility |
ports |
Customizable, source-based | Slower, requires compilation |
So, if you love tweaking things, want full control over features, or just want that build-it-yourself experience like a true OS ninja, the Ports Collection is your best friend
0 Comments:
Post a Comment