PageSourceSearch

https://www.hestudio.net/assets/ollama-on-termux.html-B2hfYzBj.js

js hestudio.net collected 2026-09-24 10:36:56 UTC 10,042 bytes, 5 lines download raw bytes

1import{_ as n,c as o,f as i,b as a,d as t,e as l,w as r,r as p,o as d}from"./app-D7CCjthX.js";const c={},m={class:"footnotes"},u={class:"footnotes-list"},h={id:"footnote2",class:"footnote-item"};function g(f,e){const s=p("RouteLink");return d(),o("div",null,[e[4]||(e[4]=i(`<p>众所周知,我们国产模型<code>DeepSeek</code>大过年的给美股来了几下子,在我们过年的时候让洋人过不了一个安稳年(滑稽)。直到我写这篇帖子的时候,DeepSeek 的部分服务仍然处于一个不可用的状态。</p><figure><img src="https://img.hestudio.net/2025/01/30/679b5561dd98a.webp" alt="" tabindex="0" loading="lazy"><figcaption></figcaption></figure><p>本着增强动手能力(整活)的心态,我决定在我的手机上安装一个<code>deepseek-r1</code>模型。由于在电脑上安装过于简单,将不再赘述。</p><hr><h3 id="需要的东西" tabindex="-1"><a class="header-anchor" href="#需要的东西"><span>需要的东西</span></a></h3><ul><li>一部手机</li><li>Termux</li></ul><h3 id="演示条件" tabindex="-1"><a class="header-anchor" href="#演示条件"><span>演示条件</span></a></h3><ul><li>手机:REDMI K80 Pro <s>(王腾有大帝之姿)</s></li><li>Termux: ZeroTermux<sup class="footnote-ref"><a href="#footnote1">[1]</a><a class="footnote-anchor" id="footnote-ref1"></a></sup> 0.118.1.41</li></ul><hr><h3 id="正文" tabindex="-1"><a class="header-anchor" href="#正文"><span>正文</span></a></h3><div class="hint-container warning"><p class="hint-container-title">注意</p><p>本文开始前,假设你熟练掌握 Linux 的使用方法,并可以正常访问国际互联网。</p></div><p>由于手机的性能就摆在那里,所以只能使用<code>1.5b</code>的模型。在开始前,假设你已经安装 Termux。</p><p>手机无 Root 环境。<s>(有 Root 更好)</s></p><p>经过测试,在这里应该使用 Proot 容器,无法直接在 Termux 中运行,我这里使用的是<code>Kali</code>容器<sup class="footnote-ref"><a href="#footnote2">[2]</a><a class="footnote-anchor" id="footnote-ref2"></a></sup>,你也可以使用其他容器,如<code>ubuntu</code>.</p><hr><p>你可以直接运行以下脚本进行安装:</p><div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh"><pre><code class="language-bash"><span class="line"><span class="token function">curl</span> <span class="token parameter variable">-fsSL</span> https://ollama.com/install.sh <span class="token operator">|</span> <span class="token function">sh</span></span>
2<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div></div></div><div class="hint-container tip"><p class="hint-container-title">修改的内容</p><p>此段内容在2026年3月2日进行过修改。</p><details class="hint-container details"><summary>之前的内容</summary><p>使用手机打开<a href="https://github.com/ollama/ollama/blob/main/docs/linux.md" target="_blank" rel="noopener noreferrer">Ollama Linux Manual install</a>的<code>ARM64 install</code>(毕竟手机是 arm64 架构),并复制第一行命令到终端(不要带上第二行)。</p><p>在运行之后将会下载 Ollama 的安装包,在下载完之后,复制第二行命令,并删去开头的<code>sudo</code>(由于 Termux 特性),然后运行。</p><figure><img src="https://img.hestudio.net/2025/01/30/679b5b37500ac.webp" alt="" tabindex="0" loading="lazy"><figcaption></figcaption></figure><p>如果你懒的话,可以复制我整理好的命令。</p><div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh"><pre><code class="language-bash"><span class="line"><span class="token function">curl</span> <span class="token parameter variable">-L</span> https://ollama.com/download/ollama-linux-arm64.tgz <span class="token parameter variable">-o</span> ollama-linux-arm64.tgz <span class="token operator">&amp;&amp;</span> <span class="token function">tar</span> <span class="token parameter variable">-C</span> /usr <span class="token parameter variable">-xzf</span> ollama-linux-arm64.tgz</span>
3<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div></div></div><figure><img src="https://img.hestudio.net/2025/01/30/679b5d404a7f0.webp" alt="" tabindex="0" loading="lazy"><figcaption></figcaption></figure></details></div><p>由于没有 root 环境,无法使用&quot;Adding Ollama as a startup service (recommended)&quot;步骤,我们要手动启动一下 ollama 服务。</p><div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh"><pre><code class="language-bash"><span class="line">ollama serve <span class="token operator">&amp;</span></span>
4<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div></div></div><blockquote><p>
4Linux 在执行命令时,可以使用<code>&amp;</code>符号来使该命令在后台运行,而不阻塞终端的使用。当了解这一点之后我们就可以编写命令。</p></blockquote><p>然后就可以根据自己的需要运行模型。就比如说,我要运行一个<code>deepseek-r1:1.5b</code>的模型,就可以这样写:</p><div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh"><pre><code class="language-bash"><span class="line">ollama run deepseek-r1:1.5b</span>
5<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div></div></div><figure><img src="https://img.hestudio.net/2025/01/30/679b61cc269df.webp" alt="" tabindex="0" loading="lazy"><figcaption></figcaption></figure><p>其他内容详见<a href="https://ollama.com/" target="_blank" rel="noopener noreferrer">Ollama</a>.</p><hr class="footnotes-sep">`,26)),a("section",m,[a("ol",u,[e[3]||(e[3]=a("li",{id:"footnote1",class:"footnote-item"},[a("p",null,[t("ZeroTermux 是 Termux 的修改版本。 "),a("a",{href:"#footnote-ref1",class:"footnote-backref"},"↩︎")])],-1)),a("li",h,[a("p",null,[l(s,{to:"/posts/install-kali-on-android-4.0.html"},{default:r(()=>[...e[0]||(e[0]=[t("【4.0】在 Android 手机上安装 kali Linux",-1)])]),_:1}),e[1]||(e[1]=t()),e[2]||(e[2]=a("a",{href:"#footnote-ref2",class:"footnote-backref"},"↩︎",-1))])])])])])}const x=n(c,[["render",g]]),k=JSON.parse('{"path":"/posts/ollama-on-termux.html","title":"【新年新活】在安卓手机上使用Ollama运行本地大模型","lang":"zh-CN","frontmatter":{"title":"【新年新活】在安卓手机上使用Ollama运行本地大模型","tag":["Android","Termux"],"category":["整活记录","新年新活"],"description":"众所周知,我们国产模型DeepSeek大过年的给美股来了几下子,在我们过年的时候让洋人过不了一个安稳年(滑稽)。直到我写这篇帖子的时候,DeepSeek 的部分服务仍然处于一个不可用的状态。 本着增强动手能力(整活)的心态,我决定在我的手机上安装一个deepseek-r1模型。由于在电脑上安装过于简单,将不再赘述。","head":[["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"【新年新活】在安卓手机上使用Ollama运行本地大模型\\",\\"image\\":[\\"https://img.hestudio.net/2025/01/30/679b5561dd98a.webp\\",\\"https://img.hestudio.net/2025/01/30/679b5b37500ac.webp\\",\\"https://img.hestudio.net/2025/01/30/679b5d404a7f0.webp\\",\\"https://img.hestudio.net/2025/01/30/679b61cc269df.webp\\"],\\"dateModified\\":\\"2026-03-01T17:46:10.000Z\\",\\"author\\":[{\\"@type\\":\\"Person\\",\\"name\\":\\"undefined\\",\\"url\\":\\"https://www.hestudio.net/about/\\",\\"email\\":\\"[email protected]\\"}]}"],["meta",{"property":"og:url","content":"https://www.hestudio.net/posts/ollama-on-termux.html"}],["meta",{"property":"og:site_name","content":"heStudio"}],["meta",{"property":"og:title","content":"【新年新活】在安卓手机上使用Ollama运行本地大模型"}],["meta",{"property":"og:description","content":"众所周知,我们国产模型DeepSeek大过年的给美股来了几下子,在我们过年的时候让洋人过不了一个安稳年(滑稽)。直到我写这篇帖子的时候,DeepSeek 的部分服务仍然处于一个不可用的状态。 本着增强动手能力(整活)的心态,我决定在我的手机上安装一个deepseek-r1模型。由于在电脑上安装过于简单,将不再赘述。"}],["meta",{"property":"og:type","content":"article"}],["meta",{"property":"og:image","content":"https://img.hestudio.net/2025/01/30/679b5561dd98a.webp"}],["meta",{"property":"og:locale","content":"zh-CN"}],["meta",{"property":"og:updated_time","content":"2026-03-01T17:46:10.000Z"}],["meta",{"property":"article:tag","content":"Termux"}],["meta",{"property":"article:tag","content":"Android"}],["meta",{"property":"article:modified_time","content":"2026-03-01T17:46:10.000Z"}]]}
5,"git":{"createdTime":1738236431000,"updatedTime":1772387170000},"readingTime":{"minutes":2.16,"words":647},"filePathRelative":"posts/ollama-on-termux.md","excerpt":"<p>众所周知,我们国产模型<code>DeepSeek</code>大过年的给美股来了几下子,在我们过年的时候让洋人过不了一个安稳年(滑稽)。直到我写这篇帖子的时候,DeepSeek 的部分服务仍然处于一个不可用的状态。</p>\\n<figure><img src=\\"https://img.hestudio.net/2025/01/30/679b5561dd98a.webp\\" alt=\\"\\" tabindex=\\"0\\" loading=\\"lazy\\"><figcaption></figcaption></figure>\\n<p>本着增强动手能力(整活)的心态,我决定在我的手机上安装一个<code>deepseek-r1</code>模型。由于在电脑上安装过于简单,将不再赘述。</p>\\n","autoDesc":true}');export{x as comp,k as data};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.