LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   How to prevent apt from deleting packages in /var/cache/apt/archives ? (https://www.linuxquestions.org/questions/debian-26/how-to-prevent-apt-from-deleting-packages-in-var-cache-apt-archives-753452/)

abc.linux 09-07-2009 10:10 PM

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.

neonsignal 09-08-2009 02:50 AM

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').

frenchn00b 09-08-2009 11:02 AM

Quote:

Originally Posted by abc.linux (Post 3673756)
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 ... ?

catkin 09-09-2009 01:25 PM

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 ... ?

frenchn00b 09-09-2009 01:41 PM

Quote:

Originally Posted by catkin (Post 3676229)
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

catkin 09-09-2009 02:15 PM

Quote:

Originally Posted by frenchn00b (Post 3676248)
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?

frenchn00b 09-09-2009 03:25 PM

Quote:

Originally Posted by catkin (Post 3676283)
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

catkin 09-09-2009 03:40 PM

Quote:

Originally Posted by frenchn00b (Post 3676343)
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.

abc.linux 09-09-2009 10:15 PM

Quote:

Originally Posted by neonsignal (Post 3673957)
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.

catkin 09-10-2009 06:12 AM

Quote:

Originally Posted by abc.linux (Post 3676739)
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";

archtoad6 11-07-2009 09:32 AM

Quote:

Originally Posted by catkin (Post 3677091)
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.

frenchn00b 11-07-2009 11:46 AM

Quote:

Originally Posted by catkin (Post 3676364)
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



All times are GMT -5. The time now is 04:43 AM.