当前位置:网站首页>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 .
边栏推荐
- 期末复习(DAY6)
- Final review Day8
- Go practice -- gorilla / websocket used by gorilla web Toolkit
- Disassembly and installation of Lenovo r7000 graphics card
- MySQL startup error: several solutions to the server quit without updating PID file
- Final review (Day2)
- 配置xml文件的dtd
- Webrtc M96 release notes (SDP abolishes Plan B and supports opus red redundant coding)
- Calculation method of AUC
- [advanced pointer (1)] | detailed explanation of character pointer, pointer array, array pointer
猜你喜欢

DEX net 2.0 for crawl detection

"C and pointer" - Chapter 13 function of function pointer 1 - callback function 1
![[branch and cycle] | | super long detailed explanation + code analysis + a trick game](/img/aa/543d4f0dcbcd664be963579af77ec9.jpg)
[branch and cycle] | | super long detailed explanation + code analysis + a trick game

Webrtc M96 release notes (SDP abolishes Plan B and supports opus red redundant coding)

Map的扩容机制

Personal outlook | looking forward to the future from Xiaobai's self analysis and future planning

About debugging the assignment of pagenum and PageSize of the formal parameter pageweb < T > (i.e. page encapsulation generic) in the controller

How to set up altaro offsite server for replication

Altaro o365 total backup subscription plan
![[function explanation (Part 1)] | | knowledge sorting + code analysis + graphic interpretation](/img/c2/991b8febd262cf9237017adc9d1221.jpg)
[function explanation (Part 1)] | | knowledge sorting + code analysis + graphic interpretation
随机推荐
[function explanation (Part 1)] | | knowledge sorting + code analysis + graphic interpretation
期末复习(day3)
Simpleitk learning notes
[trivia of two-dimensional array application] | [simple version] [detailed steps + code]
期末复习(DAY7)
Go practice -- factory mode of design patterns in golang (simple factory, factory method, abstract factory)
Understand one-way hash function
Common exceptions when Jenkins is released (continuous update...)
Export the altaro event log to a text file
Altaro set grandfather parent child (GFS) archiving
Mapbox tasting value cloud animation
3dslam with 16 line lidar and octomap
32GB Jetson Orin SOM 不能刷机问题排查
Method of finding prime number
请求数据库报错:“could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGram
Jetson AGX Orin 平台移植ar0233-gw5200-max9295相机驱动
Altaro requirements for starting from backup on Hyper-V
Go practice -- design patterns in golang's singleton
Final review (day3)
[together Shangshui Shuo series] day 7 content +day8