If your apt-get servers are not working correctly for debian 3.1, edit /etc/apt/sources.list and set
# Main deb http://http.us.debian.org/debian/ stable main non-free contrib # Source deb-src http://http.us.debian.org/debian/ stable main non-free contrib # Security deb http://security.debian.org/ stable/updates main contrib non-free
Then type:
apt-get update
Once fixed you can run your usual apt-get commands. eg:
apt-get install gcc g++ make flex bison openssl libssl-dev perl perl-base perl-modules
For debian 4.0, another sources.list file may look like:
deb http://ftp.tr.debian.org/debian/ etch main deb-src http://ftp.tr.debian.org/debian/ etch main deb http://security.debian.org/ etch/updates main contrib deb-src http://security.debian.org/ etch/updates main contrib