Skip to content

FreeBSD system update and package installation

一、系统更新

freebsd-update fetch
freebsd-update install

二、源码编译安装软件包

1、取回port源、解压、更新

portsnap fetch
portsnap extract
portsnap update

更新后软件包列表在/usr/ports/目录中

2、查询软件包

cd /usr/ports/
make search name=软件名
make quicksearch name=软件名

3、安装软件包

cd /usr/ports/www/firefox
make install firefox

4、卸载软件包

cd /usr/ports/www/firefox
make deinstall firefox

与yum、apt-get、aptitude不同,该种BSD软件安装为编译安装,时间比较长。

存在依赖的包,在安装过程中会弹出蓝色选择安装界面。

四、pkg方式安装软件包

(类似yum、apt-get、aptitude)

pkg update
pkg upgrade
pkg install 软件名

参考资料

  • https://docs.freebsd.org/zh_CN/books/handbook/updating-upgrading.html

Disclaimer
  1. License under CC BY-NC 4.0
  2. Copyright issue feedback me#imzye.me, replace # with @
  3. Not all the commands and scripts are tested in production environment, use at your own risk
  4. No privacy information is collected here
Try iOS App