{"id":45834,"date":"2024-03-18T17:21:52","date_gmt":"2024-03-18T17:21:52","guid":{"rendered":"https:\/\/ubuntuhandbook.org\/?p=45834"},"modified":"2024-03-18T17:21:52","modified_gmt":"2024-03-18T17:21:52","slug":"install-7zip-ubuntu","status":"publish","type":"post","link":"https:\/\/ubuntuhandbook.org\/index.php\/2024\/03\/install-7zip-ubuntu\/","title":{"rendered":"How to Install 7-Zip (Command &#038; GUI) in Ubuntu 22.04 &#038; 24.04"},"content":{"rendered":"<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/7zip-archive-icon.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-thumbnail wp-image-45835\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/7zip-archive-icon-250x250.webp\" alt=\"\" width=\"250\" height=\"250\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/7zip-archive-icon-250x250.webp 250w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/7zip-archive-icon-300x300.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/7zip-archive-icon-700x700.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/7zip-archive-icon-768x768.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/7zip-archive-icon.webp 1200w\" sizes=\"auto, (max-width: 250px) 100vw, 250px\" \/><\/a><\/p>\n<p>This simple tutorial shows how to install 7-Zip file archiver in Ubuntu Desktop.<\/p>\n<p>7-Zip is a popular free open-source file archiver with a high compression ratio. Ubuntu Linux can get it in few different packages:<\/p>\n<ul>\n<li><b>p7zip<\/b> &#8211; a command line port of 7-Zip for POSIX systems, including Linux, when 7-Zip was Windows-only. Discontinued since 2016, but still popular and working good.<\/li>\n<li><b>p7zip-desktop<\/b> &#8211; fork of p7zip with a graphical interface.<\/li>\n<li><b>7zip<\/b> &#8211; 7-Zip for Linux, command line version.<\/li>\n<\/ul>\n<p><b>NOTE: If you just want to do compress and\/or extract .7z files, then Ubuntu supports the feature out-of-the-box with the Nautilus file manager.<\/b><\/p>\n<h3>Option 1: p7zip-desktop (GUI)<\/h3>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/p7zip-desktop-appwindow.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-45839\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/p7zip-desktop-appwindow-700x509.webp\" alt=\"\" width=\"610\" height=\"444\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/p7zip-desktop-appwindow-700x509.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/p7zip-desktop-appwindow-300x218.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/p7zip-desktop-appwindow-768x558.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/p7zip-desktop-appwindow.webp 1299w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><br \/>\n<!--more--><\/p>\n<p>For beginners who prefer a graphical user interface, <code>p7zip-desktop<\/code> is the only choice as far as I know.<\/p>\n<p>It&#8217;s a fork of p7zip based on 7-Zip 16.02. <b>It&#8217;s old, discontinued, but still working good<\/b> in today&#8217;s Linux Desktop.<\/p>\n<p>As the screenshot above shows you, it has almost the same user interface to the Windows version. Just browse and select files and folders (<i>Ctrl+Click or Shift+Click to select multiple files\/folders<\/i>) then click &#8220;Add&#8221; button to add them to archive (or create new archive), or choose an archive and click &#8220;Extract&#8221; to decompress.<\/p>\n<p><b>To install p7zip-desktop<\/b>, either open Ubuntu Software (or App Center), then search &amp; install it as Snap package:<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/pzip-desktop.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-45836\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/pzip-desktop-700x420.webp\" alt=\"\" width=\"610\" height=\"366\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/pzip-desktop-700x420.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/pzip-desktop-300x180.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/pzip-desktop-768x461.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/pzip-desktop.webp 1066w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p>or, press <code>Ctrl+Alt+T<\/code> on keyboard to open terminal, and run command instead to install it:<\/p>\n<pre>snap install p7zip-desktop<\/pre>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/snap-p7zipdesktop.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-45840\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/snap-p7zipdesktop-700x203.webp\" alt=\"\" width=\"610\" height=\"177\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/snap-p7zipdesktop-700x203.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/snap-p7zipdesktop-300x87.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/snap-p7zipdesktop-768x223.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/snap-p7zipdesktop.webp 786w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p>Once installed, search for and launch it &#8216;p7zip-desktop&#8217; either from start menu or Gnome overview screen depends on your desktop environment.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/launch-p7zip-desktop.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-45841\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/launch-p7zip-desktop.webp\" alt=\"\" width=\"540\" height=\"281\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/launch-p7zip-desktop.webp 540w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/launch-p7zip-desktop-300x156.webp 300w\" sizes=\"auto, (max-width: 540px) 100vw, 540px\" \/><\/a><\/p>\n<h3>Option 2: 7zip .deb package (command line)<\/h3>\n<p><b>7-Zip adds native Linux support since version 21.0, which however is command line only!<\/b><\/p>\n<p>Ubuntu includes the 7zip package in system repository since Ubuntu 22.04. To install it, press <code>Ctrl+Alt+T<\/code> to open terminal and run command:<\/p>\n<pre>sudo apt install 7zip<\/pre>\n<p>For Ubuntu 23.10 &amp; 24.04, also install the RAR plugin via <code>sudo apt install 7zip-rar<\/code> command.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/apt-7zip.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-45842\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/apt-7zip-700x475.webp\" alt=\"\" width=\"610\" height=\"414\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/apt-7zip-700x475.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/apt-7zip-300x203.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/apt-7zip-768x521.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/apt-7zip.webp 786w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p>After installation, just run <code>7zz<\/code> command to print version and help. It&#8217;s a standalone console version of 7-Zip, compiled for dynamic system library linking.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/7zz-command.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-45843\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/7zz-command-700x427.webp\" alt=\"\" width=\"610\" height=\"372\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/7zz-command-700x427.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/7zz-command-300x183.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/7zz-command-768x469.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/7zz-command.webp 903w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p>The basic usage of 7zz command include:<\/p>\n<ul>\n<li>Add file\/directory to archive (or create a new one):\n<pre>7zz a archive_name.7z file_name<\/pre>\n<\/li>\n<li>Add file\/directory to archive, and set password with flag <code>-p<\/code> and hide structure of the archive with flag <code>-mhe=on<\/code>:\n<pre>7zz a archive_name.7z file_name -p -mhe=on<\/pre>\n<\/li>\n<li>List the content of an archive:\n<pre>7zz l archive_name.7z<\/pre>\n<\/li>\n<li>Extract all files from an archive to the current directory without using directory names:\n<pre>7zz e archive_name.7z<\/pre>\n<\/li>\n<\/ul>\n<h3>Option 3: 7zip official Linux package (command line)<\/h3>\n<p>As you see in the last screenshot, Ubuntu 22.04 includes 7zip version <code>21.07<\/code> in system repository, which is old!<\/p>\n<p>For the latest version, 7zip website provides the official package via the link below:<\/p>\n<div class=\"wp-block-buttons aligncenter\">\n<div class=\"wp-block-button is-style-fill\"><a class=\"wp-block-button__link has-vivid-cyan-blue-to-vivid-purple-gradient-background has-text-color has-background\" href=\"https:\/\/www.7-zip.org\/download.html\" target=\"_blank\" rel=\"noreferrer noopener\">Download 7-zip<\/a><\/div>\n<\/div>\n<p>If you don&#8217;t know your system type, either run <code>uname -m<\/code> or <code>dpkg --print-architecture<\/code> command in terminal (Ctrl+Alt+T) to tell.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/download-7zip.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-45844\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/download-7zip-700x445.webp\" alt=\"\" width=\"610\" height=\"388\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/download-7zip-700x445.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/download-7zip-300x191.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/download-7zip-768x488.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/download-7zip.webp 1243w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p>After downloaded the package, open your Downloads folder, extract the tarball, then right-click on extracted folder and click &#8220;<b>Open in Terminal<\/b>&#8220;.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/open7z-terminal.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-45845\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/open7z-terminal-700x436.webp\" alt=\"\" width=\"610\" height=\"380\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/open7z-terminal-700x436.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/open7z-terminal-300x187.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/open7z-terminal-768x479.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/open7z-terminal.webp 918w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p>In the pop-up terminal window, run <code>ls<\/code> command will list file content in current directory. To install the 7zz console version, just run commands:<\/p>\n<pre>sudo install 7zz \/usr\/local\/bin<\/pre>\n<pre>sudo install 7zzs \/usr\/local\/bin<\/pre>\n<p><i>Different to <code>7zz<\/code>, <code>7zzs<\/code> is the standalone console version of 7-Zip compiled with static system library linking.<\/i><\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/install-official-7zz.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-45848\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/install-official-7zz-700x317.webp\" alt=\"\" width=\"610\" height=\"276\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/install-official-7zz-700x317.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/install-official-7zz-300x136.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/install-official-7zz-768x348.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/install-official-7zz.webp 786w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p>When done, run either <code>7zz<\/code> or <code>7zzs<\/code> command to verify 7-Zip version and command options.<\/p>\n<h4>Option 4: p7zip<\/h4>\n<p>As mentioned above, p7zip is a fork of 7-Zip when it was Windows only. It&#8217;s discontinued since 2016, but still available in Ubuntu repository just for choice!<\/p>\n<p>To install p7zip, open terminal (Ctrl+Alt+T) and run command:<\/p>\n<pre>sudo apt install p7zip-full --install-suggests<\/pre>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/apt-p7zipfull.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-45846\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/apt-p7zipfull.webp\" alt=\"\" width=\"687\" height=\"354\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/apt-p7zipfull.webp 687w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/apt-p7zipfull-300x155.webp 300w\" sizes=\"auto, (max-width: 687px) 100vw, 687px\" \/><\/a><\/p>\n<p>After installation, you got 3 command tools. Run either command to tell version and command options.<\/p>\n<ul>\n<li><b>7z<\/b> uses plugins to handle archives.<\/li>\n<li><b>7za<\/b> is a stand-alone executable that handles fewer archive formats than <code>7z<\/code>.<\/li>\n<li><b>7zr<\/b> light-version of <code>7za<\/code> that only handles 7z archives.<\/li>\n<\/ul>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/7z-command.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-45847\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/7z-command-700x475.webp\" alt=\"\" width=\"610\" height=\"414\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/7z-command-700x475.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/7z-command-300x203.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/7z-command-768x521.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/03\/7z-command.webp 786w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<h3>Uninstall 7-Zip<\/h3>\n<p>Depends on which version you installed, uninstall the graphical tool <code>p7zip-desktop<\/code> either via Ubuntu Software (App Center) or by running command in terminal:<\/p>\n<pre>snap remove p7zip-deesktop<\/pre>\n<p>To remove p7zip and 7zip package installed from system repository, use command:<\/p>\n<pre>sudo apt remove --autoremove p7zip-full 7zip<\/pre>\n<p>And, to uninstall the package downloaded from 7zip website, use command:<\/p>\n<pre>sudo rm \/usr\/local\/bin\/7zz \/usr\/local\/bin\/7zzs<\/pre>","protected":false},"excerpt":{"rendered":"<p>This simple tutorial shows how to install 7-Zip file archiver in Ubuntu Desktop. 7-Zip is a popular free open-source file archiver with a high compression ratio. Ubuntu Linux can get it in few different packages: p7zip &#8211; a command line port of 7-Zip for POSIX systems, including Linux, when 7-Zip was Windows-only. Discontinued since 2016, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":45835,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[1596],"class_list":["post-45834","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howtos","tag-p7zip"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/45834","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/comments?post=45834"}],"version-history":[{"count":0,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/45834\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media\/45835"}],"wp:attachment":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media?parent=45834"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/categories?post=45834"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/tags?post=45834"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}