{"id":810,"date":"2023-09-03T17:41:23","date_gmt":"2023-09-03T15:41:23","guid":{"rendered":"https:\/\/linux-bibel.at\/?p=810"},"modified":"2023-09-03T17:41:24","modified_gmt":"2023-09-03T15:41:24","slug":"cargo-software-unter-linux-aus-dem-rust-repository-installieren","status":"publish","type":"post","link":"https:\/\/linux-bibel.at\/index.php\/2023\/09\/03\/cargo-software-unter-linux-aus-dem-rust-repository-installieren\/","title":{"rendered":"Cargo &#8211; Software unter Linux aus dem Rust-Repository installieren"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Immer mehr Software wird auch unter Linux in der Programmiersprache Rust geschrieben &#8211; f\u00fcr diese Programmiersprache gibt es \u00e4hnlich wie bei\u00a0Python\u00a0ein eigenes Repository. Mittels Cargo &#8211; dem Rust-Paket-Manager l\u00e4sst sich die Rust-Software verwalten. Welche Rust-Pakete es gibt, zeigt sich unter\u00a0<a rel=\"noreferrer noopener\" href=\"https:\/\/crates.io\/\" target=\"_blank\">Creates.io<\/a>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Rust und Cargo installieren<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Unter auf Debian basierenden Linux-Distributionen installieren Sie diese Programmiersprache ganz einfach \u00fcber die Paket-Verwaltung durch das Paket &#8222;<strong>rustc<\/strong>&#8222;.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Rust-Software wird mittels Cargo im Home-Verzeichnis im versteckten Verzeichnis &#8222;<em>.cargo\/bin\/<\/em>&#8220; installiert &#8211; dieses Verzeichnis gilt es der ebenfalls im Home-Verzeichnis liegenden Datei &#8222;<strong>.bashrc<\/strong>&#8220; hinzuzuf\u00fcgen. Dies gelingt indem Sie folgende Zeile als neue Zeile am Ende der Datei einzuf\u00fcgen:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>PATH=\"\/home\/USERNAME\/.local\/bin:\/home\/USERNAME\/.cargo\/bin:\/usr\/local\/bin:\/usr\/bin:\/bin:\/usr\/local\/games:\/usr\/games\"<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">&#8222;USERNAME&#8220; ersetzen Sie dabei durch Ihren eigenen Nutzernamen, Sie speichern die Datei und starten das Terminal neu.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Rust-Software mittels Cargo verwalten<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Sie verwenden Cargo &#8211; also die Rust-Paket-Verwaltung als normaler Nutzer auf dem Terminal. Wollen wir ganz einfach einmal nach beliebiger Software suchen &#8211; etwa nach Spotify:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cargo search spotify<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/rust-1024x576.jpg\" alt=\"\" class=\"wp-image-811\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/rust-1024x576.jpg 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/rust-300x169.jpg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/rust-768x432.jpg 768w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/rust-1536x864.jpg 1536w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/rust.jpg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">M\u00f6chten Sie nun ein Paket installieren &#8211; im Beispiel &#8222;<strong>spotify-tui<\/strong>&#8220; funktioniert dies wieder ganz einfach:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cargo install spotify-tui<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/rust1-1024x576.jpg\" alt=\"\" class=\"wp-image-812\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/rust1-1024x576.jpg 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/rust1-300x169.jpg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/rust1-768x432.jpg 768w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/rust1-1536x864.jpg 1536w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/rust1.jpg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Nun gilt es abzuwarten, die Software l\u00e4dt die n\u00f6tigen Dateien herunter und kompiliert diese automatisch, weitere Eingriffe sind hier nicht n\u00f6tig.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Um ein Rust-Paket wieder zu deinstallieren nutzen Sie den Befehl:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cargo uninstall spotify-tui<\/code><\/pre>\n<div class=\"pld-like-dislike-wrap pld-custom\">\r\n    <div class=\"pld-like-wrap  pld-common-wrap\">\r\n    <a href=\"javascript:void(0)\" class=\"pld-like-trigger pld-like-dislike-trigger  \" title=\"Gef\u00e4llt mir\" data-post-id=\"810\" data-trigger-type=\"like\" data-restriction=\"cookie\" data-already-liked=\"0\">\r\n                            <img src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/12\/Daumen-Hoch.png\" alt=\"Gef\u00e4llt mir\" \/>\r\n            <\/a>\r\n    <span class=\"pld-like-count-wrap pld-count-wrap\">    <\/span>\r\n<\/div><div class=\"pld-dislike-wrap  pld-common-wrap\">\r\n    <a href=\"javascript:void(0)\" class=\"pld-dislike-trigger pld-like-dislike-trigger  \" title=\"Gef\u00e4llt mir nicht\" data-post-id=\"810\" data-trigger-type=\"dislike\" data-restriction=\"cookie\" data-already-liked=\"0\">\r\n                            <img src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/12\/Daumen-Runter.png\" alt=\"Gef\u00e4llt mir nicht\" \/>\r\n            <\/a>\r\n    <span class=\"pld-dislike-count-wrap pld-count-wrap\"><\/span>\r\n<\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>Immer mehr Software wird auch unter Linux in der Programmiersprache Rust geschrieben &#8211; f\u00fcr diese Programmiersprache gibt es \u00e4hnlich wie bei\u00a0Python\u00a0ein eigenes Repository. Mittels Cargo &#8211; dem Rust-Paket-Manager l\u00e4sst sich die Rust-Software verwalten. Welche Rust-Pakete es gibt, zeigt sich unter\u00a0Creates.io. Rust und Cargo installieren Unter auf Debian basierenden Linux-Distributionen installieren Sie diese Programmiersprache ganz einfach [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":812,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[64],"tags":[65],"class_list":["post-810","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software-verwalten","tag-software-verwalten"],"_links":{"self":[{"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/posts\/810","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/comments?post=810"}],"version-history":[{"count":1,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/posts\/810\/revisions"}],"predecessor-version":[{"id":813,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/posts\/810\/revisions\/813"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/media\/812"}],"wp:attachment":[{"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/media?parent=810"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/categories?post=810"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/tags?post=810"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}