In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the knowledge about "how to use APT-mirror local software repository in Ubuntu system". In the actual case operation process, many people will encounter such difficulties. Next, let Xiaobian lead you to learn how to deal with these situations! I hope you can read carefully and learn something!
1. Install the required packages
We need to get all packages from Ubuntu's public package repository and save them on our local Ubuntu server hard drive.
First we install a Web server to host our local software repository. Here we will install Apache Web server, but you can install any Web server you like. For http, a Web server is required. If you need to configure ftp and rsync protocols, you can also install additional FTP servers such as proftpd, vsftpd, etc. and Rsync.
The code is as follows:
$ sudo apt-get install apache2
Then we need to install apt-mirror:
The code is as follows:
$ sudo apt-get install apt-mirror
Note: As I mentioned earlier, we need at least 120 GB of free space for all packages to be mirrored or downloaded.
2. Configure APT-Mirror
Now, create a directory on your hard drive to store all packages. For example, we create a directory called/linoxide where we will store all packages:
The code is as follows:
$ sudo mkdir /linoxide
Now open the file/etc/apt/mirror.list :
The code is as follows:
$ sudo nano /etc/apt/mirror.list
Copy the following command-line configuration into the mirror.list file and modify it to suit your needs:
The code is as follows:
############# config ##################
#
set base_path /linoxide
#
# set mirror_path $base_path/mirror
# set skel_path $base_path/skel
# set var_path $base_path/var
# set cleanscript $var_path/clean.sh
# set defaultarch
# set postmirror_script $var_path/postmirror.sh
# set run_postmirror 0
set nthreads 20
set _tilde 0
#
############# end config ##############
deb http://archive.ubuntu.com/ubuntu trusty main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse
#deb http://archive.ubuntu.com/ubuntu trusty-proposed main restricted universe multiverse
#deb http://archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu trusty main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu trusty-proposed main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse
clean http://archive.ubuntu.com/ubuntu
Note: You can change the official mirror server URLs above to the URLs of the servers closest to you, which can be found by visiting Ubuntu Mirror Server. If you don't care much about how long the mirror takes to complete, you can use the default official mirror server URL.
Here, we are going to mirror the package repository of the latest and largest Ubuntu LTS distribution, namely Ubuntu 14.04 LTS (Trusty Tahr), so in the configuration above the release number is trusty. If we need to mirror Saucy or another Ubuntu distribution, please change the trusy above to the appropriate codename.
Now we have to run apt-mirror to download or mirror all packages from the official repository.
The code is as follows:
sudo apt-mirror
The time it takes to download all packages from the Ubuntu server depends on the network connection speed and performance between you and the mirror server. Here I interrupted the download because I had already downloaded...
3. Configure network servers
In order for other computers to be able to access this repository, you need a Web server. You can also do this via ftp, but I chose to use a Web server because I mentioned using a Web server in step 1 above. So, we're now going to configure the Apache server:
We'll create a symbolic link for our local repository directory to the Apache hosting directory, which is/var/www/ubuntu ---.
The code is as follows:
$ sudo ln -s /linoxide /var/www/ubuntu
$ sudo service apache2 start
The above command will allow us to browse our mirror repository from localhost, which is http://127.0.0.1 (by default).
4. configure client
Finally, we need to add software sources to other computers so that they can get packages or repositories from our computers. To do this, we need to edit the/etc/apt/sources.list file and add the following command:
The code is as follows:
$ sudo nano /etc/apt/sources.list
Add the following line to/etc/apt/sources.list and save it.
The code is as follows:
deb http://192.168.0.100/ubuntu/ trusty main restricted universe
Note: 192.168.0.100 here is the local area network IP address of our server computer, you need to replace it with the local area network IP address of your server computer
The code is as follows:
$ sudo apt-get update
"How to use APT-mirror local software repository in Ubuntu system" content introduced here, thank you for reading. If you want to know more about industry-related knowledge, you can pay attention to the website. Xiaobian will output more high-quality practical articles for everyone!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.