OneDrive Client for Linux(onedrive)在 Debian / Ubuntu 系列发行版上通过 OpenSuSE Build Service 仓库安装的完整指南
2026/9/23 2:11:21 网站建设 项目流程

OneDrive Client for Linux(onedrive)在 Debian / Ubuntu 系列发行版上通过 OpenSuSE Build Service 仓库安装的完整指南

【免费下载链接】onedriveOneDrive Client for Linux项目地址: https://gitcode.com/gh_mirrors/onedri/onedrive

本篇技术指南以 docs/ubuntu-package-install.md 为骨架,系统讲解如何在 Debian、Ubuntu 及其衍生发行版上,通过 OpenSuSE Build Service(OBS)官方构建仓库安装OneDrive Client for Linux(onedrive)。文章完整覆盖从清理旧环境、确定发行版基线到逐发行版添加仓库密钥、配置 apt 源、安装与初始化认证的全过程,并结合仓库内 src/itemdb.d、src/config.d、contrib/systemd 等源码与单元文件,说明常见报错的底层成因与正确的 systemd 使用方式。读完本文,你将能在一台干净或存在历史残留的 Debian/Ubuntu 系统上,可靠地安装到受支持、随版本持续维护的 onedrive 客户端。

适用范围与重要前提

本文提供的安装步骤仅适用于以下平台与发行版:

  • Debian
  • Deepin
  • Elementary OS
  • Kali Linux
  • Lubuntu
  • Linux Mint
  • MX Linux
  • Pop!_OS
  • Peppermint OS
  • Raspbian | Raspberry Pi OS
  • Ubuntu | Kubuntu | Xubuntu | Ubuntu Mate
  • Zorin OS

[!CAUTION]不要安装发行版自带仓库中的 onedrive 包。尽管 Debian、Ubuntu 等发行版仓库中确实存在 onedrive 软件包,但这些由发行版维护的包版本陈旧、不受支持,且包含已在较新版本中修复的缺陷与问题,不应被使用。

[!IMPORTANT] 下表列出的发行版版本已经End-of-Life(EOL),不再受当前客户端版本支持,也不会进行测试。必须先升级到受支持的发行版才能继续:

  • Debian 9
  • Debian 10
  • Ubuntu 16.x
  • Ubuntu 18.x
  • Ubuntu 20.x

确定应使用哪套安装指引

Ubuntu 及其衍生系统基于不同的发行版基线(例如 Linux Mint 21.x 基于 Ubuntu 22.04,Linux Mint Debian Edition 基于 Debian),因此必须选择与自身基线匹配的安装步骤,否则会遇到软件包依赖冲突,无法完成安装。

Step 1:移除已配置的 PPA、旧 onedrive 包与错误的 systemd 服务文件

很多网络上的"帮助"页面给出的安装方法相互矛盾。在开始正式安装前,需要清理三类历史残留。

Step 1a:移除已配置的 PPA(如果存在)

大量第三方网页仍然引导用户通过 yann1ck PPA 仓库安装客户端,但该 PPA 已不存在,不应再使用。如果此前配置或尝试添加过该 PPA,请执行移除:

sudo add-apt-repository --remove ppa:yann1ck/onedrive
Step 1b:移除从 Debian / Ubuntu 仓库安装的 onedrive 包

许多网页仍然建议用户在不配置 OpenSuSE Build Service(OBS)仓库的情况下直接执行sudo apt install onedrive。这样装到的是已过时的客户端版本——已知缺陷虽已在后续版本修复,但该发行版包还附带了一个错误的 systemd 服务(见下),会干扰客户端的后台运行。

请卸载来自 Ubuntu Universe / Debian 官方仓库的客户端:

sudo apt remove onedrive
Step 1c:移除发行版包安装时创建的错误的 systemd 服务文件

Debian 与 Ubuntu 的发行版包在安装时会自动创建并启用一个用户级 systemd 服务,使客户端在认证后自动运行。安装过程中可能看到如下输出:

