I have included this for anyone else with the same problem.
the problem was cxaused by the hard disk being full. the problem was solved by running:
or in some cases this may work better:
and now the computer is working fine
i found out that the hard disk was full wen i tried to copy a file to the /root directory and it said not enough disk space. i then double checked with:
which displays how much disk space there is on all your hard disks and partitions