apt-get 没有显示任何错误,但没有安装或删除软件包

apt-get 没有显示任何错误,但没有安装或删除软件包

每当我尝试安装软件包时都会出现此问题

$ sudo apt-get install metacity
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Suggested packages:
  gnome-control-center
The following NEW packages will be installed:
  metacity
0 upgraded, 1 newly installed, 0 to remove and 157 not upgraded.
1 not fully installed or removed.
Need to get 0 B/243 kB of archives.
After this operation, 744 kB of additional disk space will be used.
$ 

我尝试了基本的修复方法,但没有效果。

sudo apt-get clean && sudo apt-get autoremove
sudo apt-get -f install
sudo dpkg --configure -a

这是我执行 apt download 时得到的结果

$ sudo apt download metacity
Get:1 http://in.archive.ubuntu.com/ubuntu xenial/main amd64 metacity amd64 1:3.18.3-1ubuntu3 [243 kB]
Fetched 243 kB in 2s (90.4 kB/s)
W: Can't drop privileges for downloading as file '/home/jaison/metacity_1%3a3.18.3-1ubuntu3_amd64.deb' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)

答案1

尝试:

sudo apt-get clean
sudo apt-get clean all
sudo apt-get update
sudo apt-get upgrade

然后尝试安装所需的软件包。如果仍然失败,请发布新的错误。

编辑:

另外,如果你想下载 .deb,不要使用 sudo。只需运行:

apt-get download metacity

这将解决权限问题。当您尝试使用 sudo 下载时,实际下载文件的帐户是“_apt”,而 _apt 没有权限写入您的主目录。

相关内容