Created symlink /etc/systemd/user/default.target.wants/onedrive.service → /usr/lib/systemd/user/onedrive.service.

这个 systemd 条目不属于本项目的安装模型,它是 Debian/Ubuntu 打包默认行为引入的,应当被移除。如果放任不管,客户端启动时可能报出以下错误:

Opening the item database ... ERROR: onedrive application is already running - check system process list for active application instances - Use 'sudo ps aufxw | grep onedrive' to potentially determine active running process Waiting for all internal threads to complete before exiting application

由于客户端以启用 GUI 通知的方式构建,该服务的每次自动重启还可能刷屏桌面通知

移除发行版包创建的符号链接:

sudo rm /etc/systemd/user/default.target.wants/onedrive.service

如果移除该服务,卸载 onedrive 包后 systemd 会不断尝试重启并不停写日志,类似:

Feb 10 10:32:00 host systemd[USER_A]: Started onedrive.service - OneDrive Client for Linux. Feb 10 10:32:00 host (onedrive)[PID_A]: onedrive.service: Unable to locate executable '/usr/bin/onedrive': No such file or directory Feb 10 10:32:00 host (onedrive)[PID_A]: onedrive.service: Failed at step EXEC spawning /usr/bin/onedrive: No such file or directory Feb 10 10:32:00 host systemd[USER_A]: onedrive.service: Main process exited, code=exited, status=203/EXEC Feb 10 10:32:00 host systemd[USER_A]: onedrive.service: Failed with result 'exit-code'. Feb 10 10:32:02 host systemd[USER_B]: Started onedrive.service - OneDrive Client for Linux. Feb 10 10:32:02 host (onedrive)[PID_B]: onedrive.service: Unable to locate executable '/usr/bin/onedrive': No such file or directory Feb 10 10:32:02 host systemd[USER_B]: onedrive.service: Failed at step EXEC spawning /usr/bin/onedrive: No such file or directory Feb 10 10:32:02 host systemd[USER_B]: onedrive.service: Main process exited, code=exited, status=203/EXEC Feb 10 10:32:02 host systemd[USER_B]: onedrive.service: Failed with result 'exit-code'. Feb 10 10:32:03 host systemd[USER_A]: onedrive.service: Scheduled restart job, restart counter is at 201. Feb 10 10:32:03 host systemd[USER_A]: Starting onedrive.service - OneDrive Client for Linux... Feb 10 10:32:05 host systemd[USER_B]: onedrive.service: Scheduled restart job, restart counter is at 105. Feb 10 10:32:05 host systemd[USER_B]: Starting onedrive.service - OneDrive Client for Linux...

上述行为源于 Debian/Ubuntu 的打包默认值,OpenSuSE Build Service 包不会出现此问题

从源码层面看,这条 "already running" 报错对应的正是客户端打开本地 SQLite 物品数据库时的数据库锁检测。在 src/itemdb.d 中,Database(filename)初始化若抛出database is locked(SQLite error code 5),客户端即输出ERROR: The 'onedrive' application is already running ...并建议用sudo ps aufxw | grep onedrive排查活动进程。也就是说:当存在两个 onedrive 实例(例如手动启动的实例 + 发行版 systemd 服务自动拉起的实例)同时争用同一个 items 数据库时,后启动的实例就会因数据库锁而退出。这正是 Step 1c 必须清理该错误服务的原因。

Step 2:确保系统处于最新状态

使用类似下面的脚本确保系统已完整更新:

#!/bin/bash rm -rf /var/lib/dpkg/lock-frontend rm -rf /var/lib/dpkg/lock apt-get update apt-get upgrade -y apt-get dist-upgrade -y apt-get autoremove -y apt-get autoclean -y

以 root 身份运行该脚本,可使用su -提权。示例(Ubuntu 24.04 LTS 环境):

