Open main menu

DAVE Developer's Wiki β

Changes

DESK-MP1-L/Development/Management of prebuilt packages

7,528 bytes removed, 08:41, 10 August 2023
Introduction
[[File:TBD.png|thumb|center|600px]]<section begin="History" />
{| style="border-collapse:collapse; "
! colspan="4" style="width:100%; text-align:left" ; border-bottom:solid 2px #ededed" |History
|-
|}
<section end="History" />__FORCETOC__<section begin="Body" />TBD
==Introduction==
During the development of custom applications, developers generally realize that they need to add libraries and other software packages to the root file systems to make their code run properly. If these packages are prebuilt, developers can easily install these additional packages them onto the root file system very easily. By configuring the target as described in this document, they achieve a user experience similar to the one you have with a desktop Linux distro such as Ubuntu. DESK-MP1-L uses by default the <code>deb</code> package format. As such, [https://itsfoss.com/apt-command-guide/ apt commands] can be used for package management. Prebuilt packages are provided by a repository that DAVE Embedded Systems makes available for its customers. ==Configuring the target==In order to use <code>apt-get</code> for runtime package management, you must perform an initial setup on the target machine for cases where the PACKAGE_FEED_* variables were not set as part of the image that is running on the target.  == apt-get ==The following instructions detail how to use apt-get for installing packages with Yocto repositories created by DAVE's build system for DESK-MX8M-L. ===Configuring <code>apt</code>===Edit the file <code>/etc/apt/apt.conf</code> like this:<pre>APT::Architecture "arm64";APT::Get::AllowUnauthenticated "true";Acquire::Languages "none";</pre> Edit the file <code>/etc/apt/sources.list.d/debian-10.list</code> like this:<pre class="board-terminal">root@desk-mx8mp:~# cat /etc/apt/sources.list.d/debian-10.listdeb [trusted=yes] http://yocto.dave.eu/imx-5.4.70-2.3.0/ all/deb [trusted=yes] httphttps://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/</pre> Execute the following commands in order to re-create the ''apt'' cache based on the new server's list: <pre>rm -rf /var/lib/apt/lists/*apt-get cleanapt-get update</pre> <pre class="board-terminal">root@desk-mx8mp:~# rm -rf /var/lib/apt/lists/*root@desk-mx8mp:~# aptmp1-get cleanroot@orca:~# aptl-get update0% [Working]Ign:1 http://yocto.dave.eu/imx-5.4.70-2.3.0 all/ InReleaseIgn:2 http://yocto.dave.eu/imx-5.4.70-2.3.0 aarch64/ InReleaseIgn:3 http://yocto.dave.eu/imx-5.4.70-2.3.0 aarch64-mx8mp/ InReleaseGet:4 http://yocto.dave.eu/imx-5.4.70-2.3.0 all/ Release [1213 Bthis repository]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.gpgIgn:8 http://yocto.dave.eu/imx-5.4.70-2.3.0 aarch64/ Release.gpgIgn:9 http://yocto.dave.eu/imx-5.4.70-2.3.0 aarch64-mx8mp/ Release.gpgGet: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</pre> Then, modify the cached package list due to the proper that DAVE's server configuration: <pre>sed -i 's/\.\//aarch64\//g' /var/lib/apt/lists/yocto.dave.eu_imx-5.4.70-2.3.0_aarch64_Packagessed -i 's/\.\//all\//g' /var/lib/apt/lists/yocto.dave.eu_imx-5.4.70-2.3.0_all_Packagessed -i 's/\.\//aarch64-mx8mp\//g' /var/lib/apt/lists/yocto.dave.eu_imx-5.4.70-2.3.0_aarch64-mx8mp_Packages</pre> == Installing packages on target == We assume that network interface has been already configured for Internet access. In any case, a simple network configuration can be done according to the [[DESK-MX8M-L/Deployment/How_to_configure_the_network_interfaces#Static_IP_address | How to configure the network interfaces]] wiki page. The target is finally ready to install new packages. The following example shows for instance the installation of <code>vim</code>:<pre class="board-terminal">root@orca:~# apt-get install vimReading package lists... DoneBuilding dependency treeReading state information... DoneThe following additional packages will be installed: vim-common vim-help vim-syntax vim-tutor vim-vimrcThe following NEW packages will be installed: vim vim-common vim-help vim-syntax vim-tutor vim-vimrc0 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] YGet: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.vimupdate-alternatives: Linking /usr/bin/vim to /usr/bin/vim.vimupdate-alternatives: Linking /usr/bin/xxd to /usr/bin/xxd.vimSetting 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) ...</pre> == Other useful apt commands == === List of configured software repositories ===As shown before, the target is configured for accessing the Yocto repositories as listed in the <code>/etc/apt/sources.list.d</code> apt configuration directory: <pre class="board-terminal">root@desk-mx8mp:~# cat /etc/apt/sources.list.d/debian-10.listdeb [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/</pre> === Search for packages === To search for an Embedded Systems makes available package into the current configured channels use <code>apt-cache search</code> Please note that this will show all packages, it's usually more useful to grep for a pattern, e.g.: <pre class="board-terminal">root@desk-mx8mp:~# apt-cache search vimvim-dbg - Vi IMproved - enhanced vi editor - Debugging filesvim - Vi IMproved - enhanced vi editorvim-common - Vi IMproved - enhanced vi editorvim-src - Vi IMproved - enhanced vi editor - Source filesvim-tutor - Vi IMproved - enhanced vi editorvim-vimrc - Vi IMproved - enhanced vi editorvim-syntax - Vi IMproved - enhanced vi editorvim-tools - Vi IMproved - enhanced vi editorvim-help - Vi IMproved - enhanced vi editorvim-dev - Vi IMproved - enhanced vi editor - Development filesvim-doc - Vi IMproved - enhanced vi editor - Documentation filesroot@desk-mx8mp:~#</pre> === List of installed packages === User can see the list of installed packages with <code>dpkg --get-selections | sed 's:install$::'</code> (sed removes the ''install'' string from the output list) <pre>aclacl-devadwaita-icon-theme-symbolicalsa-confalsa-statealsa-statesalsa-toolsalsa-utilsalsa-utils-aconnectalsa-utils-alsactlalsa-utils-alsaloopalsa-utils-alsamixeralsa-utils-alsatplg...[snip]..its customers.volatile-binds-devwaylandwayland-devwhichwhich-devwireless-regdb-staticwireless-toolswpa-supplicantwpa-supplicant-cliwpa-supplicant-passphrasexinetdxzxz-devroot@desk-mx8mm:~#</pre>
4,650
edits