0

I get this whenever I try to install a package

$ 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.
$ 

I tried the basic fixes, didn't work.

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

This is what I get when I do an 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)
wjandrea
  • 14,236
  • 4
  • 48
  • 98
  • 1
  • I tried all of that, didn't work – Jaison Saji Mar 15 '17 at 15:18
  • Please be clearer; what is the problem exactly? – fkraiem Mar 15 '17 at 16:04
  • 1
    The point of the question is that the operation ends after "After this operation, 744kb of additional disk space will be used". No actual downloading, unpacking and installing is being done. The user is being returned to the prompt. This is not clear from the above text but was clear from the screenshot (which has since been removed). – Jos Mar 15 '17 at 16:17
  • @Jos yeah, that is exactly what is happening. I've added the screenshot back for reference. – Jaison Saji Mar 15 '17 at 17:52
  • What happens if you do sudo apt download metacity? And: is there anything useful in /var/log/apt/history.log? – Jos Mar 15 '17 at 17:55
  • 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) – Jaison Saji Mar 15 '17 at 17:56
  • @JaisonSaji That is the expected outcome. – Jos Mar 15 '17 at 17:57
  • see answer below. you can't download using sudo into /home/jaison. Downloads are done by the _apt user, which does not have rights in /home/jaison. – James Mar 16 '17 at 04:11

1 Answers1

0

Try:

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

Then try installing the package you want. If it still fails, post new error.

edit:

also, if you want to download the the .deb, don't use sudo. Just run:

apt-get download metacity

that will fix the permission issue. When you try to download using sudo, the account that actually downloads the file is "_apt" and _apt does not have permission to write in your home directory.

James
  • 1,083
  • I tried the above steps, apt-get is still not installing the package. – Jaison Saji Mar 16 '17 at 03:25
  • I added an edit to help with the download of the .deb file. But I am wondering if there is some additional intel you can provide. Like, have you modified your apt.conf file? What version of Ubuntu are you running? Is it a vanilla install, or are there other major packages/changes you've made? I am able to install the metacity package on a clean Ubuntu 16.04.2 without any trouble. – James Mar 16 '17 at 04:08
  • I did not modify the apt.conf file. I am running 16.04 and it is a vanilla install. I had issue with apt before where dpkg was locked. I removed /var/lib/dpkg/lock to fix it. – Jaison Saji Mar 17 '17 at 05:09
  • My apt.conf file is empty. – Jaison Saji Mar 17 '17 at 05:19