Results 1 to 6 of 6

Thread: How to extract a tar.bz2 file to /opt?

  1. #1
    Join Date
    Jan 2013
    Beans
    48

    How to extract a tar.bz2 file to /opt?

    Hi,
    I have a tarball file who has the file name extension tar.bz2. I can extract it to my user folder. But I see its usage said that it is under /opt folder. I have tried extract it with

    sudo bzip2 -cd ~/Downloads/gcc-linaro-4.7-2013.12.tar.bz2 | tar xvf -

    but it still cannot create folder under /opt

    I am new to Linux. It reminds me to login as a root user? but I am not clear what does that really mean.

    Could you help me on that?

    Thanks,

  2. #2
    Join Date
    Apr 2011
    Location
    Mystletainn Kick!
    Beans
    4,326
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: How to extract a tar.bz2 file to /opt?

    I think
    Code:
    sudo tar xvjf the-file.bz2 -C /opt
    should work.

    Edit: I think changing directory first helps.
    Then I can use the TAB completion to more easily complete the file name.
    Last edited by deadflowr; January 10th, 2014 at 03:21 AM.
    Splat Double Splat Triple Splat
    Earn Your Keep
    Don't mind me, I'm only passing through.
    Once in a blue moon, I'm actually helpful
    .

  3. #3
    Join Date
    Dec 2013
    Location
    Michigan, US
    Beans
    49
    Distro
    Ubuntu 13.10 Saucy Salamander

    Re: How to extract a tar.bz2 file to /opt?

    Code:
    sudo su -
    cd /opt
    bzip ~/Downloads/gcc-linaro-4.7-2013.12.tar.bz2 |tar xvf -
    Also be aware you will now be executing commands as root. Beware!!
    Last edited by devine.steve; January 10th, 2014 at 03:34 AM.

  4. #4
    Join Date
    Apr 2012
    Beans
    5,387

    Re: How to extract a tar.bz2 file to /opt?

    What do you mean exactly by "its usage said that it is under /opt folder"? deadflower's suggestion will do what you asked, but personally I'm not a fan of unpacking source tarballs as root - it means you need to be root (i.e. use sudo) to configure and build as well. IMHO it keeps things simpler if you unpack in your user area, then configure / build as yourself and FINALLY when you have a successful build (which may take a few tries, unless you have a very complete list of dependencies ahead of time) do a 'sudo make install' (or even better, use checkinstall).

  5. #5
    Join Date
    Apr 2011
    Location
    Mystletainn Kick!
    Beans
    4,326
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: How to extract a tar.bz2 file to /opt?

    Quote Originally Posted by steeldriver View Post
    What do you mean exactly by "its usage said that it is under /opt folder"? deadflower's suggestion will do what you asked, but personally I'm not a fan of unpacking source tarballs as root - it means you need to be root (i.e. use sudo) to configure and build as well. IMHO it keeps things simpler if you unpack in your user area, then configure / build as yourself and FINALLY when you have a successful build (which may take a few tries, unless you have a very complete list of dependencies ahead of time) do a 'sudo make install' (or even better, use checkinstall).
    Aye.
    This would be far better in the scheme of things.
    I'd add that you could simply make a directory to work in.
    Something like
    Code:
    mkdir test_build
    which you could then work in on the build.
    you'd run the tar command, but remove the sudo designation and change the directory output to ~/test_build.
    Then play to your hearts content.
    Splat Double Splat Triple Splat
    Earn Your Keep
    Don't mind me, I'm only passing through.
    Once in a blue moon, I'm actually helpful
    .

  6. #6
    Join Date
    Jul 2007
    Location
    Magic City of the Plains
    Beans
    Hidden!
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: How to extract a tar.bz2 file to /opt?

    According to their web page you should be able to find what you need in the repositories:
    Code:
    sudo apt-get install gcc-arm-linux-gnueabi

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •