<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>https://jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>https://jackxiang.com/post//</link>
<title><![CDATA[[实践OK]pkg install lsof -y无法安装和pkg install -y lsof是有区别的，FreeBSD中安装pkg,pkg_add已经改用pkg了，怎样查询一个文件属于哪个ports包，类似CentOS里面的rpm -qf file反查在哪你上rpm包里面一样的命令是pkg which /usr/local/lib/libicuio.so.58]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[Unix/LinuxC技术]]></category>
<pubDate>Wed, 26 Feb 2020 16:33:14 +0000</pubDate> 
<guid>https://jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	查看pkg的依赖：<br/>pkg info -r python39<br/>python39-3.9.18_2:<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;git-2.45.1<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;py39-pip-23.3.2_1<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;py39-setuptools-63.1.0_1<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vim-9.1.0158<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vim-9.1.0158 (libpython3.9.so.1.0)<br/>我还要用git client端呢，是否不能删除啊，还有vim<br/><br/>是「硬依赖」，不是“可选依赖”<br/>你的输出是：<br/>python39-3.9.18_2:<br/>&nbsp;&nbsp;&nbsp;&nbsp;git-2.45.1<br/>&nbsp;&nbsp;&nbsp;&nbsp;py39-pip-23.3.2_1<br/>&nbsp;&nbsp;&nbsp;&nbsp;py39-setuptools-63.1.0_1<br/>&nbsp;&nbsp;&nbsp;&nbsp;vim-9.1.0158<br/>&nbsp;&nbsp;&nbsp;&nbsp;vim-9.1.0158 (libpython3.9.so.1.0)<br/>关键点只有一个（但非常致命）：<br/>vim-9.1.0158 (libpython3.9.so.1.0)<br/>这意味着：<br/>vim 在编译时启用了 Python3 支持<br/>并且 动态链接到 python39 的共享库<br/>一旦你删了 python39：<br/>vim: Shared object &quot;libpython3.9.so.1.0&quot; not found<br/>👉 vim 直接起不来<br/>👉 git 也会连带出问题（git 自身及其 hooks / helpers）<br/>✅ 方案 A（强烈推荐）：保留 python39，但“逻辑上不用它”<br/>这是最稳、最省事、最符合你当前使用模式的方案。<br/><br/><br/>不小心升级了curl、wget、vim后无法加载，出现：<br/>curl: try &#039;curl --help&#039; or &#039;curl --manual&#039; for more information<br/>ld-elf.so.1: /usr/local/bin/curl: Undefined symbol &quot;curl_mime_free&quot;<br/><textarea name="code" class="php" rows="15" cols="100">
sudo pkg fetch vim-8.2.3458
Updating FreeBSD repository catalogue...
Fetching meta.conf: 100%&nbsp;&nbsp;&nbsp;&nbsp;178 B&nbsp;&nbsp; 0.2kB/s&nbsp;&nbsp;&nbsp;&nbsp;00:01&nbsp;&nbsp;&nbsp;&nbsp;
Fetching packagesite.pkg: 100%&nbsp;&nbsp;&nbsp;&nbsp;7 MiB 471.0kB/s&nbsp;&nbsp;&nbsp;&nbsp;00:16&nbsp;&nbsp;

scp /var/cache/pkg/vim-8.2.2725~b219565139.txz&nbsp;&nbsp;root@remote:/path/to/destination 我用nc： nc 10.10.0.237 444 &lt; vim-8.2.2725~b219565139.txz 
pkg add vim-8.2.3458.txz
出现问题：
sudo pkg add vim-8.2.2725~b219565139.txz 
Installing vim-8.2.2725...
pkg: vim-8.2.2725 conflicts with xxd-9.1.0984 (installs files into the same place).&nbsp;&nbsp;Problematic file: /usr/local/bin/xxd
Failed to install the following 1 package(s): vim-8.2.2725~b219565139.txz
解决办法：
pkg which /usr/local/bin/xxd
/usr/local/bin/xxd was installed by package xxd-9.1.0984
sudo pkg delete xxd-9.1.0984
成功安装：
sudo pkg add vim-8.2.2725~b219565139.txz 
Installing vim-8.2.2725...
Extracting vim-8.2.2725: 100%

