How to switch Debian to use http mirrors as primary?

Red Squirrel

No Lifer
May 24, 2003
70,619
13,818
126
www.anyf.ca
When installing usually I don't have the network configured till after, so choosing the option to use the http mirrors fails because there's no network. The issue is that once I am in the OS and try to use apt-get it wants the CD. How do I configure it to use the http mirrors instead?

Also it does not come with vim, only vi, which is unusable in debian based OSes. That version just acts really funny and you can't really type or do anything, it just screws everything up.

So hopefully it's an easy fix as I'll have to use echo and output redirection. I can't seem to find much on google about how to change it after the install. Hopefully I don't have to reinstall.
 

ch33zw1z

Lifer
Nov 4, 2004
39,768
20,341
146
http://forums.debian.net/viewtopic.php?t=65304

Or go to System>Administration>Synaptic Package Manager>Settings>Repositories>Third-Party Software and untick the CD sources.

I guess try that first.

Otherwise, plug in the dang ethernet during install dude! :)

when you get it squared away, finish with "sudo apt-get update"

edit: for your text editing needs, I believe nano is built in. I run debian 7.4 lxde on a couple old laptops, I use nano.
 
Last edited:

Red Squirrel

No Lifer
May 24, 2003
70,619
13,818
126
www.anyf.ca
No GUI, using SSH. The network was plugged in, but it still errored out, probably because it was not yet configured at that stage (DNS, IP address etc). Seems silly to me that networking would be required before it's even done installing or before I even got a chance to configure it.

I managed to figure it out though, had to comment out the cdrom line in /etc/apt/sources.list

I don't really know what I did in vi, because it's messed up (arrow keys just puke random characters or delete stuff etc) but somehow I did manage to type # without screwing up the rest of the file. I don't get the point of that version of vi. It's same thing in Ubuntu. It's completely useless, it just pukes up random characters, sometimes even deletes stuff etc. Can't type reliably or move around much. First thing I did was install vim, and now I can actually properly edit stuff. :p
 

Red Squirrel

No Lifer
May 24, 2003
70,619
13,818
126
www.anyf.ca
I have another debian system that has a similar issue.

Except after making that change, whenever I try to install anything it just says it has no install candidate. wtf? Even vim, rsync, and very basic tools like that. Why is it doing this?

Oddly, it's not doing it to all packages. Apache2 installed fine.


ryan@falcon:~$ ssh root@10.6.6.104
root@10.6.6.104's password:
Linux lunux 2.6.32-5-amd64 #1 SMP Tue May 13 16:34:35 UTC 2014 x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
root@lunux:~#
root@lunux:~#
root@lunux:~#
root@lunux:~# apt-get install vim
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package vim is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'vim' has no installation candidate
root@lunux:~#
root@lunux:~#
root@lunux:~#
root@lunux:~#
root@lunux:~# apt-get update
Hit http://security.debian.org squeeze/updates Release.gpg
Ign http://security.debian.org/ squeeze/updates/contrib Translation-en
Ign http://security.debian.org/ squeeze/updates/contrib Translation-en_CA
Ign http://security.debian.org/ squeeze/updates/main Translation-en
Ign http://security.debian.org/ squeeze/updates/main Translation-en_CA
Hit http://security.debian.org squeeze/updates Release
Hit http://security.debian.org squeeze/updates/main Sources
Hit http://security.debian.org squeeze/updates/contrib Sources
Hit http://security.debian.org squeeze/updates/main amd64 Packages
Hit http://security.debian.org squeeze/updates/contrib amd64 Packages
Reading package lists... Done
root@lunux:~#
root@lunux:~#
root@lunux:~# apt-get install vim
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package vim is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'vim' has no installation candidate
root@lunux:~# apt-get install rsync
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package rsync is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'rsync' has no installation candidate
root@lunux:~# apt-get install apache2
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
apache2-mpm-worker apache2-utils apache2.2-common
Suggested packages:
apache2-doc apache2-suexec apache2-suexec-custom
The following NEW packages will be installed:
apache2 apache2-mpm-worker apache2-utils apache2.2-common
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 471 kB of archives.
After this operation, 2,421 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://security.debian.org/ squeeze/updates/main apache2-utils amd64 2.2.16-6+squeeze11 [165 kB]
Get:2 http://security.debian.org/ squeeze/updates/main apache2.2-common amd64 2.2.16-6+squeeze11 [302 kB]
Get:3 http://security.debian.org/ squeeze/updates/main apache2-mpm-worker amd64 2.2.16-6+squeeze11 [2,224 B]
Get:4 http://security.debian.org/ squeeze/updates/main apache2 amd64 2.2.16-6+squeeze11 [1,400 B]
Fetched 471 kB in 1s (447 kB/s)
Selecting previously deselected package apache2-utils.
(Reading database ... 128004 files and directories currently installed.)
Unpacking apache2-utils (from .../apache2-utils_2.2.16-6+squeeze11_amd64.deb) ...
Selecting previously deselected package apache2.2-common.
Unpacking apache2.2-common (from .../apache2.2-common_2.2.16-6+squeeze11_amd64.deb) ...
Selecting previously deselected package apache2-mpm-worker.
Unpacking apache2-mpm-worker (from .../apache2-mpm-worker_2.2.16-6+squeeze11_amd64.deb) ...
Selecting previously deselected package apache2.
Unpacking apache2 (from .../apache2_2.2.16-6+squeeze11_amd64.deb) ...
Processing triggers for man-db ...
Setting up apache2-utils (2.2.16-6+squeeze11) ...
Setting up apache2.2-common (2.2.16-6+squeeze11) ...
Enabling site default.
Enabling module alias.
Enabling module autoindex.
Enabling module dir.
Enabling module env.
Enabling module mime.
Enabling module negotiation.
Enabling module setenvif.
Enabling module status.
Enabling module auth_basic.
Enabling module deflate.
Enabling module authz_default.
Enabling module authz_user.
Enabling module authz_groupfile.
Enabling module authn_file.
Enabling module authz_host.
Enabling module reqtimeout.
Setting up apache2-mpm-worker (2.2.16-6+squeeze11) ...
Starting web server: apache2.
Setting up apache2 (2.2.16-6+squeeze11) ...
root@lunux:~#


