65 lines
1.2 KiB
Bash
Executable File
65 lines
1.2 KiB
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# This script sets up the /etc/apt/sources.list for APT.
|
|
#
|
|
# Steve
|
|
# --
|
|
# http://www.steve.org.uk/
|
|
|
|
|
|
prefix=$1
|
|
|
|
|
|
|
|
if [[ -d ${prefix}/etc/apt ]]; then
|
|
|
|
cat <<E_O_APT > ${prefix}/etc/apt/sources.list
|
|
#
|
|
# /etc/apt/sources.list
|
|
#
|
|
|
|
|
|
#
|
|
# ${dist}
|
|
#
|
|
deb ${mirror} ${dist} main contrib non-free
|
|
deb-src ${mirror} ${dist} main contrib non-free
|
|
|
|
#
|
|
# Security updates
|
|
#
|
|
deb http://security.debian.org/ stable/updates main contrib non-free
|
|
deb-src http://security.debian.org/ stable/updates main contrib non-free
|
|
|
|
|
|
E_O_APT
|
|
|
|
|
|
|
|
#
|
|
# Now that the sources have been setup make sure the system is up to date.
|
|
#
|
|
chroot ${prefix} /usr/bin/apt-get update
|
|
else
|
|
|
|
#
|
|
# Setup yum if we've got it installed.
|
|
if [[ -e ${prefix}/etc/yum.repos.d/ ]]; then
|
|
|
|
#
|
|
# This works for centos4 - dunno about the rest yet.
|
|
#
|
|
perl -pi.bak -e 's/enabled=0/enabled=1/g' *.repo
|
|
perl -pi.bak -e 's/gpgcheck=1/gpgcheck=0/g' *.repo
|
|
perl -pi.bak -e 's/^\#baseurl/baseurl/g' *.repo
|
|
perl -pi.bak -e 's/^mirrorlist/#mirrorlist/g' *.repo
|
|
|
|
#
|
|
# Update the package lists that Yum knows about.
|
|
#
|
|
if [[ -x ${prefix}/usr/bin/yum ]]; then
|
|
chroot ${prefix}/usr/bin/yum update
|
|
fi
|
|
fi
|
|
fi
|