PIP安装错误

下面是报错情况:error: externally-managed-environment

解决步骤pipx安装:

apt install pipx


pipx ensurepath


pipx install pymysql

Ubuntu 24.04系统下出现报错信息

root@fzjt:/home/fzpip3 install jieba
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.

    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.

    If you wish to install a non-Debian packaged Python application,
    it may be easiest to use pipx install xyz, which will manage a
    virtual environment for you. Make sure you have pipx installed.

    See /usr/share/doc/python3.12/README.venv for more information.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.

手动安装Ollama Ubuntu24.04 CPU

手动安装

下载 ollama 二进制文件

Ollama 以自包含的二进制文件形式分发。将其下载到您的 PATH 中的目录:

sudo curl -L https://ollama.com/download/ollama-linux-amd64 -o /usr/bin/ollama

#下载上面的文件保存为 /usr/bin/ollama 并为它添加启动权限

sudo chmod +x /usr/bin/ollama

将 Ollama 添加为启动服务(推荐)

为 Ollama 创建一个用户:

sudo useradd -r -s /bin/false -m -d /usr/share/ollama ollama

在 /etc/systemd/system/ollama.service 中创建一个服务文件

[Unit]
Description=Ollama Service
After=network-online.target

[Service]
ExecStart=/usr/bin/ollama serve
User=ollama
Group=ollama
Restart=always
RestartSec=3

[Install]
WantedBy=default.target

然后启动服务:

sudo systemctl daemon-reload

sudo systemctl enable ollama

安装Open WEBUI

pip install open-webui

Ubuntu 磁盘重新分配

安装默认根目录是100GB,也可以自己分配,查看磁盘挂载情况 root下执行

根目录在文件系统 /dev/mapper/ubuntu–vg-ubuntu–lv

vgdisplay

  VG Size               <1.82 TiB
  PE Size               4.00 MiB
  Total PE              476287
  Alloc PE / Size       76800 / 300.00 GiB
  Free  PE / Size       399487 / 1.52 TiB
df -h

Filesystem                         Size  Used Avail Use% Mounted on
tmpfs                              3.2G  2.4M  3.2G   1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv  295G   15G  265G   6% /
tmpfs                               16G     0   16G   0% /dev/shm
tmpfs                              5.0M     0  5.0M   0% /run/lock
/dev/sda2                          2.0G  182M  1.7G  10% /boot
tmpfs                              3.2G   12K  3.2G   1% /run/user/1000



vgdisplay 
#查看分配情况

lvextend -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv
#将所有的空间给/dev/mapper/ubuntu--vg-ubuntu--lv


resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv
#调整大小


df -h 

Filesystem                         Size  Used Avail Use% Mounted on
tmpfs                              3.2G  2.4M  3.2G   1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv  1.8T   16G  1.7T   1% /
tmpfs                               16G     0   16G   0% /dev/shm
tmpfs                              5.0M     0  5.0M   0% /run/lock
/dev/sda2                          2.0G  182M  1.7G  10% /boot
tmpfs                              3.2G   12K  3.2G   1% /run/user/1000


windows7 CDC驱动

保存到文件usbser.inf 文件。
windows管理中载入驱动,选择刚刚保存的文件。

;/*++
;
;Copyright (c) Microsoft Corporation.  All rights reserved.
;
;Module Name:
;    usbser.inf
;
;Abstract:
;    INF file for installing the USB Serial driver
;
;--*/

;*****************************************
; Version section
;*****************************************
[Version]
Signature   = "$WINDOWS NT$"
Class       = Ports
ClassGUID   = {4D36E978-E325-11CE-BFC1-08002BE10318}
Provider    = %MSFT%
PnpLockdown = 1
DriverVer = 06/21/2006,10.0.18362.1

[DestinationDirs]
DefaultDestDir = 12
UsbSerial_CopyFiles = 12

;[SourceDisksNames]
;3426 = windows cd

;[SourceDisksFiles]
;usbser.sys = 3426

[ControlFlags]
ExcludeFromSelect = *

;*****************************************
; Install Section
;*****************************************

[Manufacturer]
%MSFT% = Standard, NTamd64

[Standard.NTamd64]
%UsbSerial.DeviceDesc% = UsbSerial_Install, USB\Class_02&SubClass_02&Prot_01
%UsbSerial.DeviceDesc% = UsbSerial_Install, USB\Class_02&SubClass_02

; USB modem filter driver for use with Include/Needs only
%UsbSerialModem.DeviceDesc% = UsbSerial_ModemFilter_Install

[UsbSerial_Install.NT]
CopyFiles   = UsbSerial_CopyFiles
AddReg      = UsbSerial_AddReg
AddProperty = UsbSerial_AddProperty

; intentionally blank so that in future if we ever put anything in here
; it will get get picked up via Include/Needs
[UsbSerial_Install.NT.Hw]

[UsbSerial_CopyFiles]
usbser.sys,,,0x100

[UsbSerial_AddReg]
HKR,,PortSubClass,%REG_BINARY%,02
HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"

[UsbSerial_AddProperty]
GenericDriverInstalled,,,,1

;*****************************************
; Service installation section
;*****************************************

[UsbSerial_Install.NT.Services]
AddService = usbser,0x00000002,UsbSerial_Service_Install, UsbSerial_EventLog_Install

[UsbSerial_Service_Install]
DisplayName   = %UsbSerial.DriverDesc%
ServiceType   = 1           ; SERVICE_KERNEL_DRIVER
StartType     = 3           ; SERVICE_DEMAND_START
ErrorControl  = 1           ; SERVICE_ERROR_NORMAL
ServiceBinary = %12%\usbser.sys

[UsbSerial_EventLog_Install]
AddReg=UsbSerial_EventLog_AddReg

[UsbSerial_EventLog_AddReg]
HKR,,EventMessageFile,0x00020000,"%%SystemRoot%%\System32\IoLogMsg.dll;%%SystemRoot%%\System32\Drivers\usbser.sys"
HKR,,TypesSupported,0x00010001,7

;***********************************************************
; Modem install section to install usbser as a lower filter
; (Include/Needs from modem INFs)
;***********************************************************

[UsbSerial_ModemFilter_Install]
CopyFiles=UsbSerial_CopyFiles 

[UsbSerial_ModemFilter_Install.Hw]
AddReg=UsbSerial_ModemFilter_AddReg

[UsbSerial_ModemFilter_AddReg]
HKR,,LowerFilters,%REG_MULTI_SZ%,"usbser"

[UsbSerial_ModemFilter_Install.Services]
AddService=usbser,,UsbSerial_Service_Install,UsbSerial_EventLog_Install

;*****************************************
; Strings section
;*****************************************

[Strings]
; localizable
MSFT                      = "Microsoft"
UsbSerial.DeviceDesc      = "USB Serial Device"
UsbSerialModem.DeviceDesc = "USB Serial Modem Device"
UsbSerial.DriverDesc      = "Microsoft USB Serial Driver"

; non-localizable
REG_BINARY   = 0x00000001
REG_MULTI_SZ = 0x00010000