l i n u x - u s e r s - g r o u p - o f - d a v i s
Next Meeting:
July 7: Social gathering
Next Installfest:
Latest News:
Jun. 14: June LUGOD meeting cancelled
Page last updated:
2005 Jan 05 09:29

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] Installing subversion from sid into a sarge box
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] Installing subversion from sid into a sarge box

Quoting Jay Strauss (me@heyjay.com):

> After reading the apt manual, I seems like I should be able to add the 
> unstable tree into my sources.list, add an entry into my 
> /etc/apt/apt.conf like:
> APT::Default-Release "testing"; # to keep everything at sarge
> And I'm good to go.

According to "man 5 apt_preferences", this is the _correct_ way to solve
the problem.  (Me, I'm a lamer and thus quit studying the manpage the 
moment I found a NON-standard solution to the problem that works.  More
about that near the end.)

> But, I don't have a /etc/apt/apt.conf [...]
> Am I supposed just create this file myself?


I created an /etc/apt/apt.conf file for a completely _unrelated_ reason,
to accomplish this bit of coolness:

:r! /etc/apt/apt.conf

DPkg {
        // Auto re-mounting of a readonly /usr
        Pre-Install-Pkgs {"/home/rick/aptdpkgro.sh";};
        Pre-Invoke {"mount -o remount,rw /usr";};
        Post-Invoke {"/home/rick/aptdpkgclean.sh; mount -o remount,ro /usr";};

/home/rick/aptdpkgro.sh is:



while read debname; do
	pkg=$(dpkg --info $debname | sed -n 's/^ Package: *//p' | head -1)
	(dpkg -L "$pkg" 2>/dev/null || true) | grep "$pathmatch" |
	  while read file; do
		[ -f "$file" -a ! -L "$file" ] || continue
		dir=`dirname "$file"`;
		base=`basename "$file"`;
		inode=`find "$file" -printf "%i\n"`
		(cd "$dir" && ln "$base" ".${base}.dpkg-ro-used.$inode")
		echo "$dir/.${base}.dpkg-ro-used.$inode"
	  done >>/var/lib/my_ro_hack.todel

/home/rick/aptdpkgclean.sh is:



cat /var/lib/my_ro_hack.todel | while read file; do
	[ -f "$file" ] || continue
	N1=`find "$file" -printf "%i\n"`

	b=`basename $file`; d=`dirname $file`
	XF="${b#.}"; XF="$d/${XF%.dpkg-ro-used.*}"
	N2=`find "$XF" -printf "%i\n"`

	if [ "$N1" != "$N2" ] && ! fuser -s "$file"; then
		rm -f "$file"
		echo "$file"
done >/var/lib/my_ro_hack.todel.new
mv /var/lib/my_ro_hack.todel.new /var/lib/my_ro_hack.todel

Anyhow, my lame, slacker, non-orthodox solution to the problem is to NOT
declare a default release in /etc/apt/apt.conf, but instead put these
three lines into /etc/apt/preferences:

Package: *
Pin: release a=unstable
Pin-Priority: 50

Then, /etc/apt/sources.list gets lines for both testing and unstable,
then I do "aptitude update"[1], et voila.  Works for Me<tm>.

The full, very verbose explanation for why that works is apparently in
the apt_preferences manpage, but, being a lazy git, I've never taken the
time to properly read that. 

[1] See:  "Aptitude" on http://linuxmafia.com/kb/Debian/

vox-tech mailing list

LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
Sunset Systems
Who graciously hosts our website & mailing lists!