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 like to have always with me a USB version of Ubuntu. It's often useful. So I can have in any case all my documents and settings everywhere even on PCs where only windows is installed, or I can try to recover/backup PCs that have some problems. The problem is that it's impossible to upgrade or install new software on it. It takes a lot of space (you can't do all the updates, you can only do few of them, only few times!!!). Why isn't it possible? How can I free the occuped space after each update? I tryed to set synaptc so to delete file after installation, on its settings menu, but it seems that it doesn't work. In any case, after every update, you have always less and less free space. Many thanks, Giuseppe Privitera

share|improve this question

2 Answers 2

If your problem is to have all your documents everywhere you can use Ubuntu One.
If you uploaded your files into web so you can access them whenever and wherever you want if you have access to the internet using web browser to download or upload files.

share|improve this answer
    
The question is a bit unclear, but guiprivite is saying that Ubuntu works well because he already can sync documents. The problem described in the question is that each time Ubuntu is updated, progressively more disk space is used. –  Eliah Kagan May 14 '12 at 14:50

It sounds from your question that you have installed Ubuntu on a USB flash drive using Ubiquity (the installer utility that runs from a CD or another flash drive), rather than writing an .iso image to the USB flash drive. Given that you make frequent changes to the installed system including installing and upgrading software, this is a good approach. But I want to make clear that this answer applies only when that approach is taken (or to regular installations of Ubuntu on hard drives with limited free space).

There are two things you can do to free up space that becomes occupied after updates.

  1. Remove old kernels you don't need anymore. It's advisable to keep at least the currently running kernel, and one other kernel that is also known to work, in case you have problems later. (It is absolutely necessary to keep at least one kernel, as otherwise your Ubuntu system cannot boot.)

    To find out what kernel version is currently running, open a Terminal window (Ctrl+Alt+T), enter this command, and press Enter to run it:

    uname -r
    

    There are two kinds of packages you can remove--linux-image-* packages, which provide the kernels themselves, and linux-headers-* packages, which provide information for building drivers for the running kernel. (Don't worry if you don't have any linux-headers-* packages, or if you don't know what that means.) To list your linux-image-* and linux-headers-* packages, run this command:

    dpkg -l | grep -E 'linux-(image|headers)-[[:digit:]]'

    Now you can completely remove all the linux-image-* and linux-headers-* packages besides the ones corresponding to the currently running kernel and one other one (so you have a backup kernel in case the current one stops working):

    sudo apt-get purge ...

    In that command, make sure to replace ... with a list of the packages you want to remove, separated by spaces.

    For example, on my system, following the above procedure looks like:

    ek@Apok:~$ uname -r
    3.0.0-20-generic
    ek@Apok:~$ dpkg -l | grep -E 'linux-(image|headers)-[[:digit:]]'
    ii  linux-headers-3.0.0-16                                      3.0.0-16.29                                Header files related to Linux kernel version 3.0.0
    ii  linux-headers-3.0.0-16-generic                              3.0.0-16.29                                Linux kernel headers for version 3.0.0 on x86/x86_64
    ii  linux-headers-3.0.0-19                                      3.0.0-19.33                                Header files related to Linux kernel version 3.0.0
    ii  linux-headers-3.0.0-19-generic                              3.0.0-19.33                                Linux kernel headers for version 3.0.0 on x86/x86_64
    ii  linux-headers-3.0.0-20                                      3.0.0-20.34                                Header files related to Linux kernel version 3.0.0
    ii  linux-headers-3.0.0-20-generic                              3.0.0-20.34                                Linux kernel headers for version 3.0.0 on x86/x86_64
    ii  linux-image-3.0.0-16-generic                                3.0.0-16.29                                Linux kernel image for version 3.0.0 on x86/x86_64
    ii  linux-image-3.0.0-19-generic                                3.0.0-19.33                                Linux kernel image for version 3.0.0 on x86/x86_64
    ii  linux-image-3.0.0-20-generic                                3.0.0-20.34                                Linux kernel image for version 3.0.0 on x86/x86_64
    ek@Apok:~$ sudo apt-get purge linux-headers-3.0.0-16 linux-headers-3.0.0-16-generic linux-image-3.0.0-16-generic

  2. Run sudo apt-get --purge autoremove followed by sudo apt-get autoclean to completely remove packages that have become unnecessary, and to remove cached package installers that are unlikely to be used again. To free up even more space, you can run sudo apt-get clean, which removes all cached package installers. If you do this, then if you ever reinstall a package you currently have, even if you currently have the current version, the package manager will have to download the package again. (But this is usually not a problem.)

share|improve this answer

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.