Welcome to Ubuntu 24.04 LTS (GNU/Linux 6.8.0-36-generic x86_64) * Documentation: https://help.ubuntu.com * Management: https://landscape.canonical.com * Support: https://ubuntu.com/pro Expanded Security Maintenance for Applications is not enabled. 0 updates can be applied immediately. Enable ESM Apps to receive additional future security updates. See https://ubuntu.com/esm or run: sudo pro status The list of available updates is more than a week old. To check for new updates run: sudo apt update Last login: Mon Nov 10 06:42:58 2025 from xxx.xxx.xxx.xxx alex@ubuntu-24-04:~$ su - Password: root@ubuntu-24-04:~# ls -la total 36 drwx------ 5 root root 4096 Nov 10 06:43 . drwxr-xr-x 23 root root 4096 Jun 30 2024 .. -rw------- 1 root root 168 Nov 10 06:43 .bash_history -rw-r--r-- 1 root root 3106 Apr 22 2024 .bashrc drwx------ 2 root root 4096 Apr 24 2024 .cache -rw-r--r-- 1 root root 161 Apr 22 2024 .profile drwx------ 6 root root 4096 Jun 30 2024 snap drwx------ 2 root root 4096 Jun 30 2024 .ssh -rwxr-xr-x 1 root root 174 Nov 10 06:43 update_os.sh root@ubuntu-24-04:~# cat update_os.sh #!/bin/bash rm -rf /var/lib/dpkg/lock-frontend rm -rf /var/lib/dpkg/lock apt-get update apt-get upgrade -y apt-get dist-upgrade -y apt-get autoremove -y apt-get autoclean -y root@ubuntu-24-04:~# ./update_os.sh Get:1 http://security.ubuntu.com/ubuntu noble-security InRelease [126 kB] Hit:2 http://au.archive.ubuntu.com/ubuntu noble InRelease Get:3 http://au.archive.ubuntu.com/ubuntu noble-updates InRelease [126 kB] Get:4 http://au.archive.ubuntu.com/ubuntu noble-backports InRelease [126 kB] Get:5 http://au.archive.ubuntu.com/ubuntu noble-updates/main amd64 Packages [1,585 kB] .... Unpacking libglx-mesa0:amd64 (25.0.7-0ubuntu0.24.04.2) over (24.0.5-1ubuntu1) ... Preparing to unpack .../6-libgl1-amber-dri_21.3.9-0ubuntu3~24.04.1_amd64.deb ... Unpacking libgl1-amber-dri:amd64 (21.3.9-0ubuntu3~24.04.1) over (21.3.9-0ubuntu2) ... (Reading database ... 152058 files and directories currently installed.) Removing libglapi-mesa:amd64 (24.0.5-1ubuntu1) ... Selecting previously unselected package libglapi-amber:amd64. (Reading database ... 152049 files and directories currently installed.) Preparing to unpack .../00-libglapi-amber_21.3.9-0ubuntu3~24.04.1_amd64.deb ... Unpacking libglapi-amber:amd64 (21.3.9-0ubuntu3~24.04.1) ... Selecting previously unselected package libmalcontent-0-0:amd64. Preparing to unpack .../01-libmalcontent-0-0_0.11.1-1ubuntu1.2_amd64.deb ... Unpacking libmalcontent-0-0:amd64 (0.11.1-1ubuntu1.2) ... Selecting previously unselected package libxatracker2:amd64 (25.0.7-0ubuntu0.24.04.2) over (24.0.5-1ubuntu1) ... Unpacking libxatracker2:amd64 (25.0.7-0ubuntu0.24.04.2) over (24.0.5-1ubuntu1) ... Selecting previously unselected package linux-modules-6.14.0-35-generic. Preparing to unpack .../04-linux-modules-6.14.0-35-generic_6.14.0-35.35~24.04.1_amd64.deb ... Unpacking linux-modules-6.14.0-35-generic (6.14.0-35.35~24.04.1) ... Selecting previously unselected package linux-image-6.14.0-35-generic. Preparing to unpack .../05-linux-image-6.14.0-35-generic_6.14.0-35.35~24.04.1_amd64.deb ... Unpacking linux-image-6.14.0-35-generic (6.14.0-35.35~24.04.1) ... Selecting previously unselected package linux-modules-extra-6.14.0-35-generic. Preparing to unpack .../06-linux-modules-extra-6.14.0-35-generic_6.14.0-35.35~24.04.1_amd64.deb ... .... Del libpam-modules-bin 1.5.3-5ubuntu5.1 [51.9 kB] Del systemd-sysv 255.4-1ubuntu8.1 [11.9 kB] root@ubuntu-24-04:~#

更新完成后重启系统再进入 Step 3。这样既能保证系统处于正确的最新状态,也能确保之前残留的 onedrive 进程与 systemd 服务已被清除、不再运行:

reboot

Step 3:确定系统基于哪个发行版

执行以下命令确定系统基线:

lsb_release -a

示例:

alex@ubuntu-24-04:~$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 24.04 LTS Release: 24.04 Codename: noble alex@ubuntu-24-04:~$

Step 4:选择正确的安装指引

根据lsb_release输出,对照下表选择应使用的安装步骤:

Release & CodenameInstructions to use
Linux Mint 19.x该平台已End-of-Life(EOL),不再支持,必须至少升级到 Linux Mint 22.x
Linux Mint 20.x该平台已End-of-Life(EOL),不再支持,必须至少升级到 Linux Mint 22.x
Linux Mint 21.x使用下方 Ubuntu 22.04 指引
Linux Mint 22.x使用下方 Ubuntu 24.04 指引
Linux Mint Debian Edition (LMDE) 5 / Elsie使用下方 Debian 11 指引
Linux Mint Debian Edition (LMDE) 6 / Faye使用下方 Debian 12 指引
Linux Mint Debian Edition (LMDE) 7 / Gigi使用下方 Debian 13 指引
Debian 9 / stretch该平台已End-of-Life(EOL),不再支持,必须至少升级到 Debian 13
Debian 10 / buster该平台已End-of-Life(EOL),不再支持,必须至少升级到 Debian 13
Debian 11 / bullseye使用下方 Debian 11 指引
Debian 12 / bookworm使用下方 Debian 12 指引
Debian 13 / trixie使用下方 Debian 13 指引
Debian Sid参考 Debian 官方软件包页面获取帮助
Raspbian GNU/Linux 10必须从源码构建,或将操作系统升级到 Raspbian GNU/Linux 12
Raspbian GNU/Linux 11使用下方 Debian 11 指引
Raspbian GNU/Linux 12使用下方 Debian 12 指引
Ubuntu 16.04 / Xenial该平台已End-of-Life(EOL),不再支持,必须至少升级到 Ubuntu 26.04
Ubuntu 18.04 / Bionic该平台已End-of-Life(EOL),不再支持,必须至少升级到 Ubuntu 26.04
Ubuntu 20.04 / Focal该平台已End-of-Life(EOL),不再支持,必须至少升级到 Ubuntu 26.04
Ubuntu 21.04 / Hirsute该平台已End-of-Life(EOL),不再支持,必须至少升级到 Ubuntu 26.04
Ubuntu 21.10 / Impish该平台已End-of-Life(EOL),不再支持,必须至少升级到 Ubuntu 26.04
Ubuntu 22.04 / Jammy使用下方 Ubuntu 22.04 指引
Ubuntu 22.10 / Kinetic该平台已End-of-Life(EOL),不再支持,必须至少升级到 Ubuntu 26.04
Ubuntu 23.04 / Lunar该平台已End-of-Life(EOL),不再支持,必须至少升级到 Ubuntu 26.04
Ubuntu 23.10 / Mantic该平台已End-of-Life(EOL),不再支持,必须至少升级到 Ubuntu 26.04
Ubuntu 24.04 / Noble使用下方 Ubuntu 24.04 指引
Ubuntu 24.10 / Oracular该平台已End-of-Life(EOL),不再支持,必须至少升级到 Ubuntu 26.04
Ubuntu 25.04 / Plucky该平台已End-of-Life(EOL),不再支持,必须至少升级到 Ubuntu 26.04
Ubuntu 25.10 / Questing使用下方 Ubuntu 25.10 指引
Ubuntu 26.04 / Resolute使用下方 Ubuntu 26.04 指引

