无法将 *.deb 移动到 /var/cache/apt-cacher/packages/*.deb:权限被拒绝

无法将 *.deb 移动到 /var/cache/apt-cacher/packages/*.deb:权限被拒绝

我关注了以下帖子如何设置 apt-cacher 服务器?,但出现此错误:

got@got-mypc:/var/cache/apt/archives$ sudo /usr/share/apt-cacher/apt-cacher-import.pl        /var/cache/apt/archives/
    Importing from /var/cache/apt/archives/
    Moving package files from /var/cache/apt/archives/ to /var/cache/apt-cacher
    Importing: account-plugin-facebook_0.8-0ubuntu2.2_i386.deb
    Failed to move account-plugin-facebook_0.8-0ubuntu2.2_i386.deb to /var/cache/apt-cacher/packages/account-plugin-facebook_0.8-0ubuntu2.2_i386.deb: Permission denied.
    Try read-only (-r) or symlink (-l) options. at /usr/share/apt-cacher/apt-cacher-import.pl line 364.

为什么会出现 Facebook 错误,因为我至少没有亲自为 Facebook 安装任何插件。我也尝试使用 root 登录,但没有成功。现在如何解决这个问题。

答案1

有 3 个选项。

  1. 使用只读选项:

    sudo /usr/share/apt-cacher/apt-cacher-import.pl -r /var/cache/apt/archives/
    
  2. 使用符号链接选项:

    sudo /usr/share/apt-cacher/apt-cacher-import.pl -l /var/cache/apt/archives/
    
  3. 删除有问题的包并重试:

    sudo rm /var/cache/apt/archives/account-plugin-facebook_0.8-0ubuntu2.2_i386.deb to /var/cache/apt-cacher/packages/account-plugin-facebook_0.8-0ubuntu2.2_i386.deb
    sudo /usr/share/apt-cacher/apt-cacher-import.pl /var/cache/apt/archives/
    

相关内容