当前位置:网站首页>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 .
边栏推荐
- Configure and use Anaconda environment in pycharm
- Go practice -- use redis in golang (redis and go redis / redis)
- EMD distance - example of use
- Webrtc native M96 version opening trip -- a reading code download and compilation (Ninja GN depot_tools)
- Apache+php+mysql environment construction is super detailed!!!
- About debugging the assignment of pagenum and PageSize of the formal parameter pageweb < T > (i.e. page encapsulation generic) in the controller
- Map的扩容机制
- Skip table: principle introduction, advantages and disadvantages of skiplist
- AtCoder Beginner Contest 258(A-D)
- @Autowired 导致空指针报错 解决方式
猜你喜欢

Apache+php+mysql environment construction is super detailed!!!

Gan network thought
![[function explanation (Part 2)] | [function declaration and definition + function recursion] key analysis + code diagram](/img/29/1644588927226a49d4b8815d8bc196.jpg)
[function explanation (Part 2)] | [function declaration and definition + function recursion] key analysis + code diagram

"C and pointer" - Chapter 13 advanced pointer int * (* (* (*f) () [6]) ()
![[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!

Webrtc native M96 version opening trip -- a reading code download and compilation (Ninja GN depot_tools)
![[together Shangshui Shuo series] day 7 content +day8](/img/fc/74b12addde3a4d3480e98f8578a969.png)
[together Shangshui Shuo series] day 7 content +day8

Introduction to redis using Lua script

@Solutions to null pointer error caused by Autowired

Capacity expansion mechanism of map
随机推荐
Altaro o365 total backup subscription plan
一起上水碩系列】Day 9
ninja: build stopped: subcommand failed.
Source insight operation manual installation trial
求质数的方法
Jetson AgX Orin platform porting ar0233 gw5200 max9295 camera driver
Kubernetes resource object introduction and common commands (V) - (configmap)
Webrtc protocol introduction -- an article to understand ice, stun, NAT, turn
Deep embedding and alignment of Google | protein sequences
Progressive multi grasp detection using grasp path for rgbd images
[advanced pointer (1)] | detailed explanation of character pointer, pointer array, array pointer
Exception when introducing redistemplate: noclassdeffounderror: com/fasterxml/jackson/core/jsonprocessingexception
Shanghai daoning, together with American /n software, will provide you with more powerful Internet enterprise communication and security component services
Webrtc native M96 version opening trip -- a reading code download and compilation (Ninja GN depot_tools)
Talk about how to use p6spy for SQL monitoring
Redis encountered noauth authentication required
Final review (Day7)
Deploy crawl detection network using tensorrt (I)
DEX net 2.0 for crawl detection
Altaro set grandfather parent child (GFS) archiving