[!IMPORTANT] 如果你的 Linux 发行版或版本未出现在上表,有两个选择:

  1. 从源码编译客户端,参见 Installing or Upgrading the OneDrive Client for Linux。
  2. 向你的发行版维护者申请打包支持,以便获得官方、受支持的软件包。

各发行版的 OBS 软件包安装步骤

以下各发行版步骤的核心逻辑完全一致:添加 OBS 仓库签名密钥 → 写入 apt 源 → 更新缓存 → 安装。唯一区别在于仓库 URL 中对应的发行版代码(Debian_11Debian_12Debian_13xUbuntu_22.04xUbuntu_24.04xUbuntu_25.10xUbuntu_26.04)。

安装命令统一使用--no-install-recommends --no-install-suggests参数,避免把发行版包中那份错误的 systemd 服务等推荐/建议依赖一并装入系统——这是与直接apt install onedrive的关键差异。

Distribution: Debian 11

包支持以下平台架构:

i686x86_64ARMHFAARCH64

Step 1:添加 OpenSuSE Build Service 仓库发布密钥

wget -qO - https://download.opensuse.org/repositories/home:/npreining:/debian-ubuntu-onedrive/Debian_11/Release.key | gpg --dearmor | sudo tee /usr/share/keyrings/obs-onedrive.gpg > /dev/null

Step 2:添加 OpenSuSE Build Service 仓库

echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/obs-onedrive.gpg] https://download.opensuse.org/repositories/home:/npreining:/debian-ubuntu-onedrive/Debian_11/ ./" | sudo tee /etc/apt/sources.list.d/onedrive.list

Step 3:更新 apt 软件包缓存

运行:sudo apt-get update

Step 4:安装 onedrive

运行:sudo apt install --no-install-recommends --no-install-suggests onedrive

Step 5:阅读这些软件包的"已知问题"

阅读并理解下方 使用上述软件包安装的已知问题,并按需采取行动。

Distribution: Debian 12

包支持以下平台架构:

i686x86_64ARMHFAARCH64

Step 1:添加 OpenSuSE Build Service 仓库发布密钥

wget -qO - https://download.opensuse.org/repositories/home:/npreining:/debian-ubuntu-onedrive/Debian_12/Release.key | gpg --dearmor | sudo tee /usr/share/keyrings/obs-onedrive.gpg > /dev/null

Step 2:添加 OpenSuSE Build Service 仓库

echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/obs-onedrive.gpg] https://download.opensuse.org/repositories/home:/npreining:/debian-ubuntu-onedrive/Debian_12/ ./" | sudo tee /etc/apt/sources.list.d/onedrive.list

Step 3:更新 apt 软件包缓存

运行:sudo apt-get update

Step 4:安装 onedrive

运行:sudo apt install --no-install-recommends --no-install-suggests onedrive

Step 5:阅读这些软件包的"已知问题"

阅读并理解下方 使用上述软件包安装的已知问题,并按需采取行动。

Distribution: Debian 13

包支持以下平台架构:

i686x86_64ARMHFAARCH64

Step 1:添加 OpenSuSE Build Service 仓库发布密钥

wget -qO - https://download.opensuse.org/repositories/home:/npreining:/debian-ubuntu-onedrive/Debian_13/Release.key | gpg --dearmor | sudo tee /usr/share/keyrings/obs-onedrive.gpg > /dev/null

