Ubuntu系统本地化搭建Maxakb+Ollama
111
·
安装docker
1.Ubuntu 24.04 更换源
在 Ubuntu 24.04 中,更换软件源可以提高软件包下载速度和系统更新效率。以下是更换为阿里云源的步骤:
备份当前源列表
首先,备份当前的源列表文件:
sudo cp /etc/apt/sources.list.d/ubuntu.sources /etc/apt/sources.list.d/ubuntu.sources.bak
编辑源列表文件
使用文本编辑器打开源列表文件:
sudo vim /etc/apt/sources.list.d/ubuntu.sources
添加阿里云源
在文本编辑器中粘贴以下内容:
阿里云
Types: deb
URIs: http://mirrors.aliyun.com/ubuntu/
Suites: noble noble-updates noble-security
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
保存并关闭文本编辑器。
更新源列表
更新源列表并升级系统软件包:
sudo apt-get update
sudo apt-get upgrade
如果需要使用其他国内源,可以参考以下配置:
清华源
Types: deb
URIs: http://mirrors.tuna.tsinghua.edu.cn/ubuntu/
Suites: noble noble-updates noble-security
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
中科大源
Types: deb
URIs: http://mirrors.ustc.edu.cn/ubuntu/
Suites: noble noble-updates noble-security
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
网易163源
Types: deb
URIs: http://mirrors.163.com/ubuntu/
Suites: noble noble-updates noble-security
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
2.最详细的ubuntu 安装 docker教程-腾讯云开发者社区-腾讯云
最详细的ubuntu 安装 docker教程-腾讯云开发者社区-腾讯云
安装Ollama
Ollama官网
执行命令:
curl -fsSL https://ollama.com/install.sh | sh
安装完成后下载模型
执行命令:
ollama run llama3.3:70b
安装MaxKb
执行命令:
docker run -d --name=maxkb -p 8080:8080 -v ~/.maxkb:/var/lib/postgresql/data 1panel/maxkb
API 域名无效
需要修改 ollama.service 配置文件,以允许所有 IP 访问。
找到 /etc/systemd/system/ollama.service 文件:
在 [Service] 部分添加一行:
Environment="OLLAMA_HOST=0.0.0.0"
重新加载 systemd 配置:
sudo systemctl daemon-reload
重启 ollama 服务以应用更改:
sudo systemctl restart ollama
1.函数依赖包安装
如果函数实现需要安装第三方依赖包,可在 maxkb 容器中使用 pip 命令进行安装。
进入 maxkb 容器中
docker exec -it maxkb bash
pip安装第三方依赖,如 pymysql,执行下面命令
pip install pymysql
更多推荐



所有评论(0)