当前位置:网站首页>How to create your own repository for software packages on Debian
How to create your own repository for software packages on Debian
2022-07-03 05:43:00 【TAOXC( ̿ ▀ ̿ ̿Ĺ̯̿̿ ▀ ̿ ̿】
There are many reasons why you want to build your own local repository . This is a good way to create a local image repository to cache common software packages used by many computers to save bandwidth , Or you may want to provide some modified packages for the development team internally .
In this tutorial , We will show you how to relax establish And Debian and Ubuntu Version compatible local Debian Package Repository .
The first 1 Step : Install the required package
Based on Debian On the system , All repositories are made up of APT Utilities (apt、apt-get、apt-cache etc. ) management . Create with APT Compatible local repositories require dpkg-dev software package .
First update the system package with the following command :
$ sudo apt update && sudo apt upgrade
Next, install by typing dpkg-dev software package :
$ sudo apt-get install dpkg-dev
After package installation , Continue to create directories for package files .
The first 2 Step : Create a directory for the local repository
Create a directory to store binary packages . For this example , We will use /opt/local/debs, But you can use any directory you like .
$ sudo mkdir -p /opt/local/debs
Next , Change directory :
$ cd /opt/local/debs
The first 3 Step : Add the package to the local repository directory
For the purposes of this tutorial , We will chrome-browser Download the package to our local repository , Because by default Ubuntu It cannot be found in the repository :
$ sudo wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
In this step , You can copy or download any number of packages .
The first 4 Step : by APT Create the required repository package elements
So , We have to run several dpkg-scanpackages command . I will switch to root User account , Because I'm using /opt/local Directory to skip using sudo.
$ sudo su
First , We will create one by running the following command Release file :
# dpkg-scanpackages . /dev/null > Release
Based on the number of packages you add to the local repository , You should get similar output :
dpkg-scanpackages: warning: Packages in archive but missing from override file:
dpkg-scanpackages: warning: google-chrome-stable
dpkg-scanpackages: info: Wrote 1 entries to output Packages file.
Next, scan all in the directory deb file , And create a suitable Packages.gz file
# dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz
Output :
dpkg-scanpackages: warning: Packages in archive but missing from override file:
dpkg-scanpackages: warning: google-chrome-stable
dpkg-scanpackages: info: Wrote 1 entries to output Packages file.
Please note that , Each time a new deb When a package is added to the local repository directory , Must run these commands . You can also create a simple bash Script and run it when adding a new package .
To list local repo Directory structure , Please run ls command :
$ ls -l
Output :
-rw-r--r-- 1 root root 83325072 May 8 02:29 google-chrome-stable_current_amd64.deb
-rw-r--r-- 1 root root 761 May 17 20:44 Packages.gz
-rw-r--r-- 1 root root 1321 May 17 20:39 Release
The first 5 Step : Add our local repository to Sources.list
The last step is editing sources.list file . Edit the file using the editor of your choice :
$ sudo nano /etc/apt/sources.list
Add the following line to your /etc/apt/sources.list:
deb [trusted=yes] file:/opt/local/debs ./
Now we will test our local repository .
The first 6 Step : verification
We can verify by installing or removing packages from the local repository .
First we must update the software package :
$ sudo apt-get update
Now we use it as usual apt-get Install our package :
$ sudo apt-get install google-chrome-stable
Now your local package can use Synaptic、aptitude and apt Command to install 、 Update and delete :apt-get、apt-cache etc. . When you run apt-get install when , Any dependencies will be resolved and installed for you , As long as they can meet .
We can delete installed packages as easily as any installed packages on the system :
$ sudo apt-get remove google-chrome-stable
Conclusion
In this tutorial , We learned how to create our own local Debian Repository and add locally / Remove package . These steps apply to most... Based Debian Distribution version .
边栏推荐
- Apache+PHP+MySQL环境搭建超详细!!!
- Go practice -- use redis in golang (redis and go redis / redis)
- Source insight automatic installation and licensing
- College campus IP network broadcasting - manufacturer's design guide for college campus IP broadcasting scheme based on campus LAN
- [written examination question analysis] | | get [sizeof and strlen] [pointer and array] graphic explanation + code analysis
- Xaml gradient issue in uwp for some devices
- Introduction to webrtc protocol -- an article to understand dtls, SRTP, srtcp
- 中职网络子网划分例题解析
- 期末复习(DAY7)
- Configure and use Anaconda environment in pycharm
猜你喜欢

Go practice - gorilla / handlers used by gorilla web Toolkit

Go practice -- gorilla / websocket used by gorilla web Toolkit

@Solutions to null pointer error caused by Autowired

今天很多 CTO 都是被干掉的,因为他没有成就业务

Simpleitk learning notes

Gan network thought

2022.DAY592

Intégration profonde et alignement des séquences de protéines Google

Linux登录MySQL出现ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: YES)

Pessimistic lock and optimistic lock of multithreading
随机推荐
今天很多 CTO 都是被干掉的,因为他没有成就业务
Configure DTD of XML file
[explain in depth the creation and destruction of function stack frames] | detailed analysis + graphic analysis
一起上水硕系列】Day 9
Source insight License Activation
Transferring images using flask
[function explanation (Part 2)] | [function declaration and definition + function recursion] key analysis + code diagram
Mapbox tasting value cloud animation
Go practice -- factory mode of design patterns in golang (simple factory, factory method, abstract factory)
[untitled]
Analysis of the example of network subnet division in secondary vocational school
6.23星期四库作业
PHP笔记超详细!!!
Linux登录MySQL出现ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: YES)
How to use source insight
Pessimistic lock and optimistic lock of multithreading
Go practice -- gorilla/rpc (gorilla/rpc/json) used by gorilla web Toolkit
Final review (Day7)
Niuke JS separator
期末复习(DAY6)