Step 2:添加 OpenSuSE Build Service 仓库

echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/obs-onedrive.gpg] https://download.opensuse.org/repositories/home:/npreining:/debian-ubuntu-onedrive/Debian_13/ ./" | sudo tee /etc/apt/sources.list.d/onedrive.list

Step 3:更新 apt 软件包缓存

运行:sudo apt-get update

Step 4:安装 onedrive

运行:sudo apt install --no-install-recommends --no-install-suggests onedrive

Step 5:阅读这些软件包的"已知问题"

阅读并理解下方 使用上述软件包安装的已知问题,并按需采取行动。

Distribution: Ubuntu 22.04

包支持以下平台架构(注意i686 不被支持):

i686x86_64ARMHFAARCH64

Step 1:添加 OpenSuSE Build Service 仓库发布密钥

wget -qO - https://download.opensuse.org/repositories/home:/npreining:/debian-ubuntu-onedrive/xUbuntu_22.04/Release.key | gpg --dearmor | sudo tee /usr/share/keyrings/obs-onedrive.gpg > /dev/null

Step 2:添加 OpenSuSE Build Service 仓库

echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/obs-onedrive.gpg] https://download.opensuse.org/repositories/home:/npreining:/debian-ubuntu-onedrive/xUbuntu_22.04/ ./" | sudo tee /etc/apt/sources.list.d/onedrive.list

Step 3:更新 apt 软件包缓存

运行:sudo apt-get update

Step 4:安装 onedrive

运行:sudo apt install --no-install-recommends --no-install-suggests onedrive

Step 5:阅读这些软件包的"已知问题"

阅读并理解下方 使用上述软件包安装的已知问题,并按需采取行动。

Distribution: Ubuntu 24.04

包支持以下平台架构(注意i686 不被支持):

i686x86_64ARMHFAARCH64

Step 1:添加 OpenSuSE Build Service 仓库发布密钥

wget -qO - https://download.opensuse.org/repositories/home:/npreining:/debian-ubuntu-onedrive/xUbuntu_24.04/Release.key | gpg --dearmor | sudo tee /usr/share/keyrings/obs-onedrive.gpg > /dev/null

Step 2:添加 OpenSuSE Build Service 仓库

echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/obs-onedrive.gpg] https://download.opensuse.org/repositories/home:/npreining:/debian-ubuntu-onedrive/xUbuntu_24.04/ ./" | sudo tee /etc/apt/sources.list.d/onedrive.list

Step 3:更新 apt 软件包缓存

运行:sudo apt-get update

Step 4:安装 onedrive

运行:sudo apt install --no-install-recommends --no-install-suggests onedrive

Step 5:阅读这些软件包的"已知问题"

阅读并理解下方 使用上述软件包安装的已知问题,并按需采取行动。

Distribution: Ubuntu 25.10

包支持以下平台架构(注意i686 不被支持):

i686x86_64ARMHFAARCH64

Step 1:添加 OpenSuSE Build Service 仓库发布密钥

wget -qO - https://download.opensuse.org/repositories/home:/npreining:/debian-ubuntu-onedrive/xUbuntu_25.10/Release.key | gpg --dearmor | sudo tee /usr/share/keyrings/obs-onedrive.gpg > /dev/null

Step 2:添加 OpenSuSE Build Service 仓库

echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/obs-onedrive.gpg] https://download.opensuse.org/repositories/home:/npreining:/debian-ubuntu-onedrive/xUbuntu_25.10/ ./" | sudo tee /etc/apt/sources.list.d/onedrive.list

Step 3:更新 apt 软件包缓存

运行:sudo apt-get update

Step 4:安装 onedrive

运行:sudo apt install --no-install-recommends --no-install-suggests onedrive

Step 5:阅读这些软件包的"已知问题"

