LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices

Reply
 
Search this Thread
Old 09-07-2009, 10:10 PM   #1
abc.linux
LQ Newbie
 
Registered: Nov 2008
Posts: 2

Rep: Reputation: 0
How to prevent apt from deleting packages in /var/cache/apt/archives ?


In the name of God
Hi
A)Is there a configuration item that prevents apt from
deleting files in /var/cache/apt/archives ?
B)When apt removes some packages in /var/cache/apt/archives ?

Thanks in advance.
 
Old 09-08-2009, 02:50 AM   #2
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Wheezy (Fluxbox WM)
Posts: 1,363
Blog Entries: 52

Rep: Reputation: 353Reputation: 353Reputation: 353Reputation: 353
The apt system would not usually remove packages from the cached archive unless you pass the 'clean' parameter to apt-get or aptitude. It is not uncommon to have multiple versions of the packages in the cache as you go through upgrades.

There are some options that can be put into the /etc/apt/apt.conf file to control when and how files are cleaned from the archive (see 'man apt.conf').
 
Old 09-08-2009, 11:02 AM   #3
frenchn00b
Senior Member
 
Registered: Jun 2007
Location: E.U., Mountains :-)
Distribution: Debian, Etch, the greatest
Posts: 2,546

Rep: Reputation: 51
Quote:
Originally Posted by abc.linux View Post
In the name of God
Hi
A)Is there a configuration item that prevents apt from
deleting files in /var/cache/apt/archives ?
B)When apt removes some packages in /var/cache/apt/archives ?

Thanks in advance.
if you do :
Quote:
apt-get clean
you remove them.

If you does not that, they remain.

In case it does by itself ,there is something ... ?
 
Old 09-09-2009, 01:25 PM   #4
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,541
Blog Entries: 28

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
I also would like to accumulate packages in my ubuntu 8.04.3 system's /var/cache/apt/archives to speed any re-installation.

/bin/ls -ltc /var/cache/apt/archives lists files dated from 15jul9 to 7sep9. I have not used apt-get or aptitude with the clean option. Searching the system log I cannot find anything that might have deleted files up to the start date. Old packages seem to be auto-deleted ... ?
 
Old 09-09-2009, 01:41 PM   #5
frenchn00b
Senior Member
 
Registered: Jun 2007
Location: E.U., Mountains :-)
Distribution: Debian, Etch, the greatest
Posts: 2,546

Rep: Reputation: 51
Quote:
Originally Posted by catkin View Post
I also would like to accumulate packages in my ubuntu 8.04.3 system's /var/cache/apt/archives to speed any re-installation.

/bin/ls -ltc /var/cache/apt/archives lists files dated from 15jul9 to 7sep9. I have not used apt-get or aptitude with the clean option. Searching the system log I cannot find anything that might have deleted files up to the start date. Old packages seem to be auto-deleted ... ?
you can create even your own server of deb for apt-get , for updating ur sources.list
its quite useful
 
Old 09-09-2009, 02:15 PM   #6
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,541
Blog Entries: 28

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Quote:
Originally Posted by frenchn00b View Post
you can create even your own server of deb for apt-get , for updating ur sources.list
its quite useful
Thanks frenchn00b

Nice idea if we had more than one .deb machine on this otherwise Windows-only LAN! Being as how it's only for one machine I'd be happy if I could find out how to stop ubuntu cleaning /var/cache/apt/archives and simply back it up to DVD at regular intervals.

Or have I misunderstood something?
 
Old 09-09-2009, 03:25 PM   #7
frenchn00b
Senior Member
 
Registered: Jun 2007
Location: E.U., Mountains :-)
Distribution: Debian, Etch, the greatest
Posts: 2,546

Rep: Reputation: 51
Quote:
Originally Posted by catkin View Post
Thanks frenchn00b

Nice idea if we had more than one .deb machine on this otherwise Windows-only LAN! Being as how it's only for one machine I'd be happy if I could find out how to stop ubuntu cleaning /var/cache/apt/archives and simply back it up to DVD at regular intervals.

Or have I misunderstood something?

Do you know a good ftp provider?
ie. freeshell is really great.
It has unix and website, you can put also your own deb when u compile on that, and you update ur sources.list
 
