11Installing Newt on Linux
22------------------------
33
4- You can install the latest release (1.9.0) of the newt tool from a Debian binary package (amd64). You can also download
5- and build the latest release version of newt from source .
4+ You can install the latest release of the newt tool from https://mynewt.apache.org/download or download latest sources
5+ directly from GitHub https://github.com/apache/mynewt-newt and build your binary localy .
66
7- This page shows you how to:
8-
9- 1. Set up your computer to download Debian binary packages from the JuulLabs-OSS APT repository.
10-
11- **Note: ** The key for signing the repository has changed. If you set up your computer before release 1.1.0, you will
12- need to download and import the public key again.
13-
14- 2. Install the latest release version of newt from a Debian binary package. You can use apt-get to install the package
15- or manually download and install the Debian binary package.
16-
17- 3. Download, build, and install the latest release version of newt from source.
18-
19- If you are installing on an amd64 platform, we recommend that you install from the binary package.
20-
21- See :doc: `prev_releases ` to install an earlier version of newt.
22-
23- **Note: ** We have tested the newt tool binary and apt-get install from the JuulLabs-OSS APT repository for Ubuntu version
24- 1704. Earlier Ubuntu versions (for example: Ubuntu 14) may have incompatibility with the repository. You can manually
25- download and install the Debian binary package.
26-
27- **Note: ** See :doc: `../../misc/go_env ` if you want to:
28-
29- - Use the newt tool with the latest updates from the master branch. The master branch may be unstable and we recommend
30- that you use the latest stable release version.
31- - Contribute to the newt tool.
32-
33- Setting Up Your Computer to use apt-get to Install the Package
34- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
35-
36- The newt Debian packages are stored in a private APT repository on **https://github.com/JuulLabs-OSS/debian-mynewt **.
37- To use apt-get, you must set up the following on your computer to retrieve packages from the repository:
38-
39- **Note **: You only need to perform this setup once on your computer. However, if you previously downloaded and imported
40- the public key for the JuulLabs-OSS APT repository, you will need to perform step 2 again as the key has changed.
41-
42- 1. Download the public key for the JuulLabs-OSS APT repository and import the key into the apt keychain.
43- 2. Add the repository for the binary and source packages to the apt source list.
44-
45- Download the public key for the JuulLabs-OSS apt repo (**Note: ** There is a ``- `` after ``apt-key add ``):
46-
47- .. code-block :: console
48-
49- $ wget -qO - https://raw.githubusercontent.com/JuulLabs-OSS/debian-mynewt/master/mynewt.gpg.key | sudo apt-key add -
50-
51- Add the repository for the binary and source packages to the ``mynewt.list `` apt source list file:
52-
53- .. code-block :: console
54-
55- $ sudo tee /etc/apt/sources.list.d/mynewt.list <<EOF
56- deb https://raw.githubusercontent.com/JuulLabs-OSS/debian-mynewt/master latest main
57- EOF
58-
59- **Note: ** Previously the repository lived under ``runtimeco/debian-mynewt ``, and although
60- updating should remain working, if it stops pulling in the latest releases, please try updating
61- ``/etc/apt/sources.list.d/mynewt.list `` and substitute ``runtimeco `` by ``JuulLabs-OSS ``.
62-
63- Update the available packages:
64-
65- .. code-block :: console
66-
67- $ sudo apt-get update
68-
69- **Note: ** If you are not using Ubuntu version 1704, you may see the following errors. We have provided instructions on
70- how to manually download and install the binary package.
71-
72- .. code-block :: console
73-
74- W: Failed to fetch https://raw.githubusercontent.com/JuulLabs-OSS/debian-mynewt/master/dists/latest/main/source/Sources HttpError404
75-
76- Installing the Latest Release of Newt from a Binary Package
77- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
78-
79- You can use either apt-get to install the package, or manually download and install the Debian binary package.
80-
81- Method 1: Using apt-get to Upgrade or to Install
82- ==============================================================================================
83-
84- Run the following commands to upgrade or install the latest version of newt:
85-
86- .. code-block :: console
87-
88- $ sudo apt-get update
89- $ sudo apt-get install newt
90-
91- **Note: ** If you encounter build errors (such as missing ``sys/mman.h ``), please make sure you have a 32-bit glibc:
92-
93- .. code-block :: console
94-
95- $ sudo apt-get install gcc-multilib
96-
97- Method 2: Downloading and Installing the Debian Package Manually
98- ==============================================================================================
99-
100- Download and install the package manually.
101-
102- .. code-block :: console
7+ .. code-block :: console
1038
104- $ wget https://raw.githubusercontent.com/JuulLabs-OSS/binary-releases/master/mynewt-newt-tools_1.9.0/newt_1.9.0-1_amd64.deb
105- $ sudo dpkg -i newt_1.9.0-1_amd64.deb
9+ $ git clone https://github.com/apache/mynewt-newt.git
10610
107- See `Checking the Installed Version of Newt `_ to verify that you are using the installed version of newt.
10811
109- Installing the Latest Release of Newt from a Source Package
12+ Installing Newt from Sources
11013^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
11114
112- If you are running Linux on a different architecture, you can build and install the latest release version of newt from
113- source.
114-
11515The newt tool is written in Go (https://golang.org/). In order to build Apache Mynewt, you must have Go 1.12 or later
11616installed on your system. Please visit the Golang website for more information on installing Go (https://golang.org/).
11717
118- #. Download and unpack the newt source:
119-
120- .. code-block :: console
121-
122- $ wget -P /tmp https://github.com/apache/mynewt-newt/archive/mynewt_1_9_0_tag.tar.gz
123- $ tar -xzf /tmp/mynewt_1_9_0_tag.tar.gz
124-
12518#. Run the build.sh to build the newt tool.
12619
12720 .. code-block :: console
12821
129- $ cd mynewt-newt-mynewt_1_9_0_tag
22+ $ cd mynewt-newt
13023 $ ./build.sh
131- $ rm /tmp/mynewt_1_9_0_tag.tar.gz
13224
133- #. You should see the `` newt/newt `` executable. Move the executable to a bin directory in your PATH:
25+ #. Add the path to the newt tool to your PATH.
13426
135- - If you previously built newt from the master branch, you can move the binary to your $GOPATH/bin directory.
136-
137- .. code-block :: console
27+ .. code-block :: console
13828
139- $ mv newt/newt $GOPATH/bin
29+ $ mkdir ~/bin
30+ $ mv ./newt/newt ~/bin/.
31+ $ export PATH=$PATH:~/bin
14032
141- - If you are installing newt for the first time and do not have a Go workspace set up, you can move the binary to
142- /usr/bin or a directory in your PATH:
33+ #. To make newt visible in every new terminal add the export to ~/.bashrc
14334
144- .. code-block :: console
35+ .. code-block :: console
14536
146- $ mv newt/newt /usr/bin
37+ $ echo 'export PATH=$PATH:~/bin' >> ~/.bashrc
14738
14839 Checking the Installed Version of Newt
14940^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -155,7 +46,7 @@ Checking the Installed Version of Newt
15546 $ which newt
15647 /usr/bin/newt
15748 $ newt version
158- Apache Newt version: 1.9.0
49+ Apache Newt 1.13.0 / c6bf556 / 2024-11-15_06:58
15950
16051 2. Get information about newt:
16152
@@ -185,6 +76,7 @@ Checking the Installed Version of Newt
18576 apropos Search manual page names and descriptions
18677 build Build one or more targets
18778 clean Delete build artifacts for one or more targets
79+ completion Generate the autocompletion script for the specified shell
18880 create-image Add image header to target binary
18981 debug Open debugger session to target
19082 docs Project documentation generation commands
@@ -212,6 +104,7 @@ Checking the Installed Version of Newt
212104 -l, --loglevel string Log level (default "WARN")
213105 -o, --outfile string Filename to tee output to
214106 -q, --quiet Be quiet; only display error output
107+ --shallow int Use shallow clone for git repositories up to specified number of commits
215108 -s, --silent Be silent; don't output anything
216109 -v, --verbose Enable verbose output when executing commands
217110
0 commit comments