{"id":12463,"date":"2025-04-18T19:37:31","date_gmt":"2025-04-18T11:37:31","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/12463.html"},"modified":"2025-04-18T19:37:31","modified_gmt":"2025-04-18T11:37:31","slug":"%e7%a6%bb%e7%ba%bf%e5%ae%89%e8%a3%85ollama%e5%88%b0%e6%9c%8d%e5%8a%a1%e5%99%a8","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/12463.html","title":{"rendered":"\u79bb\u7ebf\u5b89\u88c5ollama\u5230\u670d\u52a1\u5668"},"content":{"rendered":"<p>\u641c\u4e86\u5f88\u591a\u6559\u7a0b\u4e0d\u6ee1\u610f,\u5f04\u4e86\u534a\u5929\u624d\u5f04\u597d&#xff0c;\u8fd9\u91cc\u8bb0\u5f55\u4e0b&#xff0c;\u65b9\u4fbf\u4ee5\u540e\u7684\u4eba\u7528&#xff0c;\u90a3\u4e2a\u5728\u7ebf\u4e0b\u8f7d\u592a\u6162&#xff0c;\u6015\u4e0d\u662f\u5f97\u4e0b\u8f7d\u5230\u660e\u5e74\u3002<\/p>\n<\/p>\n<p>\u4e00.\u4ece\u5b98\u7f51\u4e0b\u5728liunx\u7248\u7684tgz\u5b89\u88c5\u5305<\/p>\n<p>Releases \u00b7 ollama\/ollama (github.com)<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1200\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418113726-68023976e6a26.png\" width=\"1200\" \/><\/p>\n<p>\u67e5\u770b\u81ea\u5df1\u7684\u670d\u52a1\u5668\u4fe1\u606f&#xff08;\u53c2\u8003\u00a0https:\/\/www.cnblogs.com\/Casflawed\/p\/18525187&#xff09;<\/p>\n<ul>\n<li>x86_64 CPU\u9009\u62e9\u4e0b\u8f7dollama-linux-amd64&#xff1b;aarch64|arm64 CPU\u9009\u62e9\u4e0b\u8f7dollama-linux-arm64<\/li>\n<\/ul>\n<p>#\u67e5\u770bLinux\u7248\u672c\u53f7<br \/>\ncat \/proc\/version<br \/>\n#\u67e5\u770bcpu\u67b6\u6784<br \/>\nlscpu<\/p>\n<p>\u4e8c.\u5229\u7528rz\u547d\u4ee4\u4e0a\u4f20\u81f3\u670d\u52a1\u5668\u7aef<\/p>\n<p>\u4e0d\u77e5\u9053\u600e\u4e48\u7528\u770b\u00a0\u5982\u4f55\u5229\u7528Xshell\u4e0a\u4f20\u6587\u4ef6\u5230\u670d\u52a1\u5668-CSDN\u535a\u5ba2<\/p>\n<p>\u4e09.\u4e0b\u8f7d\u5b98\u7f51\u7684\u5b89\u88c5\u7a0b\u5e8f\u00a0https:\/\/ollama.com\/install.sh\u00a0 \u8d77\u540d\u4e3ainsatll.sh<\/p>\n<p>\u53cc\u51fb\u6253\u5f00&#xff0c;\u6211\u8fd9\u91cc\u7528vscode\u6253\u5f00<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1200\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418113728-6802397851df5.png\" width=\"1200\" \/><\/p>\n<p>\u8fd9\u662f\u5b98\u65b9\u7684<\/p>\n<p>#!\/bin\/sh<br \/>\n# This script installs Ollama on Linux.<br \/>\n# It detects the current operating system architecture and installs the appropriate version of Ollama.<\/p>\n<p>set -eu<\/p>\n<p>red&#061;&#034;$( (\/usr\/bin\/tput bold || :; \/usr\/bin\/tput setaf 1 || \ud83d\ude42 2&gt;&amp;-)&#034;<br \/>\nplain&#061;&#034;$( (\/usr\/bin\/tput sgr0 || \ud83d\ude42 2&gt;&amp;-)&#034;<\/p>\n<p>status() { echo &#034;&gt;&gt;&gt; $*&#034; &gt;&amp;2; }<br \/>\nerror() { echo &#034;${red}ERROR:${plain} $*&#034;; exit 1; }<br \/>\nwarning() { echo &#034;${red}WARNING:${plain} $*&#034;; }<\/p>\n<p>TEMP_DIR&#061;$(mktemp -d)<br \/>\ncleanup() { rm -rf $TEMP_DIR; }<br \/>\ntrap cleanup EXIT<\/p>\n<p>available() { command -v $1 &gt;\/dev\/null; }<br \/>\nrequire() {<br \/>\n    local MISSING&#061;&#039;&#039;<br \/>\n    for TOOL in $*; do<br \/>\n        if ! available $TOOL; then<br \/>\n            MISSING&#061;&#034;$MISSING $TOOL&#034;<br \/>\n        fi<br \/>\n    done<\/p>\n<p>    echo $MISSING<br \/>\n}<\/p>\n<p>[ &#034;$(uname -s)&#034; &#061; &#034;Linux&#034; ] || error &#039;This script is intended to run on Linux only.&#039;<\/p>\n<p>ARCH&#061;$(uname -m)<br \/>\ncase &#034;$ARCH&#034; in<br \/>\n    x86_64) ARCH&#061;&#034;amd64&#034; ;;<br \/>\n    aarch64|arm64) ARCH&#061;&#034;arm64&#034; ;;<br \/>\n    *) error &#034;Unsupported architecture: $ARCH&#034; ;;<br \/>\nesac<\/p>\n<p>IS_WSL2&#061;false<\/p>\n<p>KERN&#061;$(uname -r)<br \/>\ncase &#034;$KERN&#034; in<br \/>\n    *icrosoft*WSL2 | *icrosoft*wsl2) IS_WSL2&#061;true;;<br \/>\n    *icrosoft) error &#034;Microsoft WSL1 is not currently supported. Please use WSL2 with &#039;wsl &#8211;set-version &lt;distro&gt; 2&#039;&#034; ;;<br \/>\n    *) ;;<br \/>\nesac<\/p>\n<p>VER_PARAM&#061;&#034;${OLLAMA_VERSION:&#043;?version&#061;$OLLAMA_VERSION}&#034;<\/p>\n<p>SUDO&#061;<br \/>\nif [ &#034;$(id -u)&#034; -ne 0 ]; then<br \/>\n    # Running as root, no need for sudo<br \/>\n    if ! available sudo; then<br \/>\n        error &#034;This script requires superuser permissions. Please re-run as root.&#034;<br \/>\n    fi<\/p>\n<p>    SUDO&#061;&#034;sudo&#034;<br \/>\nfi<\/p>\n<p>NEEDS&#061;$(require curl awk grep sed tee xargs)<br \/>\nif [ -n &#034;$NEEDS&#034; ]; then<br \/>\n    status &#034;ERROR: The following tools are required but missing:&#034;<br \/>\n    for NEED in $NEEDS; do<br \/>\n        echo &#034;  &#8211; $NEED&#034;<br \/>\n    done<br \/>\n    exit 1<br \/>\nfi<\/p>\n<p>for BINDIR in \/usr\/local\/bin \/usr\/bin \/bin; do<br \/>\n    echo $PATH | grep -q $BINDIR &amp;&amp; break || continue<br \/>\ndone<br \/>\nOLLAMA_INSTALL_DIR&#061;$(dirname ${BINDIR})<\/p>\n<p>status &#034;Installing ollama to $OLLAMA_INSTALL_DIR&#034;<br \/>\n$SUDO install -o0 -g0 -m755 -d $BINDIR<br \/>\n$SUDO install -o0 -g0 -m755 -d &#034;$OLLAMA_INSTALL_DIR&#034;<br \/>\nif curl -I &#8211;silent &#8211;fail &#8211;location &#034;https:\/\/ollama.com\/download\/ollama-linux-${ARCH}.tgz${VER_PARAM}&#034; &gt;\/dev\/null ; then<br \/>\n    status &#034;Downloading Linux ${ARCH} bundle&#034;<br \/>\n    curl &#8211;fail &#8211;show-error &#8211;location &#8211;progress-bar \\\\<br \/>\n        &#034;https:\/\/ollama.com\/download\/ollama-linux-${ARCH}.tgz${VER_PARAM}&#034; | \\\\<br \/>\n        $SUDO tar -xzf &#8211; -C &#034;$OLLAMA_INSTALL_DIR&#034;<br \/>\n    BUNDLE&#061;1<br \/>\n    if [ &#034;$OLLAMA_INSTALL_DIR\/bin\/ollama&#034; !&#061; &#034;$BINDIR\/ollama&#034; ] ; then<br \/>\n        status &#034;Making ollama accessible in the PATH in $BINDIR&#034;<br \/>\n        $SUDO ln -sf &#034;$OLLAMA_INSTALL_DIR\/ollama&#034; &#034;$BINDIR\/ollama&#034;<br \/>\n    fi<br \/>\nelse<br \/>\n    status &#034;Downloading Linux ${ARCH} CLI&#034;<br \/>\n    curl &#8211;fail &#8211;show-error &#8211;location &#8211;progress-bar -o &#034;$TEMP_DIR\/ollama&#034;\\\\<br \/>\n    &#034;https:\/\/ollama.com\/download\/ollama-linux-${ARCH}${VER_PARAM}&#034;<br \/>\n    $SUDO install -o0 -g0 -m755 $TEMP_DIR\/ollama $OLLAMA_INSTALL_DIR\/ollama<br \/>\n    BUNDLE&#061;0<br \/>\n    if [ &#034;$OLLAMA_INSTALL_DIR\/ollama&#034; !&#061; &#034;$BINDIR\/ollama&#034; ] ; then<br \/>\n        status &#034;Making ollama accessible in the PATH in $BINDIR&#034;<br \/>\n        $SUDO ln -sf &#034;$OLLAMA_INSTALL_DIR\/ollama&#034; &#034;$BINDIR\/ollama&#034;<br \/>\n    fi<br \/>\nfi<\/p>\n<p># Check for NVIDIA JetPack systems with additional downloads<br \/>\nif [ -f \/etc\/nv_tegra_release ] ; then<br \/>\n    if grep R36 \/etc\/nv_tegra_release &gt; \/dev\/null ; then<br \/>\n        status &#034;Downloading JetPack 6 components&#034;<br \/>\n        curl &#8211;fail &#8211;show-error &#8211;location &#8211;progress-bar \\\\<br \/>\n            &#034;https:\/\/ollama.com\/download\/ollama-linux-${ARCH}-jetpack6.tgz${VER_PARAM}&#034; | \\\\<br \/>\n            $SUDO tar -xzf &#8211; -C &#034;$OLLAMA_INSTALL_DIR&#034;<br \/>\n    elif grep R35 \/etc\/nv_tegra_release &gt; \/dev\/null ; then<br \/>\n        status &#034;Downloading JetPack 5 components&#034;<br \/>\n        curl &#8211;fail &#8211;show-error &#8211;location &#8211;progress-bar \\\\<br \/>\n            &#034;https:\/\/ollama.com\/download\/ollama-linux-${ARCH}-jetpack5.tgz${VER_PARAM}&#034; | \\\\<br \/>\n            $SUDO tar -xzf &#8211; -C &#034;$OLLAMA_INSTALL_DIR&#034;<br \/>\n    else<br \/>\n        warning &#034;Unsupported JetPack version detected.  GPU may not be supported&#034;<br \/>\n    fi<br \/>\nfi<\/p>\n<p>install_success() {<br \/>\n    status &#039;The Ollama API is now available at 127.0.0.1:11434.&#039;<br \/>\n    status &#039;Install complete. Run &#034;ollama&#034; from the command line.&#039;<br \/>\n}<br \/>\ntrap install_success EXIT<\/p>\n<p># Everything from this point onwards is optional.<\/p>\n<p>configure_systemd() {<br \/>\n    if ! id ollama &gt;\/dev\/null 2&gt;&amp;1; then<br \/>\n        status &#034;Creating ollama user&#8230;&#034;<br \/>\n        $SUDO useradd -r -s \/bin\/false -U -m -d \/usr\/share\/ollama ollama<br \/>\n    fi<br \/>\n    if getent group render &gt;\/dev\/null 2&gt;&amp;1; then<br \/>\n        status &#034;Adding ollama user to render group&#8230;&#034;<br \/>\n        $SUDO usermod -a -G render ollama<br \/>\n    fi<br \/>\n    if getent group video &gt;\/dev\/null 2&gt;&amp;1; then<br \/>\n        status &#034;Adding ollama user to video group&#8230;&#034;<br \/>\n        $SUDO usermod -a -G video ollama<br \/>\n    fi<\/p>\n<p>    status &#034;Adding current user to ollama group&#8230;&#034;<br \/>\n    $SUDO usermod -a -G ollama $(whoami)<\/p>\n<p>    status &#034;Creating ollama systemd service&#8230;&#034;<br \/>\n    cat &lt;&lt;EOF | $SUDO tee \/etc\/systemd\/system\/ollama.service &gt;\/dev\/null<br \/>\n[Unit]<br \/>\nDescription&#061;Ollama Service<br \/>\nAfter&#061;network-online.target<\/p>\n<p>[Service]<br \/>\nExecStart&#061;$BINDIR\/ollama serve<br \/>\nUser&#061;ollama<br \/>\nGroup&#061;ollama<br \/>\nRestart&#061;always<br \/>\nRestartSec&#061;3<br \/>\nEnvironment&#061;&#034;PATH&#061;$PATH&#034;<\/p>\n<p>[Install]<br \/>\nWantedBy&#061;default.target<br \/>\nEOF<br \/>\n    SYSTEMCTL_RUNNING&#061;&#034;$(systemctl is-system-running || true)&#034;<br \/>\n    case $SYSTEMCTL_RUNNING in<br \/>\n        running|degraded)<br \/>\n            status &#034;Enabling and starting ollama service&#8230;&#034;<br \/>\n            $SUDO systemctl daemon-reload<br \/>\n            $SUDO systemctl enable ollama<\/p>\n<p>            start_service() { $SUDO systemctl restart ollama; }<br \/>\n            trap start_service EXIT<br \/>\n            ;;<br \/>\n        *)<br \/>\n            warning &#034;systemd is not running&#034;<br \/>\n            if [ &#034;$IS_WSL2&#034; &#061; true ]; then<br \/>\n                warning &#034;see https:\/\/learn.microsoft.com\/en-us\/windows\/wsl\/systemd#how-to-enable-systemd to enable it&#034;<br \/>\n            fi<br \/>\n            ;;<br \/>\n    esac<br \/>\n}<\/p>\n<p>if available systemctl; then<br \/>\n    configure_systemd<br \/>\nfi<\/p>\n<p># WSL2 only supports GPUs via nvidia passthrough<br \/>\n# so check for nvidia-smi to determine if GPU is available<br \/>\nif [ &#034;$IS_WSL2&#034; &#061; true ]; then<br \/>\n    if available nvidia-smi &amp;&amp; [ -n &#034;$(nvidia-smi | grep -o &#034;CUDA Version: [0-9]*\\\\.[0-9]*&#034;)&#034; ]; then<br \/>\n        status &#034;Nvidia GPU detected.&#034;<br \/>\n    fi<br \/>\n    install_success<br \/>\n    exit 0<br \/>\nfi<\/p>\n<p># Don&#039;t attempt to install drivers on Jetson systems<br \/>\nif [ -f \/etc\/nv_tegra_release ] ; then<br \/>\n    status &#034;NVIDIA JetPack ready.&#034;<br \/>\n    install_success<br \/>\n    exit 0<br \/>\nfi<\/p>\n<p># Install GPU dependencies on Linux<br \/>\nif ! available lspci &amp;&amp; ! available lshw; then<br \/>\n    warning &#034;Unable to detect NVIDIA\/AMD GPU. Install lspci or lshw to automatically detect and install GPU dependencies.&#034;<br \/>\n    exit 0<br \/>\nfi<\/p>\n<p>check_gpu() {<br \/>\n    # Look for devices based on vendor ID for NVIDIA and AMD<br \/>\n    case $1 in<br \/>\n        lspci)<br \/>\n            case $2 in<br \/>\n                nvidia) available lspci &amp;&amp; lspci -d &#039;10de:&#039; | grep -q &#039;NVIDIA&#039; || return 1 ;;<br \/>\n                amdgpu) available lspci &amp;&amp; lspci -d &#039;1002:&#039; | grep -q &#039;AMD&#039; || return 1 ;;<br \/>\n            esac ;;<br \/>\n        lshw)<br \/>\n            case $2 in<br \/>\n                nvidia) available lshw &amp;&amp; $SUDO lshw -c display -numeric -disable network | grep -q &#039;vendor: .* \\\\[10DE\\\\]&#039; || return 1 ;;<br \/>\n                amdgpu) available lshw &amp;&amp; $SUDO lshw -c display -numeric -disable network | grep -q &#039;vendor: .* \\\\[1002\\\\]&#039; || return 1 ;;<br \/>\n            esac ;;<br \/>\n        nvidia-smi) available nvidia-smi || return 1 ;;<br \/>\n    esac<br \/>\n}<\/p>\n<p>if check_gpu nvidia-smi; then<br \/>\n    status &#034;NVIDIA GPU installed.&#034;<br \/>\n    exit 0<br \/>\nfi<\/p>\n<p>if ! check_gpu lspci nvidia &amp;&amp; ! check_gpu lshw nvidia &amp;&amp; ! check_gpu lspci amdgpu &amp;&amp; ! check_gpu lshw amdgpu; then<br \/>\n    install_success<br \/>\n    warning &#034;No NVIDIA\/AMD GPU detected. Ollama will run in CPU-only mode.&#034;<br \/>\n    exit 0<br \/>\nfi<\/p>\n<p>if check_gpu lspci amdgpu || check_gpu lshw amdgpu; then<br \/>\n    if [ $BUNDLE -ne 0 ]; then<br \/>\n        status &#034;Downloading Linux ROCm ${ARCH} bundle&#034;<br \/>\n        curl &#8211;fail &#8211;show-error &#8211;location &#8211;progress-bar \\\\<br \/>\n            &#034;https:\/\/ollama.com\/download\/ollama-linux-${ARCH}-rocm.tgz${VER_PARAM}&#034; | \\\\<br \/>\n            $SUDO tar -xzf &#8211; -C &#034;$OLLAMA_INSTALL_DIR&#034;<\/p>\n<p>        install_success<br \/>\n        status &#034;AMD GPU ready.&#034;<br \/>\n        exit 0<br \/>\n    fi<br \/>\n    # Look for pre-existing ROCm v6 before downloading the dependencies<br \/>\n    for search in &#034;${HIP_PATH:-&#039;&#039;}&#034; &#034;${ROCM_PATH:-&#039;&#039;}&#034; &#034;\/opt\/rocm&#034; &#034;\/usr\/lib64&#034;; do<br \/>\n        if [ -n &#034;${search}&#034; ] &amp;&amp; [ -e &#034;${search}\/libhipblas.so.2&#034; -o -e &#034;${search}\/lib\/libhipblas.so.2&#034; ]; then<br \/>\n            status &#034;Compatible AMD GPU ROCm library detected at ${search}&#034;<br \/>\n            install_success<br \/>\n            exit 0<br \/>\n        fi<br \/>\n    done<\/p>\n<p>    status &#034;Downloading AMD GPU dependencies&#8230;&#034;<br \/>\n    $SUDO rm -rf \/usr\/share\/ollama\/lib<br \/>\n    $SUDO chmod o&#043;x \/usr\/share\/ollama<br \/>\n    $SUDO install -o ollama -g ollama -m 755 -d \/usr\/share\/ollama\/lib\/rocm<br \/>\n    curl &#8211;fail &#8211;show-error &#8211;location &#8211;progress-bar &#034;https:\/\/ollama.com\/download\/ollama-linux-amd64-rocm.tgz${VER_PARAM}&#034; \\\\<br \/>\n        | $SUDO tar zx &#8211;owner ollama &#8211;group ollama -C \/usr\/share\/ollama\/lib\/rocm .<br \/>\n    install_success<br \/>\n    status &#034;AMD GPU ready.&#034;<br \/>\n    exit 0<br \/>\nfi<\/p>\n<p>CUDA_REPO_ERR_MSG&#061;&#034;NVIDIA GPU detected, but your OS and Architecture are not supported by NVIDIA.  Please install the CUDA driver manually https:\/\/docs.nvidia.com\/cuda\/cuda-installation-guide-linux\/&#034;<br \/>\n# ref: https:\/\/docs.nvidia.com\/cuda\/cuda-installation-guide-linux\/index.html#rhel-7-centos-7<br \/>\n# ref: https:\/\/docs.nvidia.com\/cuda\/cuda-installation-guide-linux\/index.html#rhel-8-rocky-8<br \/>\n# ref: https:\/\/docs.nvidia.com\/cuda\/cuda-installation-guide-linux\/index.html#rhel-9-rocky-9<br \/>\n# ref: https:\/\/docs.nvidia.com\/cuda\/cuda-installation-guide-linux\/index.html#fedora<br \/>\ninstall_cuda_driver_yum() {<br \/>\n    status &#039;Installing NVIDIA repository&#8230;&#039;<\/p>\n<p>    case $PACKAGE_MANAGER in<br \/>\n        yum)<br \/>\n            $SUDO $PACKAGE_MANAGER -y install yum-utils<br \/>\n            if curl -I &#8211;silent &#8211;fail &#8211;location &#034;https:\/\/developer.download.nvidia.com\/compute\/cuda\/repos\/$1$2\/$(uname -m | sed -e &#039;s\/aarch64\/sbsa\/&#039;)\/cuda-$1$2.repo&#034; &gt;\/dev\/null ; then<br \/>\n                $SUDO $PACKAGE_MANAGER-config-manager &#8211;add-repo https:\/\/developer.download.nvidia.com\/compute\/cuda\/repos\/$1$2\/$(uname -m | sed -e &#039;s\/aarch64\/sbsa\/&#039;)\/cuda-$1$2.repo<br \/>\n            else<br \/>\n                error $CUDA_REPO_ERR_MSG<br \/>\n            fi<br \/>\n            ;;<br \/>\n        dnf)<br \/>\n            if curl -I &#8211;silent &#8211;fail &#8211;location &#034;https:\/\/developer.download.nvidia.com\/compute\/cuda\/repos\/$1$2\/$(uname -m | sed -e &#039;s\/aarch64\/sbsa\/&#039;)\/cuda-$1$2.repo&#034; &gt;\/dev\/null ; then<br \/>\n                $SUDO $PACKAGE_MANAGER config-manager &#8211;add-repo https:\/\/developer.download.nvidia.com\/compute\/cuda\/repos\/$1$2\/$(uname -m | sed -e &#039;s\/aarch64\/sbsa\/&#039;)\/cuda-$1$2.repo<br \/>\n            else<br \/>\n                error $CUDA_REPO_ERR_MSG<br \/>\n            fi<br \/>\n            ;;<br \/>\n    esac<\/p>\n<p>    case $1 in<br \/>\n        rhel)<br \/>\n            status &#039;Installing EPEL repository&#8230;&#039;<br \/>\n            # EPEL is required for third-party dependencies such as dkms and libvdpau<br \/>\n            $SUDO $PACKAGE_MANAGER -y install https:\/\/dl.fedoraproject.org\/pub\/epel\/epel-release-latest-$2.noarch.rpm || true<br \/>\n            ;;<br \/>\n    esac<\/p>\n<p>    status &#039;Installing CUDA driver&#8230;&#039;<\/p>\n<p>    if [ &#034;$1&#034; &#061; &#039;centos&#039; ] || [ &#034;$1$2&#034; &#061; &#039;rhel7&#039; ]; then<br \/>\n        $SUDO $PACKAGE_MANAGER -y install nvidia-driver-latest-dkms<br \/>\n    fi<\/p>\n<p>    $SUDO $PACKAGE_MANAGER -y install cuda-drivers<br \/>\n}<\/p>\n<p># ref: https:\/\/docs.nvidia.com\/cuda\/cuda-installation-guide-linux\/index.html#ubuntu<br \/>\n# ref: https:\/\/docs.nvidia.com\/cuda\/cuda-installation-guide-linux\/index.html#debian<br \/>\ninstall_cuda_driver_apt() {<br \/>\n    status &#039;Installing NVIDIA repository&#8230;&#039;<br \/>\n    if curl -I &#8211;silent &#8211;fail &#8211;location &#034;https:\/\/developer.download.nvidia.com\/compute\/cuda\/repos\/$1$2\/$(uname -m | sed -e &#039;s\/aarch64\/sbsa\/&#039;)\/cuda-keyring_1.1-1_all.deb&#034; &gt;\/dev\/null ; then<br \/>\n        curl -fsSL -o $TEMP_DIR\/cuda-keyring.deb https:\/\/developer.download.nvidia.com\/compute\/cuda\/repos\/$1$2\/$(uname -m | sed -e &#039;s\/aarch64\/sbsa\/&#039;)\/cuda-keyring_1.1-1_all.deb<br \/>\n    else<br \/>\n        error $CUDA_REPO_ERR_MSG<br \/>\n    fi<\/p>\n<p>    case $1 in<br \/>\n        debian)<br \/>\n            status &#039;Enabling contrib sources&#8230;&#039;<br \/>\n            $SUDO sed &#039;s\/main\/contrib\/&#039; &lt; \/etc\/apt\/sources.list | $SUDO tee \/etc\/apt\/sources.list.d\/contrib.list &gt; \/dev\/null<br \/>\n            if [ -f &#034;\/etc\/apt\/sources.list.d\/debian.sources&#034; ]; then<br \/>\n                $SUDO sed &#039;s\/main\/contrib\/&#039; &lt; \/etc\/apt\/sources.list.d\/debian.sources | $SUDO tee \/etc\/apt\/sources.list.d\/contrib.sources &gt; \/dev\/null<br \/>\n            fi<br \/>\n            ;;<br \/>\n    esac<\/p>\n<p>    status &#039;Installing CUDA driver&#8230;&#039;<br \/>\n    $SUDO dpkg -i $TEMP_DIR\/cuda-keyring.deb<br \/>\n    $SUDO apt-get update<\/p>\n<p>    [ -n &#034;$SUDO&#034; ] &amp;&amp; SUDO_E&#061;&#034;$SUDO -E&#034; || SUDO_E&#061;<br \/>\n    DEBIAN_FRONTEND&#061;noninteractive $SUDO_E apt-get -y install cuda-drivers -q<br \/>\n}<\/p>\n<p>if [ ! -f &#034;\/etc\/os-release&#034; ]; then<br \/>\n    error &#034;Unknown distribution. Skipping CUDA installation.&#034;<br \/>\nfi<\/p>\n<p>. \/etc\/os-release<\/p>\n<p>OS_NAME&#061;$ID<br \/>\nOS_VERSION&#061;$VERSION_ID<\/p>\n<p>PACKAGE_MANAGER&#061;<br \/>\nfor PACKAGE_MANAGER in dnf yum apt-get; do<br \/>\n    if available $PACKAGE_MANAGER; then<br \/>\n        break<br \/>\n    fi<br \/>\ndone<\/p>\n<p>if [ -z &#034;$PACKAGE_MANAGER&#034; ]; then<br \/>\n    error &#034;Unknown package manager. Skipping CUDA installation.&#034;<br \/>\nfi<\/p>\n<p>if ! check_gpu nvidia-smi || [ -z &#034;$(nvidia-smi | grep -o &#034;CUDA Version: [0-9]*\\\\.[0-9]*&#034;)&#034; ]; then<br \/>\n    case $OS_NAME in<br \/>\n        centos|rhel) install_cuda_driver_yum &#039;rhel&#039; $(echo $OS_VERSION | cut -d &#039;.&#039; -f 1) ;;<br \/>\n        rocky) install_cuda_driver_yum &#039;rhel&#039; $(echo $OS_VERSION | cut -c1) ;;<br \/>\n        fedora) [ $OS_VERSION -lt &#039;39&#039; ] &amp;&amp; install_cuda_driver_yum $OS_NAME $OS_VERSION || install_cuda_driver_yum $OS_NAME &#039;39&#039;;;<br \/>\n        amzn) install_cuda_driver_yum &#039;fedora&#039; &#039;37&#039; ;;<br \/>\n        debian) install_cuda_driver_apt $OS_NAME $OS_VERSION ;;<br \/>\n        ubuntu) install_cuda_driver_apt $OS_NAME $(echo $OS_VERSION | sed &#039;s\/\\\\.\/\/&#039;) ;;<br \/>\n        *) exit ;;<br \/>\n    esac<br \/>\nfi<\/p>\n<p>if ! lsmod | grep -q nvidia || ! lsmod | grep -q nvidia_uvm; then<br \/>\n    KERNEL_RELEASE&#061;&#034;$(uname -r)&#034;<br \/>\n    case $OS_NAME in<br \/>\n        rocky) $SUDO $PACKAGE_MANAGER -y install kernel-devel kernel-headers ;;<br \/>\n        centos|rhel|amzn) $SUDO $PACKAGE_MANAGER -y install kernel-devel-$KERNEL_RELEASE kernel-headers-$KERNEL_RELEASE ;;<br \/>\n        fedora) $SUDO $PACKAGE_MANAGER -y install kernel-devel-$KERNEL_RELEASE ;;<br \/>\n        debian|ubuntu) $SUDO apt-get -y install linux-headers-$KERNEL_RELEASE ;;<br \/>\n        *) exit ;;<br \/>\n    esac<\/p>\n<p>    NVIDIA_CUDA_VERSION&#061;$($SUDO dkms status | awk -F: &#039;\/added\/ { print $1 }&#039;)<br \/>\n    if [ -n &#034;$NVIDIA_CUDA_VERSION&#034; ]; then<br \/>\n        $SUDO dkms install $NVIDIA_CUDA_VERSION<br \/>\n    fi<\/p>\n<p>    if lsmod | grep -q nouveau; then<br \/>\n        status &#039;Reboot to complete NVIDIA CUDA driver install.&#039;<br \/>\n        exit 0<br \/>\n    fi<\/p>\n<p>    $SUDO modprobe nvidia<br \/>\n    $SUDO modprobe nvidia_uvm<br \/>\nfi<\/p>\n<p># make sure the NVIDIA modules are loaded on boot with nvidia-persistenced<br \/>\nif available nvidia-persistenced; then<br \/>\n    $SUDO touch \/etc\/modules-load.d\/nvidia.conf<br \/>\n    MODULES&#061;&#034;nvidia nvidia-uvm&#034;<br \/>\n    for MODULE in $MODULES; do<br \/>\n        if ! grep -qxF &#034;$MODULE&#034; \/etc\/modules-load.d\/nvidia.conf; then<br \/>\n            echo &#034;$MODULE&#034; | $SUDO tee -a \/etc\/modules-load.d\/nvidia.conf &gt; \/dev\/null<br \/>\n        fi<br \/>\n    done<br \/>\nfi<\/p>\n<p>status &#034;NVIDIA GPU ready.&#034;<br \/>\ninstall_success <\/p>\n<p>\u7136\u540e\u627e\u5230\u8fd9\u4e2a\u4ee3\u7801\u7247\u6bb5<\/p>\n<p>if curl -I &#8211;silent &#8211;fail &#8211;location &#034;https:\/\/ollama.com\/download\/ollama-linux-${ARCH}.tgz${VER_PARAM}&#034; &gt;\/dev\/null ; then<br \/>\n    status &#034;Downloading Linux ${ARCH} bundle&#034;<br \/>\n    curl &#8211;fail &#8211;show-error &#8211;location &#8211;progress-bar \\\\<br \/>\n        &#034;https:\/\/ollama.com\/download\/ollama-linux-${ARCH}.tgz${VER_PARAM}&#034; | \\\\<br \/>\n        $SUDO tar -xzf &#8211; -C &#034;$OLLAMA_INSTALL_DIR&#034;<br \/>\n    BUNDLE&#061;1<br \/>\n    if [ &#034;$OLLAMA_INSTALL_DIR\/bin\/ollama&#034; !&#061; &#034;$BINDIR\/ollama&#034; ] ; then<br \/>\n        status &#034;Making ollama accessible in the PATH in $BINDIR&#034;<br \/>\n        $SUDO ln -sf &#034;$OLLAMA_INSTALL_DIR\/ollama&#034; &#034;$BINDIR\/ollama&#034;<br \/>\n    fi<br \/>\nelse<br \/>\n    status &#034;Downloading Linux ${ARCH} CLI&#034;<br \/>\n    curl &#8211;fail &#8211;show-error &#8211;location &#8211;progress-bar -o &#034;$TEMP_DIR\/ollama&#034;\\\\<br \/>\n    &#034;https:\/\/ollama.com\/download\/ollama-linux-${ARCH}${VER_PARAM}&#034;<br \/>\n    $SUDO install -o0 -g0 -m755 $TEMP_DIR\/ollama $OLLAMA_INSTALL_DIR\/ollama<br \/>\n    BUNDLE&#061;0<br \/>\n    if [ &#034;$OLLAMA_INSTALL_DIR\/ollama&#034; !&#061; &#034;$BINDIR\/ollama&#034; ] ; then<br \/>\n        status &#034;Making ollama accessible in the PATH in $BINDIR&#034;<br \/>\n        $SUDO ln -sf &#034;$OLLAMA_INSTALL_DIR\/ollama&#034; &#034;$BINDIR\/ollama&#034;<br \/>\n    fi<br \/>\nfi<\/p>\n<p>\u53ef\u4ee5\u770b\u5230\u8fd9\u91cc\u7684\u8def\u5f84\u662f\u5b98\u7f51\u7684&#xff0c;\u6211\u4eec\u8981\u641e\u6210\u81ea\u5df1\u7684<\/p>\n<p>status &#034;Installing ollama to $OLLAMA_INSTALL_DIR&#034;<br \/>\n$SUDO install -o0 -g0 -m755 -d $BINDIR<br \/>\n$SUDO install -o0 -g0 -m755 -d &#034;$OLLAMA_INSTALL_DIR&#034;<br \/>\nstatus &#034;Downloading Linux ${ARCH} bundle&#034;<br \/>\n #    curl &#8211;fail &#8211;show-error &#8211;location &#8211;progress-bar \\\\<br \/>\n #        &#034;https:\/\/ollama.com\/download\/ollama-linux-${ARCH}.tgz${VER_PARAM}&#034; | \\\\<br \/>\n $SUDO tar -xzf .\/Ollama.tgz -C &#034;$OLLAMA_INSTALL_DIR&#034;<br \/>\n BUNDLE&#061;1<br \/>\n if [ &#034;$OLLAMA_INSTALL_DIR\/bin\/ollama&#034; !&#061; &#034;$BINDIR\/ollama&#034; ] ; then<br \/>\n     status &#034;Making ollama accessible in the PATH in $BINDIR&#034;<br \/>\n     $SUDO ln -sf &#034;$OLLAMA_INSTALL_DIR\/ollama&#034; &#034;$BINDIR\/ollama&#034;<br \/>\n fi<\/p>\n<p><span style=\"color:#fe2c24\">\u6ce8\u610f\u6587\u4ef6\u540d&#xff0c;\u6539\u6210\u81ea\u5df1\u7684&#xff0c;<\/span>\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\u662f\/home\/Ollama.tgz, \u4f9d\u636e\u5b9e\u9645\u60c5\u51b5\u6765\u6539&#xff08;\u53c2\u8003\u81eahttps:\/\/blog.csdn.net\/weixin_43278082\/article\/details\/142357712&#xff09;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"402\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418113729-68023979c9a4f.png\" width=\"911\" \/><\/p>\n<p>\u628a\u8be5\u6587\u4ef6\u7528rz\u6307\u4ee4\u4e0a\u4f20\u81f3\u670d\u52a1\u5668\u3002<\/p>\n<hr \/>\n<p>\u56db.\u5b89\u88c5<\/p>\n<p>1.\u89e3\u51b3\u62a5\u9519<\/p>\n<p>\u62a5\u9519&#xff1a;<\/p>\n<p>install.sh: line 4: $&#039;\\\\r&#039;: command not found<br \/>\n: invalid option 5: set: &#8211;<br \/>\nset: usage: set [-abefhkmnptuvxBCHP] [-o option-name] [&#8211;] [arg &#8230;] <\/p>\n<p>\u539f\u56e0&#xff1a;<\/p>\n<p>\u51fa\u73b0\u8fd9\u4e2a\u9519\u8bef\u662f\u56e0\u4e3a\u4f60\u7684\u811a\u672c\u6587\u4ef6\u5728Windows\u73af\u5883\u4e0b\u88ab\u7f16\u8f91\u6216\u4fdd\u5b58\u8fc7&#xff0c;\u5bfc\u81f4\u5b83\u5305\u542b\u4e86Windows\u98ce\u683c\u7684\u6362\u884c\u7b26&#xff08;CRLF&#xff09;&#xff0c;\u800cLinux\u7cfb\u7edf\u4e0b\u7684\u811a\u672c\u901a\u5e38\u4f7f\u7528UNIX\u98ce\u683c\u7684\u6362\u884c\u7b26&#xff08;LF&#xff09;\u3002\u6b64\u5916&#xff0c;set: invalid option 5\u7684\u9519\u8bef\u63d0\u793a\u8868\u660e\u811a\u672c\u4e2d\u53ef\u80fd\u5b58\u5728\u8bed\u6cd5\u9519\u8bef\u3002<\/p>\n<p>\u89e3\u51b3&#xff1a;\u4f7f\u7528dos2unix\u5de5\u5177\u5c06\u811a\u672c\u6587\u4ef6\u7684\u6362\u884c\u7b26\u4eceCRLF\u8f6c\u6362\u4e3aLF<\/p>\n<p>\u4f7f\u7528\u8be5\u547d\u4ee4\u4e0b\u8f7d\u5fc5\u8981\u7684\u5305<\/p>\n<p>sudo yum install dos2unix <\/p>\n<p>\u8f6c\u6362<\/p>\n<p>dos2unix install.sh <\/p>\n<p>\u7136\u540e\u5728install.sh\u6587\u4ef6\u76ee\u5f55\u4e0b\u6267\u884c<\/p>\n<p>sh install.sh <\/p>\n<p>\u7b49\u5f85\u5b89\u88c5\u5373\u53ef<\/p>\n<hr \/>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"741\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418113729-68023979ed652.png\" width=\"1200\" \/><\/p>\n<p>\u6700\u7ec8\u5b89\u88c5\u6210\u529f<\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb3.1k\u6b21\uff0c\u70b9\u8d5e9\u6b21\uff0c\u6536\u85cf13\u6b21\u3002\u51fa\u73b0\u8fd9\u4e2a\u9519\u8bef\u662f\u56e0\u4e3a\u4f60\u7684\u811a\u672c\u6587\u4ef6\u5728Windows\u73af\u5883\u4e0b\u88ab\u7f16\u8f91\u6216\u4fdd\u5b58\u8fc7\uff0c\u5bfc\u81f4\u5b83\u5305\u542b\u4e86Windows\u98ce\u683c\u7684\u6362\u884c\u7b26\uff08CRLF\uff09\uff0c\u800cLinux\u7cfb\u7edf\u4e0b\u7684\u811a\u672c\u901a\u5e38\u4f7f\u7528UNIX\u98ce\u683c\u7684\u6362\u884c\u7b26\uff08LF\uff09\u3002\u53ef\u4ee5\u770b\u5230\u8fd9\u91cc\u7684\u8def\u5f84\u662f\u5b98\u7f51\u7684\uff0c\u6211\u4eec\u8981\u641e\u6210\u81ea\u5df1\u7684\u3002\u5de5\u5177\u5c06\u811a\u672c\u6587\u4ef6\u7684\u6362\u884c\u7b26\u4eceCRLF\u8f6c\u6362\u4e3aLF\u3002\u7136\u540e\u5728install.sh\u6587\u4ef6\u76ee\u5f55\u4e0b\u6267\u884c\u3002\u7684\u9519\u8bef\u63d0\u793a\u8868\u660e\u811a\u672c\u4e2d\u53ef\u80fd\u5b58\u5728\u8bed\u6cd5\u9519\u8bef\u3002\u53cc\u51fb\u6253\u5f00\uff0c\u6211\u8fd9\u91cc\u7528vscode\u6253\u5f00\u3002\u628a\u8be5\u6587\u4ef6\u7528rz\u6307\u4ee4\u4e0a\u4f20\u81f3\u670d\u52a1\u5668\u3002\u67e5\u770b\u81ea\u5df1\u7684\u670d\u52a1\u5668\u4fe1\u606f\uff08\u53c2\u8003\u3002\u4e09.\u4e0b\u8f7d\u5b98\u7f51\u7684\u5b89\u88c5\u7a0b\u5e8f\u3002\u4f7f\u7528\u8be5\u547d\u4ee4\u4e0b\u8f7d\u5fc5\u8981\u7684\u5305\u3002_ollama-linux-amd64.tgz<\/p>\n","protected":false},"author":2,"featured_media":12459,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[43,44],"topic":[],"class_list":["post-12463","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-43","tag-44"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u79bb\u7ebf\u5b89\u88c5ollama\u5230\u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/12463.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u79bb\u7ebf\u5b89\u88c5ollama\u5230\u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb3.1k\u6b21\uff0c\u70b9\u8d5e9\u6b21\uff0c\u6536\u85cf13\u6b21\u3002\u51fa\u73b0\u8fd9\u4e2a\u9519\u8bef\u662f\u56e0\u4e3a\u4f60\u7684\u811a\u672c\u6587\u4ef6\u5728Windows\u73af\u5883\u4e0b\u88ab\u7f16\u8f91\u6216\u4fdd\u5b58\u8fc7\uff0c\u5bfc\u81f4\u5b83\u5305\u542b\u4e86Windows\u98ce\u683c\u7684\u6362\u884c\u7b26\uff08CRLF\uff09\uff0c\u800cLinux\u7cfb\u7edf\u4e0b\u7684\u811a\u672c\u901a\u5e38\u4f7f\u7528UNIX\u98ce\u683c\u7684\u6362\u884c\u7b26\uff08LF\uff09\u3002\u53ef\u4ee5\u770b\u5230\u8fd9\u91cc\u7684\u8def\u5f84\u662f\u5b98\u7f51\u7684\uff0c\u6211\u4eec\u8981\u641e\u6210\u81ea\u5df1\u7684\u3002\u5de5\u5177\u5c06\u811a\u672c\u6587\u4ef6\u7684\u6362\u884c\u7b26\u4eceCRLF\u8f6c\u6362\u4e3aLF\u3002\u7136\u540e\u5728install.sh\u6587\u4ef6\u76ee\u5f55\u4e0b\u6267\u884c\u3002\u7684\u9519\u8bef\u63d0\u793a\u8868\u660e\u811a\u672c\u4e2d\u53ef\u80fd\u5b58\u5728\u8bed\u6cd5\u9519\u8bef\u3002\u53cc\u51fb\u6253\u5f00\uff0c\u6211\u8fd9\u91cc\u7528vscode\u6253\u5f00\u3002\u628a\u8be5\u6587\u4ef6\u7528rz\u6307\u4ee4\u4e0a\u4f20\u81f3\u670d\u52a1\u5668\u3002\u67e5\u770b\u81ea\u5df1\u7684\u670d\u52a1\u5668\u4fe1\u606f\uff08\u53c2\u8003\u3002\u4e09.\u4e0b\u8f7d\u5b98\u7f51\u7684\u5b89\u88c5\u7a0b\u5e8f\u3002\u4f7f\u7528\u8be5\u547d\u4ee4\u4e0b\u8f7d\u5fc5\u8981\u7684\u5305\u3002_ollama-linux-amd64.tgz\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/12463.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-18T11:37:31+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418113726-68023976e6a26.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/12463.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/12463.html\",\"name\":\"\u79bb\u7ebf\u5b89\u88c5ollama\u5230\u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-18T11:37:31+00:00\",\"dateModified\":\"2025-04-18T11:37:31+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/12463.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/12463.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/12463.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u79bb\u7ebf\u5b89\u88c5ollama\u5230\u670d\u52a1\u5668\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u79bb\u7ebf\u5b89\u88c5ollama\u5230\u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/12463.html","og_locale":"zh_CN","og_type":"article","og_title":"\u79bb\u7ebf\u5b89\u88c5ollama\u5230\u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb3.1k\u6b21\uff0c\u70b9\u8d5e9\u6b21\uff0c\u6536\u85cf13\u6b21\u3002\u51fa\u73b0\u8fd9\u4e2a\u9519\u8bef\u662f\u56e0\u4e3a\u4f60\u7684\u811a\u672c\u6587\u4ef6\u5728Windows\u73af\u5883\u4e0b\u88ab\u7f16\u8f91\u6216\u4fdd\u5b58\u8fc7\uff0c\u5bfc\u81f4\u5b83\u5305\u542b\u4e86Windows\u98ce\u683c\u7684\u6362\u884c\u7b26\uff08CRLF\uff09\uff0c\u800cLinux\u7cfb\u7edf\u4e0b\u7684\u811a\u672c\u901a\u5e38\u4f7f\u7528UNIX\u98ce\u683c\u7684\u6362\u884c\u7b26\uff08LF\uff09\u3002\u53ef\u4ee5\u770b\u5230\u8fd9\u91cc\u7684\u8def\u5f84\u662f\u5b98\u7f51\u7684\uff0c\u6211\u4eec\u8981\u641e\u6210\u81ea\u5df1\u7684\u3002\u5de5\u5177\u5c06\u811a\u672c\u6587\u4ef6\u7684\u6362\u884c\u7b26\u4eceCRLF\u8f6c\u6362\u4e3aLF\u3002\u7136\u540e\u5728install.sh\u6587\u4ef6\u76ee\u5f55\u4e0b\u6267\u884c\u3002\u7684\u9519\u8bef\u63d0\u793a\u8868\u660e\u811a\u672c\u4e2d\u53ef\u80fd\u5b58\u5728\u8bed\u6cd5\u9519\u8bef\u3002\u53cc\u51fb\u6253\u5f00\uff0c\u6211\u8fd9\u91cc\u7528vscode\u6253\u5f00\u3002\u628a\u8be5\u6587\u4ef6\u7528rz\u6307\u4ee4\u4e0a\u4f20\u81f3\u670d\u52a1\u5668\u3002\u67e5\u770b\u81ea\u5df1\u7684\u670d\u52a1\u5668\u4fe1\u606f\uff08\u53c2\u8003\u3002\u4e09.\u4e0b\u8f7d\u5b98\u7f51\u7684\u5b89\u88c5\u7a0b\u5e8f\u3002\u4f7f\u7528\u8be5\u547d\u4ee4\u4e0b\u8f7d\u5fc5\u8981\u7684\u5305\u3002_ollama-linux-amd64.tgz","og_url":"https:\/\/www.wsisp.com\/helps\/12463.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-18T11:37:31+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418113726-68023976e6a26.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"11 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/12463.html","url":"https:\/\/www.wsisp.com\/helps\/12463.html","name":"\u79bb\u7ebf\u5b89\u88c5ollama\u5230\u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-18T11:37:31+00:00","dateModified":"2025-04-18T11:37:31+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/12463.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/12463.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/12463.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u79bb\u7ebf\u5b89\u88c5ollama\u5230\u670d\u52a1\u5668"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/12463","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=12463"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/12463\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/12459"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=12463"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=12463"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=12463"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=12463"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}