<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Pkg on Net Boy</title>
    <link>https://lian.st/tags/pkg/</link>
    <description>Recent content in Pkg on Net Boy</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-gb</language>
    <lastBuildDate>Wed, 16 Oct 2024 21:55:44 +0800</lastBuildDate><atom:link href="https://lian.st/tags/pkg/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>pkg報錯missing or size mismatch</title>
      <link>https://lian.st/posts/b615c08c/</link>
      <pubDate>Wed, 16 Oct 2024 21:55:44 +0800</pubDate>
      
      <guid>https://lian.st/posts/b615c08c/</guid>
      
      <description>&lt;h2 id=&#34;環境信息&#34;&gt;環境信息&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;OS Version: FreeBSD 14
PKG Version : 1.21.3
PKG Repo: NJU Eud
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;错误信息&#34;&gt;错误信息&lt;/h2&gt;
&lt;p&gt;在使用pkg安装git的时候报错&lt;code&gt;missing or size mismatch, fetching from remote&lt;/code&gt;&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;root@localhost:/etc/pkg # pkg install git 
Updating FreeBSD repository catalogue...
pkg: No SRV record found for the repo &amp;#39;FreeBSD&amp;#39;
Fetching meta.conf:   0%
FreeBSD repository is up to date.
All repositories are up to date.
The following 26 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
	curl: 8.10.0
	expat: 2.6.2
	git: 2.45.2_1
	libnghttp2: 1.62.1
	libpsl: 0.21.5_1
	libssh2: 1.11.0_1,3
	p5-Authen-SASL: 2.17
	p5-CGI: 4.65
	p5-Clone: 0.46
	p5-Digest-HMAC: 1.04
	p5-Encode-Locale: 1.05
	p5-Error: 0.17029
	p5-GSSAPI: 0.28_2
	p5-HTML-Parser: 3.82
	p5-HTML-Tagset: 3.24
	p5-HTTP-Date: 6.06
	p5-HTTP-Message: 6.46
	p5-IO-HTML: 1.004
	p5-IO-Socket-IP: 0.42
	p5-IO-Socket-SSL: 2.085_1
	p5-LWP-MediaTypes: 6.04
	p5-Mozilla-CA: 20240730
	p5-Net-SSLeay: 1.94
	p5-TimeDate: 2.33,1
	p5-URI: 5.28
	pcre2: 10.43

Number of packages to be installed: 26

The process will require 54 MiB more space.
7 MiB to be downloaded.

Proceed with this action? [y/N]: y
[1/3] Fetching p5-HTTP-Message-6.46.pkg: 100%   81 KiB  83.2kB/s    00:01    
pkg: cached package p5-HTTP-Message-6.46: missing or size mismatch, fetching from remote
[2/3] Fetching p5-HTTP-Message-6.46.pkg: 100%   81 KiB  83.2kB/s    00:01    
pkg: cached package p5-HTTP-Message-6.46: missing or size mismatch, cannot continue
Consider running &amp;#39;pkg update -f&amp;#39;
[3/3] Fetching p5-HTTP-Message-6.46.pkg: 100%   81 KiB  83.2kB/s    00:01    
pkg: cached package p5-HTTP-Message-6.46: missing or size mismatch, fetching from remote
Fetching p5-HTTP-Message-6.46.pkg: 100%   81 KiB  83.2kB/s    00:01    
pkg: cached package p5-HTTP-Message-6.46: missing or size mismatch, cannot continue
Consider running &amp;#39;pkg update -f&amp;#39;
pkg: Package database is busy while closing!
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;解決方案&#34;&gt;解決方案&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;清空緩存&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>FreeBSD更換pkg國內源</title>
      <link>https://lian.st/posts/e703e108/</link>
      <pubDate>Wed, 16 Oct 2024 15:31:15 +0800</pubDate>
      
      <guid>https://lian.st/posts/e703e108/</guid>
      
      <description>&lt;h2 id=&#34;備份源文件&#34;&gt;備份源文件&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;root@localhost:/ # cd /etc/pkg/
root@localhost:/etc/pkg # cp FreeBSD.conf FreeBSD.conf.bak
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;編輯配置文件&#34;&gt;編輯配置文件&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;root@localhost:/etc/pkg # vi FreeBSD.conf
# 南京大學
FreeBSD: {
  url: &amp;#34;http://mirrors.nju.edu.cn/freebsd-pkg/${ABI}/quarterly&amp;#34;,
  mirror_type: &amp;#34;srv&amp;#34;,
  signature_type: &amp;#34;fingerprints&amp;#34;,
  fingerprints: &amp;#34;/usr/share/keys/pkg&amp;#34;,
  enabled: yes
}
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;更新-pkg-数据库&#34;&gt;更新 &lt;code&gt;pkg&lt;/code&gt; 数据库&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;root@localhost:/etc/pkg # pkg update
Updating FreeBSD repository catalogue...
pkg: Repository FreeBSD has a wrong packagesite, need to re-create database
pkg: No SRV record found for the repo &amp;#39;FreeBSD&amp;#39;
Fetching meta.conf: 100%    178 B   0.2kB/s    00:01    
Fetching data.pkg: 100%    7 MiB   7.3MB/s    00:01    
Processing entries: 100%
FreeBSD repository update completed. 34404 packages processed.
All repositories are up to date.
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;查看當前使用的源&#34;&gt;查看當前使用的源&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;root@localhost:/etc/pkg # pkg -vv | grep url
    url             : &amp;#34;http://mirrors.nju.edu.cn/freebsd-pkg/FreeBSD:14:amd64/quarterly&amp;#34;,
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;常用國內源&#34;&gt;常用國內源&lt;/h2&gt;
&lt;table&gt;
  &lt;thead&gt;
      &lt;tr&gt;
          &lt;th style=&#34;text-align: left&#34;&gt;Owner&lt;/th&gt;
          &lt;th style=&#34;text-align: left&#34;&gt;URL&lt;/th&gt;
      &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
      &lt;tr&gt;
          &lt;td style=&#34;text-align: left&#34;&gt;中国科学技术大学&lt;/td&gt;
          &lt;td style=&#34;text-align: left&#34;&gt;&lt;a href=&#34;http://mirrors.ustc.edu.cn/freebsd-pkg/$%7BABI%7D/quarterly&#34;&gt;http://mirrors.ustc.edu.cn/freebsd-pkg/${ABI}/quarterly&lt;/a&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td style=&#34;text-align: left&#34;&gt;南京大学&lt;/td&gt;
          &lt;td style=&#34;text-align: left&#34;&gt;&lt;a href=&#34;http://mirrors.nju.edu.cn/freebsd-pkg/$%7BABI%7D/quarterly&#34;&gt;http://mirrors.nju.edu.cn/freebsd-pkg/${ABI}/quarterly&lt;/a&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td style=&#34;text-align: left&#34;&gt;網易&lt;/td&gt;
          &lt;td style=&#34;text-align: left&#34;&gt;&lt;a href=&#34;http://mirrors.163.com/freebsd-pkg/$%7BABI%7D/quarterly&#34;&gt;http://mirrors.163.com/freebsd-pkg/${ABI}/quarterly&lt;/a&gt;&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;</description>
      
    </item>
    
  </channel>
</rss>
