Embedded Linux tips and tricks

From DAVE Developer's Wiki
Jump to: navigation, search

Edit the file /etc/apt/apt.conf like this:

APT::Architecture "arm64";
APT::Get::AllowUnauthenticated "true";
Acquire::Languages "none";

Edit the file /etc/apt/sources.list.d/debian-10.list like this:

root@desk-mx8mp:~# cat /etc/apt/sources.list.d/debian-10.list
deb [trusted=yes] http://yocto.dave.eu/imx-5.4.70-2.3.0/ all/
deb [trusted=yes] http://yocto.dave.eu/imx-5.4.70-2.3.0/ aarch64/
deb [trusted=yes] http://yocto.dave.eu/imx-5.4.70-2.3.0/ aarch64-mx8mp/


Execute the following commands:

root@desk-mx8mp:~# rm -rf /var/lib/apt/lists/*
root@desk-mx8mp:~# apt-get clean
root@orca:~# apt-get update
0% [Working]
Ign:1 http://yocto.dave.eu/imx-5.4.70-2.3.0 all/ InRelease
Ign:2 http://yocto.dave.eu/imx-5.4.70-2.3.0 aarch64/ InRelease
Ign:3 http://yocto.dave.eu/imx-5.4.70-2.3.0 aarch64-mx8mp/ InRelease
Get:4 http://yocto.dave.eu/imx-5.4.70-2.3.0 all/ Release [1213 B]
Get:5 http://yocto.dave.eu/imx-5.4.70-2.3.0 aarch64/ Release [1217 B]
Get:6 http://yocto.dave.eu/imx-5.4.70-2.3.0 aarch64-mx8mp/ Release [1223 B]
Ign:7 http://yocto.dave.eu/imx-5.4.70-2.3.0 all/ Release.gpg
Ign:8 http://yocto.dave.eu/imx-5.4.70-2.3.0 aarch64/ Release.gpg
Ign:9 http://yocto.dave.eu/imx-5.4.70-2.3.0 aarch64-mx8mp/ Release.gpg
Get:10 http://yocto.dave.eu/imx-5.4.70-2.3.0 all/ Packages [146 kB]
Get:11 http://yocto.dave.eu/imx-5.4.70-2.3.0 aarch64/ Packages [2848 kB]
Get:12 http://yocto.dave.eu/imx-5.4.70-2.3.0 aarch64-mx8mp/ Packages [283 kB]
Fetched 3280 kB in 6s (545 kB/s)
Reading package lists... Done
root@orca:~# sed -i 's/\.\//aarch64\//g' /var/lib/apt/lists/yocto.dave.eu_imx-5.4.70-2.3.0_aarch64_Packages
root@orca:~# sed -i 's/\.\//all\//g' /var/lib/apt/lists/yocto.dave.eu_imx-5.4.70-2.3.0_all_Packages
root@orca:~# sed -i 's/\.\//aarch64-mx8mp\//g' /var/lib/apt/lists/yocto.dave.eu_imx-5.4.70-2.3.0_aarch64-mx8mp_Packages

The target is finally ready to install new packages. The following example shows for instance the installation of vim:

root@orca:~# sudo apt-get install vim
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  vim-common vim-help vim-syntax vim-tutor vim-vimrc
The following NEW packages will be installed:
  vim vim-common vim-help vim-syntax vim-tutor vim-vimrc
0 upgraded, 6 newly installed, 0 to remove and 20 not upgraded.
Need to get 6584 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://yocto.dave.eu/imx-5.4.70-2.3.0 aarch64/ vim 8.1.1518-r0 [1051 kB]
Get:2 http://yocto.dave.eu/imx-5.4.70-2.3.0 aarch64/ vim-common 8.1.1518-r0 [2314 kB]
Get:3 http://yocto.dave.eu/imx-5.4.70-2.3.0 aarch64/ vim-help 8.1.1518-r0 [1757 kB]
Get:4 http://yocto.dave.eu/imx-5.4.70-2.3.0 aarch64/ vim-syntax 8.1.1518-r0 [1049 kB]
Get:5 http://yocto.dave.eu/imx-5.4.70-2.3.0 aarch64/ vim-tutor 8.1.1518-r0 [411 kB]
Get:6 http://yocto.dave.eu/imx-5.4.70-2.3.0 aarch64/ vim-vimrc 8.1.1518-r0 [1596 B]
Fetched 6584 kB in 9s (660 kB/s)
Selecting previously unselected package vim.
(Reading database ... 71726 files and directories currently installed.)
Preparing to unpack .../vim_8.1.1518-r0_arm64.deb ...
Unpacking vim (8.1.1518-r0) ...
Selecting previously unselected package vim-common.
Preparing to unpack .../vim-common_8.1.1518-r0_arm64.deb ...
Unpacking vim-common (8.1.1518-r0) ...
Selecting previously unselected package vim-help.
Preparing to unpack .../vim-help_8.1.1518-r0_arm64.deb ...
Unpacking vim-help (8.1.1518-r0) ...
Selecting previously unselected package vim-syntax.
Preparing to unpack .../vim-syntax_8.1.1518-r0_arm64.deb ...
Unpacking vim-syntax (8.1.1518-r0) ...
Selecting previously unselected package vim-tutor.
Preparing to unpack .../vim-tutor_8.1.1518-r0_arm64.deb ...
Unpacking vim-tutor (8.1.1518-r0) ...
Selecting previously unselected package vim-vimrc.
Preparing to unpack .../vim-vimrc_8.1.1518-r0_arm64.deb ...
Unpacking vim-vimrc (8.1.1518-r0) ...
Setting up vim (8.1.1518-r0) ...
update-alternatives: Linking /bin/vi to /usr/bin/vim.vim
update-alternatives: Linking /usr/bin/vim to /usr/bin/vim.vim
update-alternatives: Linking /usr/bin/xxd to /usr/bin/xxd.vim
Setting up vim-common (8.1.1518-r0) ...
Setting up vim-help (8.1.1518-r0) ...
Setting up vim-syntax (8.1.1518-r0) ...
Setting up vim-tutor (8.1.1518-r0) ...
Setting up vim-vimrc (8.1.1518-r0) ...