Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I uncompress a *.7z file in Ubuntu and keep the directory structure?

share|improve this question
up vote 127 down vote accepted

First install the p7zip-full package:

sudo apt-get install p7zip-full

With this, Nautilus should have an option to uncompress 7-Zip Files.

I also recommend p7zip-rar so it also include the RAR files.

This is assuming you want to do it via GUI with Nautilus. If not, after downloading the packages above do the following:

7z x PACKAGE.7z that should eXtract the packages with full path.

share|improve this answer

There is also dtrx - which is immensely useful for un-archiving anything.

it stands for "Do The Right eXtraction" - and will uncompress anything without any fuss.


sudo apt-get install dtrx
dtrx archive.tar.XX


share|improve this answer
it currently supports [...] InstallShield files. very interesting. – LiveWireBT Feb 19 '15 at 11:20
You saved me, for some reason p7zip couldn't handle my files but dtrx worked like a charm. – aconkey Jul 1 '15 at 0:00
Mandatory cliche link: – Ciro Santilli 巴拿馬文件 六四事件 法轮功 Oct 7 '15 at 10:52

sudo apt-get install p7zip-full p7zip-rar in the terminal
Or search through the ubuntu software center as 7zip and unrar and install the packages

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.