Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I had yesterday problem to install a package called ckan, and then I had some buggs. In fact, it was solved because odf the following : The doc http://docs.ckan.org/en/ckan-1.7.1/install-from-package.html indicated to run the command : echo "deb http://apt.ckan.org/ckan-1.MAJOR_VERSION lucid universe" | sudo tee /etc/apt/sources.list.d/ckan.list

But the doc doesn't precise that it is dedicated to Ubuntu 10.4,. So for Ubuntu 12.4, the right doc is http://docs.ckan.org/en/ckan-1.7.1/install-from-source.html

So now, I have another issue : when I run the command to install the package solr-jetty, I am told 'You don't have enough free spacve in /var/cache/apt/archives/'

Here's the result of the df -H command :enter image description here

Knowing I have installed Ubuntu with VirtualBox on my Mac, how can I fix that problem ?

Best

share|improve this question

4 Answers 4

sudo apt-get autoclean

This will delete all packages not currently installed. If that doesn't free up enough space, then use sudo apt-get clean. This clears out all .debs downloaded and/or installed.

But it looks like your harddisc is out of space. Seriously out of space. 61Mb is not enough for a good working systen. I found 2 alternatives that can circumvent space related problems though both might be hard to pull of when using a virtual machine. A more permanent sollution would be to increase the size of your virtual machine (and I would also advice to use the method that allows the machine to dynamically to increase in size; VirtualBox has such a setting).


Alternative if you have a partition or external storage.

With this method you re-route the location where .debs are stored:

sudo mv -i /var/cache/apt /media/{dir_of_mounted_disc}
sudo ln -s /media/{dir_of_mounted_disc}/apt /var/cache/apt

Run the upgrade and install. After you are done you can switch back to normal with:

sudo apt-get clean
sudo unlink /var/cache/apt
sudo mv /media/{dir_of_mounted_disc}/apt /var/cache

Ofcourse {dir_of_mounted_disc} needs to be change to the name of your mounted disc.

Another alternative

This way you create a RAM disc:

sudo mkdir /media/{directory}
sudo mount -t tmpfs tmpfs /media/{directory}
sudo ln -s /media/{directory}/apt /var/cache/apt

Clean up as with the 1st alternative.

Warning this requires a large amount of RAM so may not be useable when using a virtual system.

share|improve this answer
    
I tried the two commands and I have the same 'not enough space' message –  Newben Aug 22 '12 at 9:35
    
So I edited my question put the visual result of the command (soory I put some image because I don't know how to copy paste the content of the shell...) –  Newben Aug 22 '12 at 9:41
    
By the way, I tried with what I got by doing ls in the media directory, I found 'cdrom'. So I ran the sudo mw command and I got an error message : could not create directory /media/cdrom/apt : 'read only filme system'... –  Newben Aug 22 '12 at 9:53
    
Do you mean the last command you suggested are useless if I don't have a USB stick or an external HDD ? –  Newben Aug 22 '12 at 10:05
    
OK thanks a lot !! –  Newben Aug 22 '12 at 10:16

Whenever you install a program, the packages (.deb files) get stored in /var/cache/apt/archives, which obviously take up space (a lot of space if there are many packages installed).

To get rid of them, use:

sudo apt-get install clean

Incase you're wondering what is the difference between clean and autoclean, here is what the man page says:

clean: clean clears out the local repository of retrieved package files. It removes everything but the lock file from /var/cache/apt/archives/ and /var/cache/apt/archives/partial/. APT is used as a dselect(1) method, clean is run Those who do not use dselect will likely want to run apt-get clean time to time to free up disk space.

autoclean: Like clean, autoclean clears out the local repository of package files. The difference is that it only removes package files can no longer be downloaded, and are largely useless. This a cache to be maintained over a long period without it out of control. The configuration option Clean-Installed will prevent installed packages from erased if it is set to off.

share|improve this answer

These commands will remove extra packages that are no longer required .

Open terminal (Ctrl-Alt-T) and type

sudo apt-get autoclean
sudo apt-get autoremove 
share|improve this answer

The issue re: 'You don't have enough free spacve in /var/cache/apt/archives/' may be related to this bug: https://bugs.launchpad.net/ubuntu/+source/update-manager/+bug/1054903 Particularly if /var/cache/apt is on a tmpfs which gets erased every boot. Is it possible that you've sym-linked /var/cache/ to /tmp/cache/ or something similar in order to save space?

If this is the case the instructions to solve/work-arround it are on the bug report above.

share|improve this answer
    
Can you add a summary of the suggested workaround, quote parts that need quoting, and add relevant steps to take from the link. –  Mateo_ Oct 5 '12 at 1:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.