Old 09-09-2009, 03:40 PM   #8
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,541
Blog Entries: 28

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Quote:
Originally Posted by frenchn00b View Post
Do you know a good ftp provider?
ie. freeshell is really great.
It has unix and website, you can put also your own deb when u compile on that, and you update ur sources.list
But wouldn't it take just as long to pull .debs in from a remote FTP site as to download them from the standard repositories? I'm not thinking about custom .debs (or so few they are not an issue); I'm thinking about speeding up re-installation by avoiding having to download lots of packages over a not-so-fast Internet connection.
 
Old 09-09-2009, 10:15 PM   #9
abc.linux
LQ Newbie
 
Registered: Nov 2008
Posts: 2

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by neonsignal View Post
The apt system would not usually remove packages from the cached archive unless you pass the 'clean' parameter to apt-get or aptitude. It is not uncommon to have multiple versions of the packages in the cache as you go through upgrades.

There are some options that can be put into the /etc/apt/apt.conf file to control when and how files are cleaned from the archive (see 'man apt.conf').
Thanks,
I have no /etc/apt.conf
I think that I need to create the /etc/apt.conf file
containing the following lines:

DSelect
{
Clean "never";
};

I got these lines from /usr/share/doc/apt/examples/apt.conf .
I didn't test the result.
 
Old 09-10-2009, 06:12 AM   #10
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,541
Blog Entries: 28

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Quote:
Originally Posted by abc.linux View Post
Thanks,
I have no /etc/apt.conf
I think that I need to create the /etc/apt.conf file
containing the following lines:

DSelect
{
Clean "never";
};

I got these lines from /usr/share/doc/apt/examples/apt.conf .
I didn't test the result.
Looks interesting but when is DSelect used?

Don't know how similar ubuntu 8.04 is to Debian but I have these files in /etc/apt/apt.conf.d which may be relevant
  • 01autoremove
  • 10periodic
    Contents include APT::Periodic::AutocleanInterval "0";
  • 20archive
    Contents include
    APT::Archives::MaxAge "30";
    APT::Archives::MinAge "2";
    APT::Archives::MaxSize "500";
 
Old 11-07-2009, 09:32 AM   #11
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 231Reputation: 231Reputation: 231
Quote:
Originally Posted by catkin View Post
Looks interesting but when is DSelect used?
IIRC, apt-get is wrapper & the real work is done by either dselect or dpkg or both, I don't remember clearly.

Last edited by archtoad6; 11-08-2009 at 04:48 AM. Reason: Add quote to clarify reason for post
 
Old 11-07-2009, 11:46 AM   #12
frenchn00b
Senior Member
 
Registered: Jun 2007
Location: E.U., Mountains :-)
Distribution: Debian, Etch, the greatest
Posts: 2,546

Rep: Reputation: 51
Quote:
Originally Posted by catkin View Post
But wouldn't it take just as long to pull .debs in from a remote FTP site as to download them from the standard repositories? I'm not thinking about custom .debs (or so few they are not an issue); I'm thinking about speeding up re-installation by avoiding having to download lots of packages over a not-so-fast Internet connection.
I have my /etc/fstab configured for NFS deb server, like debian.


thqt creqtes the server fo rserver qnd one with X:
Code:
echo "Hello Create from the pool the packages, from contrib and contribx"
echo " Type sources.list, to add and update your sources.list"
printf "Enter the distro name >"
read distroname



if   [ "$distroname"  == "sources.list" ]  ; then 
*       echo "deb file:/home/debserver/ $distroname contrib" >> /etc/apt/sources.list
        cat /etc/apt/sources.list
        exit 
        exit 
        exit 0 
fi

ls pool/

cd /home/debserver ; rm  dists/$distroname/contribx/binary-i386/Packages   ;   mkdir -p dists/$distroname/contribx/binary-i386/  ; apt-ftparchive  packages pool/contribx/ > dists/$distroname/contribx/binary-i386/Packages    
# 

and so on
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I remove files at /var/cache/apt/archives ? sarajevo Debian 2 05-08-2007 08:52 AM
cache folder like /var/cache/apt/packages on Debian Shaddy Suse/Novell 0 08-13-2006 10:02 AM
/var/cache/apt/archives/lock error digsby0007 Linux - Software 3 06-23-2006 06:17 AM
remove /var/cache/apt files bhomass Debian 2 02-22-2006 07:52 PM
Where are my .deb packages from /var/cache/apt/archives? bruno buys Debian 3 02-13-2005 07:21 AM


All times are GMT -5. The time now is 11:43 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration