I recently asked a question on Ask Ubuntu (or somewhere else), and a comment or answer asks me to paste the contents of some file or the output of a command to troubleshoot my problem.
How do I do that?
I recently asked a question on Ask Ubuntu (or somewhere else), and a comment or answer asks me to paste the contents of some file or the output of a command to troubleshoot my problem.
How do I do that?
You'll paste the file or command output to Ubuntu's "pastebin" service, and then allow others to look at it by simply sharing a link, or use it yourself to further copy and paste a few lines into your question.
Note: If your problem involves the Software Center, Update Manager or
apt-get
not working, you may have to use the Alternate Method near the bottom of this answer.
Press the Ctrl+Alt+T keys together (at the same time) to start the terminal. This will work for everyone using regular Ubuntu, but if you're using...
sudo apt-get install pastebinit
and press EnterWhen asked Do you want to continue?, type Y
and press Enter, and wait for the prompt (user@machine
) to return.
/etc/apt/sources.list
, while a command may simply be something like dmesg
or grep -i failed /var/log/auth.log
. The answer or comment will tell you explicitly if it's a file or a command.Now, for a file, type pastebinit
in the terminal, follow with a space; then right-click on the cursor and click on Paste to paste the filename you copied.
Press Enter, and after a few seconds you will see a link of the form http://paste.ubuntu.com/
as shown below. Move your mouse over it, and it will be underlined -- then right-click and click on Copy Link Address to copy it link to your clipboard:
But for a command, copy and paste the command in the terminal first, and then type
| pastebinit
after it, and press Enter (see screenshot below)
You can also paste the link into your browser's address bar, or click on the link after you've added/edited it to AskUbuntu, to view it on pastebin. It will look similar to this:
This may be useful if you are having a problem with Software Center, Update Manager or apt-get
and cannot install pastebinit; it only works for files, not commands.
Open a terminal as shown in Step 1 and type gedit
, followed by a space, and then right-click to paste the filename as in Step 3 and press Enter
leafpad
instead of gedit
; Kubuntu users type kate
The editor will open with the file:
Click anywhere inside the editor window, and press Ctrl+A. All the text should now be highlighted in another color:
Now press Ctrl+C (or the Copy button, if you know where that is) to copy the entire file to the clipboard.
Go to your browser, and open paste.ubuntu.com. Type your name/nickname in the Poster: box; then click in the Content: box and press Ctrl+V to paste the text you just copied from the editor in there:
Click on the Paste button, and in a few seconds you'll see the text you pasted:
Select the address shown in the address bar (highlighted orange above), copy it with Ctrl+C, and then go back to AskUbuntu and paste it in as explained in Step 4.