FreeBSD里使用CBSD创建了一个jail, jail里面pkg 命令可以用,但是不管发什么命令,都会提示更新pkg,按Y确认更新,
更新完之后就退出。
再发pkg命令,又是同样提示更新pkg,导致无法pkg search ,无法pkg update,更无法pkg install git
使用ports安装
cd /usr/ports/ports-mgmt/pkg && make install
报错:
===>  Installing for pkg-1.21.3
 ===>  Checking if pkg is already installed
 ===>   pkg-1.21.3 is already installed
       You may wish to ``make deinstall'' and install this port again
       by ``make reinstall'' to upgrade it properly.
       If you really wish to overwrite the old port of pkg
       without deleting it first, set the variable "FORCE_PKG_REGISTER"
       in your environment or the "make install" command line.
 *** Error code 1
  
按照提示输入
make deinstall ; make reinstall还是报错已经安装了pkg
这时候再执行pkg install git ,哇,竟然成功了!