16

I have Ubuntu 12.04 lts.

I want to know that if there is a command other than:

sudo apt-get autoremove

to remove temp files?

5

3 Answers 3

17

Try the below command to remove temp files,

sudo rm -rf /tmp/*

apt-get autoremove will remove automatically all unused packages.

6
  • did not help. Already tried sudo apt-get autoremove
    – Jatttt
    Mar 12, 2014 at 9:46
  • Remove all the files inside /tmp directory. Mar 12, 2014 at 9:47
  • is that safe to do ?
    – Jatttt
    Mar 12, 2014 at 9:51
  • it's all temporary files.After you restart your pc, it won't exists there.You can check it. Mar 12, 2014 at 9:52
  • the directory is empty but my laptop is still slow
    – Jatttt
    Mar 12, 2014 at 9:54
6

You can use Ubuntu-tweak (see http://ubuntu-tweak.com/downloads/) to clean your Ubuntu installation ;)

If you have an SSD hard drive, you should also run sudo fstrim -v / at least once a week to trim your hard drive.

1
  • I'm running 16.04 and it appears there is /etc/cron.weekly script already installed that uses fstrim to "trim all mounted file systems which support it". Jun 7, 2017 at 7:11
0

Slow ubuntu may not be because of low disk space. Is this a recent problem? (i.e was it signficantly faster before?) If not:

  1. run free -m and post the results.

    $free -m
                 total       used       free     shared    buffers     cached
    
    Mem:          5812       4919        892          0        164        822
    -/+ buffers/cache:       3932       1879 
    Swap:         9050       2076       6973
    

    If the -/+ buffers/cache: xxx yyy line has very little free memory (yyy <150) then you might be short of ram. This line is the one that tells you what the actually used/free memory is. (The first line is a bit misleading because it also counts spare ram that was used to pre-cache files as used).

    1.1 if you are short of ram (and you had at least 1GB in total) open the system monitor form the dash and arrange the processes in by memory usage. see if any process is taking up too much memory and try killing it. A usual culprit is zietgeist.

  2. find out if any processes are hogging the CPU

  3. Do you have a graphics card hat can handle unity? (it needs hardware acceleration for it's perfectly purple pixels) You might need to install the necessary drivers (search for "drivers" in the dash and run the application that is suggested.

    If you dont have a dedicated graphics card you need to have a core-i processor from intel. (e.g. i3 and above. they have a tiny integrated graphics processor).

    3.1 If you dont have a graphics card and/or you can't set up the drivers you will need to make unity a little easier on the CPU. follow the instructions here to drop some unecessary bling (Unity runs slow, how can I improve its performance?)

    3.2 alternatively install a lighter DE like XFCE or LXDE. This will make a world of a difference on older machines.

Finally: if you have oodles of RAM and are just plain impatient with opening files install ureadahead. It finds the files you read the most often and loads them into ram, so they appear to open faster.

4
  • total used free shared buffers cached Mem: 7177 2202 4974 0 110 975 -/+ buffers/cache: 1117 6059 Swap: 7810 0 7810 This Is The Output Of free -m
    – Jatttt
    Mar 12, 2014 at 11:37
  • definitely fot lots of ram. With that kind o a set up I suspect graphics card issues. do you have a discrete graphics card? nvidia /amd/ ati? If so open the driver manager from the dash and see if it suggests the proprietary drivers.
    – staticd
    Mar 12, 2014 at 12:02
  • There is no app called drive manager
    – Jatttt
    Mar 14, 2014 at 12:50
  • type "driver" or "jockey" one or both of them will show you an icon saying "additional drivers" or some such. search for any necessary drivers through it.
    – staticd
    Mar 14, 2014 at 18:25

Not the answer you're looking for? Browse other questions tagged .