阅读并理解下方 使用上述软件包安装的已知问题,并按需采取行动。

Distribution: Ubuntu 26.04

包支持以下平台架构(注意i686 不被支持):

i686x86_64ARMHFAARCH64

Step 1:添加 OpenSuSE Build Service 仓库发布密钥

wget -qO - https://download.opensuse.org/repositories/home:/npreining:/debian-ubuntu-onedrive/xUbuntu_26.04/Release.key | gpg --dearmor | sudo tee /usr/share/keyrings/obs-onedrive.gpg > /dev/null

Step 2:添加 OpenSuSE Build Service 仓库

echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/obs-onedrive.gpg] https://download.opensuse.org/repositories/home:/npreining:/debian-ubuntu-onedrive/xUbuntu_26.04/ ./" | sudo tee /etc/apt/sources.list.d/onedrive.list

Step 3:更新 apt 软件包缓存

运行:sudo apt-get update

Step 4:安装 onedrive

运行:sudo apt install --no-install-recommends --no-install-suggests onedrive

Step 5:阅读这些软件包的"已知问题"

阅读并理解下方 使用上述软件包安装的已知问题,并按需采取行动。

安装后的初始化、认证与 systemd 使用

OBS 包安装完成后,客户端还需要完成首次认证与配置。这里结合仓库源码给出关键行为说明,帮助你避开常见坑。

首次运行与认证

直接不带任何参数运行onedrive,客户端即进入交互式 OAuth2 认证流程(详细流程见 docs/usage.md)。在图形桌面会话中会自动打开 Microsoft 授权页面并在本地127.0.0.1监听授权响应;在无图形会话(SSH、容器、WSL)时则回退到手动复制/粘贴授权 URI 的方式。若需要重新认证,使用:

onedrive --reauth

配置目录与数据库锁

客户端的配置目录默认是~/.config/onedrive,可通过--confdir覆盖(见 src/config.d 中对configDirName的定义与 src/config.d 中对--confdir的解析逻辑)。同步状态存储在~/.config/onedrive/items.sqlite3中。

[!IMPORTANT] 这正是前面 Step 1c 所述"already running"错误的根源:SQLite 数据库文件被锁定意味着已有一个 onedrive 实例在运行(源码见 src/itemdb.d)。务必确保系统里只有一个 onedrive 实例——要么手动在前台运行,要么交由官方 systemd 服务管理,二者不可并存。

官方 systemd 服务的正确形态

本项目在 contrib/systemd/onedrive.service.in 与 contrib/systemd/onedrive@.service.in 提供了标准的用户级与模板级 systemd 单元文件,二者的ExecStart均以onedrive --monitor方式运行客户端(onedrive@.service还通过--confdir=/home/%i/.config/onedrive支持多用户/多配置目录实例)。项目官方服务文件还包含RestartPreventExitStatus=78——当客户端因需要--resync而以 EX_CONFIG(78) 退出时不会被 systemd 无限重启。OBS 安装的客户端如需以服务方式后台运行,应遵循项目官方单元文件的语义,而不是依赖发行版包自动创建的那个用户级服务。

使用上述软件包安装的已知问题

目前,从OpenSuSE Build Service 仓库安装 onedrive 没有已知问题。

延伸阅读

  • 从源码构建、升级与卸载客户端的完整说明,参见 docs/install.md。
  • 客户端使用与认证细节,参见 docs/usage.md。
  • 官方 systemd 单元文件模板,参见 contrib/systemd/onedrive.service.in 与 contrib/systemd/onedrive@.service.in。
  • 数据库锁/实例冲突错误的源码实现,参见 src/itemdb.d。

【免费下载链接】onedriveOneDrive Client for Linux项目地址: https://gitcode.com/gh_mirrors/onedri/onedrive

创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考

需要专业的网站建设服务?

联系我们获取免费的网站建设咨询和方案报价,让我们帮助您实现业务目标

立即咨询