sudo pkg fetch wget-1.21
Updating FreeBSD repository catalogue...
/var/cache/pkg/wget-1.21~c9340e6c10.txz 

卸载：
通过单个文件前查包名which
pkg which /usr/local/bin/go
/usr/local/bin/go was installed by package go-1.21_5,2
直接卸载：
pkg delete go-1.21_5,2

nc -l 444 &gt; curl-7.76.0~ece03d874a.txz
nc 10.10.0.237 444 &lt; curl-7.76.0~ece03d874a.txz
pkg add curl-7.76.0~ece03d874a.txz
</textarea><br/><br/><br/><br/>FreeBSD下面检查某程序是不是包的形式安装的命令行：<br/><textarea name="code" class="php" rows="15" cols="100">
pkg which /usr/local/bin/python3.9
/usr/local/bin/python3.9 was installed by package python39-3.9.18_2
pkg info -l python39-3.9.18_2 &#124; grep pip
pkg info -l mysql81-server-8.1.0&#124;grep my.cnf
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/etc/mysql/my.cnf.sample
pkg info &#124;grep mysql
mysql81-client-8.1.0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Multithreaded SQL database (client)
mysql81-server-8.1.0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Multithreaded SQL database (server)
php83-mysqli-8.3.3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The mysqli shared extension for php
service&nbsp;&nbsp;mysql-server restart
</textarea><br/><br/>pkg info -l curl&#124;grep curl.h<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/include/curl/curl.h<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/include/curl/header.h<br/>pkg info -l curl&#124;grep so<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/include/curl/websockets.h<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/lib/libcurl.so<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/lib/libcurl.so.4<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/lib/libcurl.so.4.8.0<br/><br/>pkg info #查看BSD系统中安装了哪些pkg包<br/>pkg info lrzsz-0.12.20_4 #查看具体某个包信息<br/> pkg info -l nginx-1.26.2_9,3<br/>nginx-1.26.2_9,3:<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/etc/nginx/fastcgi_params-dist<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/etc/nginx/koi-utf<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/etc/nginx/koi-win<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/etc/nginx/mime.types-dist<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/etc/nginx/nginx.conf-dist<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/etc/nginx/scgi_params-dist<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/etc/nginx/uwsgi_params-dist<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/etc/nginx/win-utf<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/etc/rc.d/nginx<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/libexec/nginx/ngx_mail_module.so<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/libexec/nginx/ngx_stream_module.so<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/sbin/nginx<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/share/licenses/nginx-1.26.2_9,3/BSD2CLAUSE<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/share/licenses/nginx-1.26.2_9,3/LICENSE<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/share/licenses/nginx-1.26.2_9,3/catalog.mk<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/share/man/man8/nginx.8.gz<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/share/vim/vimfiles/ftdetect/nginx.vim<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/share/vim/vimfiles/ftplugin/nginx.vim<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/share/vim/vimfiles/indent/nginx.vim<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/share/vim/vimfiles/syntax/nginx.vim<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/www/nginx-dist/50x.html<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/www/nginx-dist/EXAMPLE_DIRECTORY-DONT_ADD_OR_TOUCH_ANYTHING<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/www/nginx-dist/index.html<br/>pkg info -l lrzsz-0.12.20_4&nbsp;&nbsp; #查看此包有哪些文件<br/>lrzsz-0.12.20_4:<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/bin/lrb<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/bin/lrx<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/bin/lrz<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/bin/lsb<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/bin/lsx<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/bin/lsz<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/man/man1/lrz.1.gz<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/man/man1/lsz.1.gz<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/share/licenses/lrzsz-0.12.20_4/GPLv2<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/share/licenses/lrzsz-0.12.20_4/LICENSE<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/share/licenses/lrzsz-0.12.20_4/catalog.mk<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/share/locale/de/LC_MESSAGES/lrzsz.mo<br/><br/>据下面的这个文件， /usr/local/share/locale/de/LC_MESSAGES/lrzsz.mo ，反查到到来自：rzsz-0.12.20_4，如下：<br/>pkg which /usr/local/share/locale/de/LC_MESSAGES/lrzsz.mo<br/>/usr/local/share/locale/de/LC_MESSAGES/lrzsz.mo was installed by package lrzsz-0.12.20_4<br/><br/>使用 pkg 包管理器来查找包含 libssl.so.9 的软件包：<br/>pkg search libssl.so.9<br/><br/>删掉一些安装的软件包命令，-f强制：<br/>sudo pkg delete -f &lt;package_name&gt;<br/><br/><br/>好了，解决问题开始下：<br/>pkg which&nbsp;&nbsp;/usr/lib/libssl.so.9 <br/>/usr/lib/libssl.so.9 was not found in the database<br/><br/>sudo pkg install openssl<br/>sudo ldconfig -m /usr/local/lib<br/><br/>root@freebsd-unmp-10-10-0-237:~ # pkg_add -r wget<br/>pkg_add: Command not found.<br/>root@freebsd-unmp-10-10-0-237:~ # pkg install wget<br/>The package management tool is not yet installed on your system.<br/>Do you want to fetch and install it now? [y/N]: y<br/>Bootstrapping pkg from pkg+http://pkg.FreeBSD.org/FreeBSD:13:amd64/quarterly, please wait...<br/>Verifying signature with trusted certificate pkg.freebsd.org.2013102301... done<br/>Installing pkg-1.16.3...<br/>Extracting pkg-1.16.3: 100%<br/>Updating FreeBSD repository catalogue...<br/>Fetching meta.conf: 100%&nbsp;&nbsp;&nbsp;&nbsp;163 B&nbsp;&nbsp; 0.2kB/s&nbsp;&nbsp;&nbsp;&nbsp;00:01&nbsp;&nbsp;&nbsp;&nbsp;<br/>Fetching packagesite.txz: 100%&nbsp;&nbsp;&nbsp;&nbsp;6 MiB 407.3kB/s&nbsp;&nbsp;&nbsp;&nbsp;00:16&nbsp;&nbsp;&nbsp;&nbsp;<br/>Processing entries: 100%<br/>FreeBSD repository update completed. 30360 packages processed.<br/>All repositories are up to date.<br/>Updating database digests format: 100%<br/>The following 5 package(s) will be affected (of 0 checked):<br/><br/>New packages to be INSTALLED:<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;gettext-runtime: 0.21<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;indexinfo: 0.3.1<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;libidn2: 2.3.0_1<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;libunistring: 0.9.10_1<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;wget: 1.21<br/><br/>Number of packages to be installed: 5<br/><br/>The process will require 7 MiB more space.<br/>1 MiB to be downloaded.<br/><br/>Proceed with this action? [y/N]: <br/>摘自：http://www.ittang.com/2008/0309/4832.html<br/>kg install pkg and let it bootstrap / upgrade itself. Then use pkg install foo, etc. pkg_add does not exist anymore, as you&#039;ve found out.<br/><br/><br/>man pkg<br/>which&nbsp;&nbsp; Query the database for package(s) that installed a specific file.<br/><br/>pkg which /usr/local/lib/libicuio.so.58<br/>/usr/local/lib/libicuio.so.58 was installed by package icu-58.2_2,1<br/><br/>#pkg which /usr/local/bin/openssl<br/>/usr/local/bin/openssl was installed by package openssl-1.0.2l,1<br/><br/>来自：https://www.howtoing.com/pkg-command-examples-to-manage-packages-in-freebsd<br/><br/><br/>附：从Ports存储库本地下载软件包<br/>为了从Ports存储库本地下载软件包，而不在系统上安装软件包，请使用fetch开关运行pkg命令 。<br/><br/>下载的软件包二进制文件是压缩的.txz文件，可以在/ var / cache / pkg / system路径中找到。<br/><br/># pkg fetch package_name
]]>
</description>
</item><item>
<link>https://jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] [实践OK]pkg install lsof -y无法安装和pkg install -y lsof是有区别的，FreeBSD中安装pkg,pkg_add已经改用pkg了，怎样查询一个文件属于哪个ports包，类似CentOS里面的rpm -qf file反查在哪你上rpm包里面一样的命令是pkg which /usr/local/lib/libicuio.so.58]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>https://jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>