Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
Due to network maintenance being performed by our provider, LQ will be down starting at 05:01 AM UTC. The exact duration of the downtime isn't currently known. We apologize for the inconvenience.
|
 |
11-22-2009, 09:52 AM
|
#1
|
|
LQ Newbie
Registered: Nov 2009
Location: Virginia
Distribution: Ubuntu 8.04
Posts: 10
Rep:
|
Need to clean harddrive but can't
Hello all,
I'm trying to clean my harddrive with the apt-get clean command but to no avail. What am I doing wrong? Do I have to be in a particular directory?
________________________
fernando@fernando-laptop:~$ apt-get clean
E: Could not open lock file /var/cache/apt/archives/lock - open (13 Permission denied)
E: Unable to lock the download directory
fernando@fernando-laptop:~$ sudo apt-get clean
[sudo] password for fernando:
fernando@fernando-laptop:~$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda5 2.3G 2.2G 0 100% /
tmpfs 1003M 0 1003M 0% /lib/init/rw
varrun 1003M 100K 1003M 1% /var/run
varlock 1003M 0 1003M 0% /var/lock
udev 1003M 164K 1003M 1% /dev
tmpfs 1003M 544K 1002M 1% /dev/shm
lrm 1003M 2.4M 1000M 1% /lib/modules/2.6.28-11-generic/volatile
overflow 1.0M 340K 684K 34% /tmp
/dev/sdb1 233G 41G 193G 18% /media/My Passport
___________________________
thanks for you help in advance!
|
|
|
|
11-22-2009, 09:59 AM
|
#2
|
|
LQ 5k Club
Registered: May 2001
Location: Belgium
Distribution: Slackware 14.0
Posts: 8,464
|
You need to look in your / directory to see if there are files you don't need.
only cleans files in /var/cache/apt/archives/
You probably have some old kernels hanging around
|
|
|
|
11-22-2009, 10:00 AM
|
#3
|
|
Member
Registered: Jul 2006
Location: Louisville, KY
Distribution: Fedora 12, Slackware, Debian, Ubuntu Karmic, FreeBSD 7.1
Posts: 439
Rep:
|
apt-get won't work with standard user permissions. Try this: If you are in the sudoers table, you will be prompted for your password, then the command will work. If you aren't in the sudoers table, try
Code:
su -c apt-get clean
and enter the root password.
|
|
|
|
11-22-2009, 10:02 AM
|
#4
|
|
LQ 5k Club
Registered: May 2001
Location: Belgium
Distribution: Slackware 14.0
Posts: 8,464
|
@bartonski
from the original post
Quote:
fernando@fernando-laptop:~$ apt-get clean
E: Could not open lock file /var/cache/apt/archives/lock - open (13 Permission denied)
E: Unable to lock the download directory
fernando@fernando-laptop:~$ sudo apt-get clean
[sudo] password for fernando:
fernando@fernando-laptop:~$
|
|
|
|
|
11-22-2009, 10:11 AM
|
#5
|
|
Member
Registered: Sep 2009
Location: Russia
Distribution: Gentoo, LFS
Posts: 399
Rep:
|
my debian lenny on router takes around 400M on total 1.8G HDD(it's OLD) and most of this space is also taken by utils i don't use but don't remove(who knows when they may become useful?).
look at /usr directory. see if you don't need some programs, uninstall them with apt. or do it manually(not recommended).
--
upd: i also use ncdu for cleaning purposes(it shows a disk usage). it's actual name is "ncurses disk usage". i like that util.
Last edited by Web31337; 11-22-2009 at 10:17 AM.
Reason: ncdu
|
|
|
|
11-22-2009, 10:57 AM
|
#6
|
|
LQ Newbie
Registered: Nov 2009
Location: Virginia
Distribution: Ubuntu 8.04
Posts: 10
Original Poster
Rep:
|
Repo - What files should I look to clean? I don't want to get rid of anything necessary.
Web3 - Same question. Is anything in /usr necessary? Or can I delete it all?
|
|
|
|
11-22-2009, 11:06 AM
|
#7
|
|
LQ 5k Club
Registered: May 2001
Location: Belgium
Distribution: Slackware 14.0
Posts: 8,464
|
You can look in /var/log for the backup logs created by logrotate
You can remove old kernels using synaptic
Don't delete files in /usr, unless you know what you are doing
As suggested by web31377 use ncdu to find large files and directories
|
|
|
|
11-22-2009, 12:38 PM
|
#8
|
|
LQ Newbie
Registered: Nov 2009
Location: Virginia
Distribution: Ubuntu 8.04
Posts: 10
Original Poster
Rep:
|
Quote:
Originally Posted by repo
You can look in /var/log for the backup logs created by logrotate
|
When I try to remove some log files (sudo rm), the systems says that the files do not exist, despite the fact that they are displayed on my screen.
Quote:
Originally Posted by repo
You can remove old kernels using synaptic
|
The system tells me that there is not enough space to create the .synaptic directory and therefore cannot run the program. I've deleted a few files but there still isn't enough space.
Quote:
Originally Posted by repo
As suggested by web31377 use ncdu to find large files and directories
|
I ran the program but I haven't been able to delete anything. Open Office has had internal errors since I got Ubuntu so I deleted it (700+ MBs), and when I ran ncdu again, it was fully restored.
Once again, I really appreciate your help with this matter! It's nice to more help than frustration 
|
|
|
|
11-22-2009, 12:48 PM
|
#9
|
|
LQ 5k Club
Registered: May 2001
Location: Belgium
Distribution: Slackware 14.0
Posts: 8,464
|
Since you have no seperate /home partition, perhaps you can delete some stuff in your home directory,
or move them to /media/My Passport
In firefox you can delete the cache.
Take a look if your trashfolder is empty.
Do you use beagle or another software to search the drive?
They can create big files.
Quote:
|
When I try to remove some log files (sudo rm), the systems says that the files do not exist, despite the fact that they are displayed on my screen.
|
make sure to use the correct name, and if needed the correct path. You can copy/paste in the terminal
|
|
|
|
11-22-2009, 03:51 PM
|
#10
|
|
Member
Registered: Jul 2006
Location: Louisville, KY
Distribution: Fedora 12, Slackware, Debian, Ubuntu Karmic, FreeBSD 7.1
Posts: 439
Rep:
|
Quote:
Originally Posted by repo
@bartonski
from the original post
|
Note to self: read, then post.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 06:47 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|