FreeBSD jail里面pkg 无法update、search和install

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 ,哇,竟然成功了!所以大约算是用源码编译安装的方法解决了问题。

另外可以在宿主机通过jexec指令来执行jail子系统里的pkg命令,比如

复制代码
jexec fb12 pkg search wget
pkg: No SRV record found for the repo 'FreeBSD'
wget-1.24.5                    Retrieve files from the Net via HTTP(S) and FTP
wget2-2.1.0_1                  File and recursive website downloader
wgetpaste-2.34                 Paste to several pastebin services via bash script
相关推荐
灯澜忆梦36 分钟前
【docker】#2 | 基础命令
docker·容器·eureka
Pocker_Spades_A5 小时前
Penpot自托管设计协作:Docker部署、MCP接入与Codex生成UI实操记录
ui·docker·容器
sbjdhjd20 小时前
云安全 | Docker 容器逃逸复盘(三):docker.sock 挂载与 Docker-in-Docker 风险
经验分享·网络安全·docker·云原生·容器·kubernetes·云安全
热爱Liunx的丘丘人20 小时前
1、什么是K8s
云原生·容器·kubernetes
帷幕落秋1 天前
Docker的两种安装
运维·docker·容器
fengkai45451 天前
十二、Redis -2
运维·数据库·redis·容器
DolitD1 天前
3D应用多实例并发中的GPU隔离技术路径分析
容器·gru·接口隔离原则
姜鱼问生1 天前
docker exec 排查容器问题:从日志到进程
运维·网络·数据库·docker·容器
小匠石钧知1 天前
07_在k8s集群中安装ingress-nginx
nginx·容器·kubernetes·ingress