开发者

Ubuntu's file-roller problem 5010. "Cannot open display"

I use "file-roller" to manage with archieves on my Ubuntu. But it fails on running without user interface(just teminal). The error is shown below.

开发者_开发问答
** (file-roller:5453): CRITICAL **: Failed to parse arguments: Cannot open display: 

How can I prevent file-roller from using GUI or can you recommend me any other archieve manager I can use from terminal. It would be perfect, if this manager can handle as much formats as it is possible.


p7zip, unrar, gzip, tar and bzip2 are some popular archivers. For example, to compress a folder into gzipped tar, use the command:

tar cvpzf FILENAME DIRECTORIES...


If you put this in your ~/.bashrc :

# Thanks to rezza at Arch Linux 
op () {
     if [ -f $1 ] ; then
        case $1 in
                *.tar.bz2)   tar xvjf $1 ;;
                *.tar.gz)    tar xvzf $1 ;;
                *.bz2)       bunzip2 $1 ;;
                *.rar)       unrar x $1 ;;
                *.gz)        gunzip $1 ;;
                *.tar)       tar xvf $1 ;;
                *.tbz2)      tar xvjf $1 ;;
                *.tgz)       tar xvzf $1 ;;
                *.zip)       unzip $1 ;;
                *.Z)         uncompress $1 ;;
                *.7z)        7z x $1 ;;
                *)           xdg-open $1 ;;
        esac
     else
        echo "'$1' is not a valid file"
     fi
}

then you can open most archive files from the command-line with

op archivefile

If this does not work, then run

file archivefile

and post the output. We may be able to then tell you the right command for that kind of file.

PS. You may have to close the terminal and open a new one to make the change to ~/.bashrc effective.


Have a look at Midnight Commander (mc)


You must be running under root because root doesn't have a gnome configuration by default. If you need to run it as root, file-roller can take other arguments available with other gnome commands. See gtk-options. To bypass this particular error, you can run file-roller like this:

file-roller --display=:0

It will still give you an error about the configuration but it's not critical and won't stop you from using file-roller as root.

OR

Stay logged in as the normal user and just sudo.

sudo file-roller filename
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