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
相关推荐
@hdd4 小时前
实战:在 Kubernetes 上部署微服务应用
微服务·容器·kubernetes
Elastic 中国社区官方博客9 小时前
在 Kubernetes 上的依赖管理
大数据·elasticsearch·搜索引擎·云原生·容器·kubernetes·全文检索
星星乘坐的船10 小时前
Centos7.9系统下docker安装
运维·docker·容器
Elastic 中国社区官方博客12 小时前
Agentic CI/CD:使用 Kubernetes 部署门控,结合 Elastic MCP Server
大数据·人工智能·elasticsearch·搜索引擎·ci/cd·容器·kubernetes
切糕师学AI12 小时前
Kubernetes 中的 StatefulSet
云原生·容器·kubernetes
阿乐艾官13 小时前
【K8s思维导图及单节点容器启动流程】
java·容器·kubernetes
礼拜天没时间.13 小时前
企业级Docker镜像仓库Harbor部署实战
linux·运维·docker·云原生·容器·sre
DeeplyMind14 小时前
第27章 常见问题与解决方案
运维·docker·容器
nix.gnehc15 小时前
深入浅出 K8s 内外部通信:全场景方案解析与生产实践
云原生·容器·kubernetes
DeeplyMind15 小时前
第26章 Docker监控与日志
docker·容器·eureka