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).
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.