I've always been a Red Hat guy, so I'm just trying to learn a new architecture. From what I've seen Debian seems to be more cutting edge. All too often in RH based OSes (CentOS is what I normally use) I find myself needing a certain version of a package but they don't have it updated that far. Debian seems to be more on par with updating packages.

Though it's almost tempting to go with a distro where I just install all by source and not be restricted by what packages are available, but dealing with dependencies is pure hell with that setup method.
 

Red Squirrel

No Lifer
May 24, 2003
70,619
13,818
126
www.anyf.ca
I managed to find some more lines I can add to that file, but this is really screwy. It's asking all these questions I've never been asked before like if it's ok to restart services and stuff.

Installing vim required like 400MB of packages. Now it's stuck at Removing rhythmbox-plugins. WTF, why does it need to do so much stuff to install packages that would normally take several seconds? Had to hard reset the VM.

Maybe I'm going to stick to CentOS after all... Debian's way of handling packages seems really weird.

edit: ...and that totally trashed the installation. Glad this was just a test vm to mess around with.
 

lxskllr

No Lifer
Nov 30, 2004
60,127
10,596
126
Debian sometimes has unusual dependencies, where a package is (imo)unnecessarily tied to other packages, and if you try to add/remove a package, it'll bring in/delete a bunch of other packages. Other than that, it's a pretty smooth system, and works well. I think Squeeze is out of support at this time. If not, it will be very soon. Maybe that's part of your problem.
 

Red Squirrel

No Lifer
May 24, 2003
70,619
13,818
126
www.anyf.ca
Hmm maybe that's the issue, they may have pulled off the repos if its end of life. The latest failed flat out to install in VM so I moved one version down. I'll be getting my new processor soon (last part till I can build my new VM server) and that will allow me to upgrade my whole environment including a newer VM solution. So hopefully I'll have better luck installing Linux. I find a lot of the newer distros I try to install in my current solution fail to install.
 

TheRyuu

Diamond Member
Dec 3, 2005
5,479
14
81
Check your /etc/apt/sources.list

For example it should look like this if you're using the "testing" branch:
Code:
deb http://mirrors.kernel.org/debian/ testing main contrib non-free
deb-src http://mirrors.kernel.org/debian/ testing main contrib non-free

deb http://security.debian.org/ testing/updates main contrib non-free
deb-src http://security.debian.org/ testing/updates main contrib non-free

The contrib and non-free repos are of course optional. Possible options (other than by the actual name like squeeze) are stable, testing and unstable. I generally run with "testing" when I use Debian (save for a production server). One of the reasons I like Debian so much is the package management. I don't think I've once had a problem with it. I'm not a huge fan of the rpm based distros.