当前位置:网站首页>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 .
边栏推荐
- Introduction to webrtc protocol -- an article to understand dtls, SRTP, srtcp
- [together Shangshui Shuo series] day 7 content +day8
- Ensemble, série shuishu] jour 9
- Linux登录MySQL出现ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: YES)
- How to use source insight
- Capacity expansion mechanism of map
- 期末复习(day3)
- Latest version of source insight
- Intégration profonde et alignement des séquences de protéines Google
- @Solutions to null pointer error caused by Autowired
猜你喜欢
![Together, Shangshui Shuo series] day 9](/img/39/c1ba1bac82b0ed110f36423263ffd0.png)
Together, Shangshui Shuo series] day 9

Introduction to redis using Lua script

Error 1045 (28000) occurs when Linux logs in MySQL: access denied for user 'root' @ 'localhost' (using password: yes)
![[Shangshui Shuo series together] day 10](/img/a3/e8b9df588bef67ead925813a75c8c0.png)
[Shangshui Shuo series together] day 10
![[escape character] [full of dry goods] super detailed explanation + code illustration!](/img/33/ec5a5e11bfd43f53f2767a9a0f0cc9.jpg)
[escape character] [full of dry goods] super detailed explanation + code illustration!

一起上水碩系列】Day 9

How to use source insight

Redhat7系统root用户密码破解

@Autowired 导致空指针报错 解决方式

Communication - how to be a good listener?
随机推荐
MySQL startup error: several solutions to the server quit without updating PID file
Xaml gradient issue in uwp for some devices
Azure file synchronization of altaro: the end of traditional file servers?
ROS Compilation Principle
2022.7.2 simulation match
Niuke JS separator
Shanghai daoning, together with American /n software, will provide you with more powerful Internet enterprise communication and security component services
[explain in depth the creation and destruction of function stack frames] | detailed analysis + graphic analysis
Go practice -- use JWT (JSON web token) in golang
Method of finding prime number
Brief introduction of realsense d435i imaging principle
Can altaro back up Microsoft teams?
Understand one-way hash function
今天很多 CTO 都是被幹掉的,因為他沒有成就業務
MySQL 5.7.32-winx64 installation tutorial (support installing multiple MySQL services on one host)
[untitled]
期末复习(Day5)
Map的扩容机制
Notepad++ wrap by specified character
Common exceptions when Jenkins is released (continuous update...)