Skip to main content

How to Creation and Installation Local Packages of the deb Repository Site in the Offline Situation?

How to creation and installation local packages of the deb repository site in the offline situation?

How to creation and installation local packages of the deb repository site in the offline situation?

Introduction

In this essay, you will be following the document called 'How to grab the files that you need from FTP site?'. Now, you have been finished that downloaded whole you need files in your removable mass storage. Firstly, you need to create a local deb repository site. Secondly, you will be able to install deb packages in offline situations.

Equipment

Operation System: Ubuntu 14.04 LTS and Raspbian (NOOBS_v1.3.10)

Usage

1.. Normally, The currently Linux system has been prepared to install 'dpkg' tool. So, you just make sure you have.

$ dpkg --version
Debian `dpkg' package management program version 1.16.15 (armhf).

This is free software; see the GNU General Public License version 2 or later for copying conditions. There is NO warranty.

2.. Create a local deb repository site.

$ cd /usr/local
$ sudo install -d pool
$ sudo cp -rH /(your packages' path) /usr/local/pool/
$ sudo install -d dists/unstable/main/binary-i386(you can change it, such as '/binary-armhf')
$ sudo ls -l pool | sed 's/_.*$/ priority section/' | uniq > override
$ ls -la
override
... (more)

$ sudo dpkg-scanpackages pool override \ > dists/unstable/main/binary-i386/Packages
dpkg-scanpackages: warning: package 0ad-data (filename pool/main//0/0ad-data/0ad-data_0~r11863-1_all.deb) is repeat;
dpkg-scanpackages: warning: ignored that one and using data from pool/main//0/0ad-data/0ad-data_0.0.17-1_all.deb!
... (more)

$ sudo cat > dists/unstable/main/Release << EOF
Archive: unstable
Version: 3.0
Component: main
Origin: Local
Label: Local
Architecture: i386 (or armhf)
EOF
$ sudo echo “deb file:/usr/local unstable main” \ >> /etc/apt/sources.list

3.. Disconnect and disable remote deb repository's site.
For example, we will provide one way for two Linux system.

3.1. In Raspberry Pi.
$ cd /etc/apt/sources.list.d/
$ ls -la

total 20   

drwxr-xr-x 2 root root 4096 Jan 1 1970 . drwxr-xr-x 6 root root 4096 Jan 1 1970 .. -rw-r--r-- 1 root root 48 Sep 9 05:33 collabora.list -rw-r--r-- 1 root root 55 Sep 9 04:44 raspi.list -rw-r--r-- 1 root root 60 Sep 9 05:51 wolfram.list

3.2. In Ubuntu 14.04 LTS
$ cd /etc/apt
$ ls -la

total 56   

drwxr-xr-x 6 root root 4096 Oct 3 15:24 . drwxr-xr-x 151 root root 12288 Nov 30 13:51 .. drwxr-xr-x 2 root root 4096 Nov 26 20:50 apt.conf.d drwxr-xr-x 2 root root 4096 Apr 10 2014 preferences.d -rw-rw-r-- 1 root root 3109 Oct 3 15:24 sources.list drwxr-xr-x 2 root root 4096 Apr 10 2014 sources.list.d -rw------- 1 root root 40 Jul 23 06:22 trustdb.gpg -rw-r--r-- 1 root root 12926 Jul 23 06:22 trusted.gpg drwxr-xr-x 2 root root 4096 Apr 10 2014 trusted.gpg.d

3.3. Edition these 'apt' configuration.

If you want to pure clearly installation environment, it is necessary that disconnect to the internet. Therefore, you need to remark any deb repositories site hyperlink. You can refer to this way as below.

3.3.1. In Raspberry Pi.

$ sudo gedit collabora.list
deb http://raspberrypi.collabora.com wheezy rpi
You should be remark as below and save it.
# deb http://raspberrypi.collabora.com wheezy rpi

$ sudo gedit raspi.list
deb http://archive.raspberrypi.org/debian/ wheezy main
(Remark)
# deb http://archive.raspberrypi.org/debian/ wheezy main
(Click save button)

$ sudo gedit wolfram.list
deb http://repository.wolfram.com/raspbian/ stable non-free
(Remark)
# deb http://repository.wolfram.com/raspbian/ stable non-free
(Click save button)

3.3.2. In Ubuntu 14.04 LTS

$ sudo geidt sources.list

You may notice that it is many hyperlinks. You are able to remark some or whole hyperlink if you feel safe. That is your choice. You are also changing those hyperlink that it might another deb source site safely. If you really downloaded that you need packages and then you can never mind those hyperlinks, just remark whole.

File name: sources.list
#deb cdrom:[Ubuntu 14.04.1 LTS _Trusty Tahr_ - Release amd64 (20140722.2)]/ trusty main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
# deb http://xx.archive.ubuntu.com/ubuntu/ trusty main restricted
# deb-src http://xx.archive.ubuntu.com/ubuntu/ trusty main restricted

## Major bug fix updates produced after the final release of the
## distribution.
# deb http://xx.archive.ubuntu.com/ubuntu/ trusty-updates main restricted
# deb-src http://xx.archive.ubuntu.com/ubuntu/ trusty-updates main restricted

4.. Safe leastwise.

Once you were prepared your firewall configuration and then you can connect to the internet. You are only to make sure safely the Operation System before you connect to the internet.

Exception

1..
pi@raspberrypi /etc/apt $ sudo apt-get update
E: Type '“deb' is not known on line 2 in source list /etc/apt/sources.list
E: The list of sources could not be read.

You should modify the file (source.list) and delete whole double quotation marks.

2..
If you have too many packages, you should separate to create their Package files, such as below.

$ sudo install -d dists/unstable/0/binary-armhf
$ sudo install -d dists/unstable/2/binary-armhf
$ sudo install -d dists/unstable/3/binary-armhf
... (more)
$ sudo ls -l /media/TEMPORAL/archive.raspbian.org/raspbian/pool/main/0 | sed 's/_.*$/ priority section/' | uniq > override0
$ sudo ls -l /media/TEMPORAL/archive.raspbian.org/raspbian/pool/main/2 | sed 's/_.*$/ priority section/' | uniq > override2
$ sudo ls -l /media/TEMPORAL/archive.raspbian.org/raspbian/pool/main/3 | sed 's/_.*$/ priority section/' | uniq > override3
... (more)
$ sudo dpkg-scanpackages /media/TEMPORAL/archive.raspbian.org/raspbian/pool/main/0 override0 /usr/local/ > dists/unstable/0/binary-armhf/Packages
$ sudo dpkg-scanpackages /media/TEMPORAL/archive.raspbian.org/raspbian/pool/main/2 override2 /usr/local/ > dists/unstable/2/binary-armhf/Packages
$ sudo dpkg-scanpackages /media/TEMPORAL/archive.raspbian.org/raspbian/pool/main/3 override3 /usr/local/ > dists/unstable/3/binary-armhf/Packages
... (more)

$ sudo cat > dists/unstable/0/Release << EOF
Archive: unstable
Version: 3.0
Component: 0
Origin: Local
Label: Local
Architecture: armhf
EOF
$ sudo cat > dists/unstable/2/Release << EOF
Archive: unstable
Version: 3.0
Component: 2
Origin: Local
Label: Local
Architecture: armhf
EOF
$ sudo cat > dists/unstable/3/Release << EOF
Archive: unstable
Version: 3.0
Component: 3
Origin: Local
Label: Local
Architecture: armhf
EOF
... (more)
$ sudo echo deb file:/media/TEMPORAL/archive.raspbian.org/raspbian/pool unstable 0 \ >> /etc/apt/sources.list
$ sudo echo deb file:/media/TEMPORAL/archive.raspbian.org/raspbian/pool unstable 2 \ >> /etc/apt/sources.list
$ sudo echo deb file:/media/TEMPORAL/archive.raspbian.org/raspbian/pool unstable 3 \ >> /etc/apt/sources.list
... (more)

However, If you do this command 'apt-get update'. Maybe it makes many incorrect in the Package files. You must repair it and modify whole '/usr/local/' to delete it. It should be doing well. Or you could use ‘.. /.. /’ to add file name of the package to avoid '/usr/local'.

Acknowledge

Thank you (Debian, Raspberry Pi, Ubuntu) very much for this great solution.

Popular Posts

波蘭文學習之旅:1-1. 波蘭文字母與發音(注音版)

最佳化處理策略之快速消除扭曲演算法

Python 日期與時間的處理

波蘭文學習之旅:1-1. 波蘭文字母與發音(注音版)

Image

最佳化處理策略之快速消除扭曲演算法

Image

Python 日期與時間的處理

Image

Visual Basic 6.0 程式案例學習: 10. 條碼列印程式 (2014版)

Image

Visual Basic .Net 程式案例學習: 06. 題庫測驗系統 (2014版)

Image

修復損毀的 SQLite DB 資料庫

Image

用10種程式語言做影像二值化(Image binarization)

Image

解決 ValueError: If using all scalar values, you must pass an index

Image

Visual Basic 6.0 程式案例學習: 04. 人事考勤管理系統 (2014版)

Image

Visual Basic 6.0 程式案例學習: 07. 收據列印程式 (2014版)

Image

佑佑的 Line 貼圖創作

貼圖作者網址:

https://line.me/S/shop/sticker/author/3883362

靜態貼圖

 
 
 
 
  牡羊座:狗狗角色

作者:佑佑
依照牡羊座的個性優點、個性缺點、生活習慣、理財習慣、社交習慣、愛情觀、節假日、禮貌問候,所編撰的貼圖。星座只能當參考用,不會完全準確。
購買貼圖
  金牛座:兔兔角色

作者:佑佑
依照金牛座的個性優點、個性缺點、生活習慣、理財習慣、社交習慣、愛情觀、節假日、禮貌問候,所編撰的貼圖。星座只能當參考用,不會完全準確。
購買貼圖
  雙子座:貓貓角色

作者:佑佑
依照雙子座的個性優點、個性缺點、生活習慣、理財習慣、社交習慣、愛情觀、節假日、禮貌問候,所編撰的貼圖。星座只能當參考用,不會完全準確。
購買貼圖
  巨蟹座:倉鼠角色

作者:佑佑
依照巨蟹座的個性優點、個性缺點、生活習慣、理財習慣、社交習慣、愛情觀、節假日、禮貌問候,所編撰的貼圖。星座只能當參考用,不會完全準確。
購買貼圖
 
 
 
 
  獅子座:幼獅角色

作者:佑佑
依照獅子座的個性優點、個性缺點、生活習慣、理財習慣、社交習慣、愛情觀、節假日、禮貌問候,所編撰的貼圖。星座只能當參考用,不會完全準確。
購買貼圖
  處女座:松鼠角色

作者:佑佑
依照處女座的個性優點、個性缺點、生活習慣、理財習慣、社交習慣、愛情觀、節假日、禮貌問候,所編撰的貼圖。星座只能當參考用,不會完全準確。
購買貼圖
  天秤座:鴿子角色

作者:佑佑
依照天秤座的個性優點、個性缺點、生活習慣、理財習慣、社交習慣、愛情觀、節假日、禮貌問候,所編撰的貼圖。星座只能當參考用,不會完全準確。
購買貼圖
  天蠍座:鳳凰角色

作者:佑佑
依照天蠍座的個性優點、個性缺點、生活習慣、理財習慣、社交習慣、愛情觀、節假日、禮貌問候,所編撰的貼圖。星座只能當參考用,不會完全準確。
購買貼圖
 
 
 
 
  射手座:人馬角色

作者:佑佑
依照射手座的個性優點、個性缺點、生活習慣、理財習慣、社交習慣、愛情觀、節假日、禮貌問候,所編撰的貼圖。星座只能當參考用,不會完全準確。
購買貼圖
  魔羯座:山羊角色

作者:佑佑
依照魔羯座的個性優點、個性缺點、生活習慣、理財習慣、社交習慣、愛情觀、節假日、禮貌問候,所編撰的貼圖。星座只能當參考用,不會完全準確。
購買貼圖
  水瓶座:海豚角色

作者:佑佑
依照水瓶座的個性優點、個性缺點、生活習慣、理財習慣、社交習慣、愛情觀、節假日、禮貌問候,所編撰的貼圖。星座只能當參考用,不會完全準確。
購買貼圖
  雙魚座:小丑魚角色

作者:佑佑
依照雙魚座的個性優點、個性缺點、生活習慣、理財習慣、社交習慣、愛情觀、節假日、禮貌問候,所編撰的貼圖。星座只能當參考用,不會完全準確。
購買貼圖
 
 
 
 
  上班族都變成狒狒,心裡想要說的話。

作者:佑佑
最近在台灣走紅的狒狒,用擬人化的方式,變成上班族,畫出心裡的想說的話。
購買貼圖
  接案派遣的日常

作者:佑佑
接案派遣到其他公司的日常對話,有調皮、正經、日常對話。
購買貼圖
  貓女事務員的搞笑時刻

作者:佑佑
把行政人員在職場上遇到千奇百怪的事情畫出來,用可愛的貓女來擔任行政人員的代言人。
購買貼圖
  貓貓說每天都會用到的話

作者:佑佑
日常生活常見的短句,用小貓擬人化的方式呈現,比較親切可愛。
購買貼圖
 
     
  大人的煩惱特輯:小兔角色

作者:佑佑
錢包餓了,生活苦了。變美變健康?先讓我睡飽吧。心好累,我需要充電。
購買貼圖
     

動態貼圖

 
 
 
 
  牡羊座日常交際:狗狗角色

作者:佑佑
依照牡羊座的個性,描繪日常生活的行為,供交際表達心情使用。星座只能當參考用,不會完全準確。
購買貼圖
  金牛座日常交際:兔兔角色

作者:佑佑
依照金牛座的個性,描繪日常生活的行為,供交際表達心情使用。星座只能當參考用,不會完全準確。
購買貼圖
  雙子座日常交際:貓貓角色

作者:佑佑
依照雙子座的個性,描繪日常生活的行為,供交際表達心情使用。星座只能當參考用,不會完全準確。
購買貼圖
  巨蟹座日常交際:倉鼠角色

作者:佑佑
依照巨蟹座的個性,描繪日常生活的行為,供交際表達心情使用。星座只能當參考用,不會完全準確。
購買貼圖
 
 
 
 
  獅子座日常交際:幼獅角色

作者:佑佑
依照獅子座的個性,描繪日常生活的行為,供交際表達心情使用。星座只能當參考用,不會完全準確。
購買貼圖
  處女座日常交際:松鼠角色

作者:佑佑
依照處女座的個性,描繪日常生活的行為,供交際表達心情使用。星座只能當參考用,不會完全準確。
購買貼圖
  天秤座日常交際:鴿子角色

作者:佑佑
依照天秤座的個性,描繪日常生活的行為,供交際表達心情使用。星座只能當參考用,不會完全準確。
購買貼圖
  天蠍座日常交際:鳳凰角色

作者:佑佑
依照天蠍座的個性,描繪日常生活的行為,供交際表達心情使用。星座只能當參考用,不會完全準確。
購買貼圖
 
 
 
 
  射手座日常交際:人馬角色

作者:佑佑
依照射手座的個性,描繪日常生活的行為,供交際表達心情使用。星座只能當參考用,不會完全準確。
購買貼圖
  魔羯座日常交際:山羊角色

作者:佑佑
依照魔羯座的個性,描繪日常生活的行為,供交際表達心情使用。星座只能當參考用,不會完全準確。
購買貼圖
  水瓶座日常交際:海豚角色

作者:佑佑
依照水瓶座的個性,描繪日常生活的行為,供交際表達心情使用。星座只能當參考用,不會完全準確。
購買貼圖
  雙魚座日常交際:小丑魚角色

作者:佑佑
依照雙魚座的個性,描繪日常生活的行為,供交際表達心情使用。星座只能當參考用,不會完全準確。
購買貼圖
 
     
  厭世報:鬍渣男

作者:佑佑
厭世總有個理由跟原因,實在是令人不爽,為什麼最倒楣的總是我?真希望明天就是世界末日,讓大家都一樣慘。
購買貼圖
     

表情貼

 
 
 
 
  貓貓說每天都用得到的表情貼

作者:佑佑
日常生活常見的表情用語,用小貓擬人化的方式呈現,比較親切可愛。
購買貼圖
  天秤座的表情貼:鴿子角色

作者:佑佑
日常生活常見的表情用語,天秤座的鴿子擬人化方式呈現,比較親切可愛。
購買貼圖
  天蠍座的表情貼:鳳凰角色

作者:佑佑
日常生活常見的表情用語,天蠍座的鳳凰擬人化方式呈現,比較親切可愛。
購買貼圖
  射手座的表情貼:人馬角色

作者:佑佑
日常生活常見的表情用語,射手座的人馬擬人化方式呈現,比較親切可愛。
購買貼圖
 
 
 
 
  魔羯座的表情貼:山羊角色

作者:佑佑
日常生活常見的表情用語,魔羯座的山羊擬人化方式呈現,比較親切可愛。
購買貼圖
  水瓶座的表情貼:海豚角色

作者:佑佑
日常生活常見的表情用語,水瓶座的海豚擬人化方式呈現,比較親切可愛。
購買貼圖
  雙魚座的表情貼:小丑魚角色

作者:佑佑
日常生活常見的表情用語,雙魚座的小丑魚擬人化方式呈現,比較親切可愛。
購買貼圖