Quickly build an Ubuntu update source server
In corporate schools, a local Ubuntu source server is often required.
You can set it through the following simple steps.
1. Server Configuration
Here we use a PC with ubuntu as the server.
1.1. Install the corresponding software package
$ Sudo apt-get install apache2
$ Sudo apt-get install apt-mirror
1.2. Execute apt-mirror
The entire repo is very large. We can make some modifications to mirror. list and select only a part of the software package.
As follows:
Deb http://archive.ubuntu.com/ubuntu precise main restricted universe
Then execute:
$ Sudo apt-mirror
1.4. Create the ubuntu directory
$ Cd/var/www
$ Sudo ln-s/var/spool/apt-mirror/skel/archive.ubuntu.com/ubuntu
1.5. Restart the http service
$ Sudo service apache2 restart
In this way, the server is configured.
2. Client Configuration
Similarly, the client needs to be connected to the server we have configured, and the client needs to be adjusted accordingly.
2.1. Modify/etc/apt/souces. list
Comment out all other repository and append the following two rows:
Deb http: // 192.168.1.2/ubuntu/precise main restricted universe
Deb-src http: // 192.168.1.2/ubuntu/precise main restricted universe
192.168.1.2 is the IP address of the server.
2.2. Update the corresponding information
Sudo apt-get update