When Debian is not online, it is extremely important to use the CD or DVD released on the official website as the update source. Since it may be inconvenient to copy a DVD disk (I only have 4 GB), here is how to use CD to update the source of Debian.
1. view the device name of the U Disk
~ # Fdisk-l
According to the capacity of the listed devices, you can distinguish between the hard disk and the U disk device name, usually:/dev/sdb4.
2. Mount the U Disk
~ # Mount/dev/sdb4/media/usb0
Here, sdb4 is replaced based on the actual device name.
The purpose of attaching a U disk is to access it. If it is not attached, it cannot be accessed. After attaching the U disk, you can view it:
~ # Ls/media/usb0
The command to detach a U disk is:
~ # Umount/dev/sdb4
Similarly, sdb4 must be replaced.
3. Copy the CD to the hard disk.
Download the CD from other networked computers (Debian 7.3.0 has 8 CDs) and copy it to the USB drive. Copy the hard disk from the mount point by attaching the U Disk:
~ # Mkdir/home/debian-cd
~ # Cd/media/usb0
~ # Cp./CD-1.iso/home/debian-cd
~ # Cp./CD-2.iso/home/debian-cd
~ # Cp./CD-X.iso/home/debian-cd
The CD-X in the row above represents the x cd.
4. Mount the iso file
For future convenience, use a sh file to process the mounting process:
~ # Vi/home/debian-cd/deb. sh
Insert content (enter Baidu in vi, and press I to enter the editing mode ):
Mount-o loop/home/debian-cd/CD-1.iso/mnt/update-sources/cd1
Mount-o loop/home/debian-cd/CD-2.iso/mnt/update-sources/cd2
Mount-o loop/home/debian-cd/CD-3.iso/mnt/update-sources/cd3
Mount-o loop/home/debian-cd/CD-4.iso/mnt/update-sources/cd4
Mount-o loop/home/debian-cd/CD-5.iso/mnt/update-sources/cd5
Mount-o loop/home/debian-cd/CD-6.iso/mnt/update-sources/cd6
Mount-o loop/home/debian-cd/CD-7.iso/mnt/update-sources/cd7
Mount-o loop/home/debian-cd/CD-8.iso/mnt/update-sources/cd8
Exit vi, type: wq (Note: Enter the colon as well), and press Enter.
For the above directories in/mnt, you need to create:
~ # Cd/mnt
~ # Mkdir./update-sources
~ # Cd./update-sources
~ # Mkdir./cd1
~ # Mkdir./cd2
~ # Mkdir./cdX
The cdX in the above line is omitted in editing. Please write it from cd1 to cd8 honestly.
Everything is ready. Run deb. sh:
~ # Sh/home/debian-cd/deb. sh
5. Set the update source
You need to modify and update the source list file:
~ # Vi/etc/apt/sources. list
In vi, comment out other update sources and add the following content:
Deb file:/mnt/update-sources/cd1 wheezy main
Deb file:/mnt/update-sources/cd2 wheezy main
Deb file:/mnt/update-sources/cdX wheezy main
The above line of cdX is still omitted. Please complete cd1 to cd8 and save and exit vi.
Here we use the wheezy package. Other packages may be different in the wheezy main. Please check the directory in CD. Here, it is:
Dist/wheezy/main/binary-i386
That is, the part between the dist and the binary-i386. If a DVD is used, it should be:
Deb file:/mnt/update-sources/dvd1 wheezy contrib main
6. Install gnome
~ # Apt-get update
~ # Apt-get install x-window-system-core
~ # Apt-get install gnome-core
7. Start gnome
~ # Startx
Note:
1. Because tools such as vi need to be used, you must select the "Basic toolkit" option when installing Debian. Do not forget to install necessary tools if you are installing Debian in "EXPERT mode;
2. Some of the commands used above can be viewed with help:
~ # Man command
3. Some other commands may be used:
Mv-move/rename
Rm-delete
Recommended reading:
Debian 7.0 Wheezy test experience
Debian 7.0 Wheezy released!
Install Debian 7.0 Wheezy on a USB flash drive