Fully uninstall X server I was playing around with the x server and LXDE in ubuntu server and installed it using the command sudo apt-get install xorg lubuntu-desktop. When I went to uninstall it, by using the command sudo apt-get remove xorg lubuntu-desktop --purge then sudo apt-get autoremove, I notice that the space freed up is less than the amount installed. Also, I still have some files and commands left over from X such as startx and lxde-session. How do I get rid of these?

The computer also boots up as lubuntu.

Test this:

Run it:

sudo -i
apt-get update
apt-get install --reinstall aptitude deborphan

aptitude remove '?and(?reverse-depends(lubuntu),?not(?reverse-depends(?exact-name(ubuntu))))'

apt-get dist-upgrade
deborphan
apt-get --purge remove $(deborphan)
deborphan --libdevel
apt-get --purge remove $(deborphan --libdevel)
deborphan --find-config
dpkg --purge $(deborphan --find-config)
apt-get autoremove
apt-get clean
reboot


How would one produce 8/16 bit music on Linux? So, I've been interested in making 16 bit (retro videogame style) music on Ubuntu for a while now but every time I look it up on Google, it's always showing me how to drop my regular every day music down to 16bits.

What you probably want is a tracker, to organize, create, and modify sounds. Here are some sources

I like milkytracker, which takes a little getting used to. its interface isn't what I would call intuitive, but it has some neat features, like being able to draw the sound you want to make.
There are numerous online tutorials as well.
https://www.youtube.com/watch?v=maip6QAAVRQ

Try installing Audacity.  It allows you to make projects with custom sample rates.  See http://audacity.sourceforge.net/about/features for the features.  I believe a sudo apt-get install audacity will work.


My 'USB flash' does not have write permission. I can't copy files into it via Nautilus? I have a USB cooldisk 8.0 GB. it was full of Windows viruses. I tried to delete them under Ubuntu 13.04, but it didn't allow me to delete anything!

I formatted it using 'Disks' to FAT filesystem and overwrite all data by zero. Again, I can't delete anything! I can't change permission of any file!

But, I can do anything by Terminal (CLI). I can create folder by mkdir. I can copy files by cp. etc. I ran sudo chmod 777 -R /media/me/USB/*, but the permission did not change:

I want do all this in Nautilus. It does not allow me to create folder, copy, change permissions in Nautilus (Files).

What's the problem?

It is not necessary to format the flash drive or to nuke the partition.
You can go to mount and then change the ownership of your flashdrive.
On ubuntu :

cd /media
sudo chown -R username drivename

Of course replace username by your username and drivename by the name of your flash drive.

Then you will be able to use nautilus as usual to copy/move/delete your files.

I had the same issue with only being able to write as root.  The only thing that worked for me was to use the Terminal (assuming that "sdb" is the name of your drive)

sudo umount /dev/sdb
sudo mkdosfs -F 32 -I /dev/sdb

Again this worked in my situation when all gui solutions were failing, even opening Nautilus as root and changing permissions.


MultiOS data-manager Does Ubuntu have any multi-platform application which can help manage and store information? I need a data organizer type of software which can create DB's that can I open on both Windows and Linux.

You should setup a server (NAS, Android Box, or even a Virtual Machine on your desktop) where you install a web based plattform to store your information. It depends on what kind of information you want to store but in any case i would recommend kind of networked appliance (VM) or Server if you want to access the information from different hosts / OS

VMware (or alternative)
I am not entirely sure what you are asking but the last line suggests you want to run windows and linux at the same time.

You will need something like VMware to run multiple operating systems at the same time on one machine.

I am not sure what you would want to create a database for to access and edit files between the two systems.

I would focus on the VMware first.


How to extract only 7 characters using grep I am using a regular expression with grep. I want to extract exactly 7 character passwords, but I am getting 7 and more than 7 characters as a result.
grep '[a-zA-Z0-9]\{7\}' /usr/share/wordlists/rockyou.txt

grep '[a-zA-Z0-9]\{7,7\}' /usr/share/wordlists/rockyou.txt

Use extended grep:

grep  -E '^[a-zA-Z0-9]{7}$' /usr/share/wordlists/rockyou.txt

or your own version like:

grep '^[a-zA-Z0-9]\{7\}$' /usr/share/wordlists/rockyou.txt

or even:

egrep '^.{7}$' /usr/share/wordlists/rockyou.txt

you can cd to the directory and try the below command:
grep ^.......$ *

. --> any single character (so seven . is seven characters)
* (asterisk) --> all the files in the current directory (except, usually, those whose names begin with a literal .). You can give the file name(s) too if preferred.


How to recover /boot overwritten by identical /boot? I spent 6 hours on this and I've given up. I am not finding a method to recovering a /boot partition that was overwritten by an identical /boot partition. This isn't your regular average grub installation problem. This is from hell.

I have 2 systems, A and B. These 2 systems are identical in every way except for UUID's and several files that are particular to the respective systems (e.g., fstab, crypttab, etc). B was a backup of A and both systems were able to boot successfully at one point.

Now B having its /boot overwritten %100 by A, B refuses to boot up and I've tried everything I could possibly come up with that should work (nothing works).

I've --bind mounted /dev/ /dev/pts/ /sys/ /proc/ to a chrooted environment and chrooted into it and updated-grub, purged grub, reinstalled grub, removed kernels, updated kernels, ran update-initramfs -k all -c with other options and other stuff in all sorts of orders, even from scratch. I've ran grub-update from the host using the --directory option and I've even resorted to boot-repair and I've literally done this perhaps a hundred times for 6 hours.

Nothing will get the system back up.

I know this has to be simpler and I'm just having the most terrible luck at figuring it out. What am I doing wrong? Both systems are encrypted using the whole disk encryption from installation.

update it appears at the point during boot where I should be prompted for a password to unlock / the system hangs and then drops to an initramfs prompt. I have no idea and there is no help on how to unlock a cryptsetup disk. I don't have cryptsetup in initramfs :/

I hope this helps anyone that may have come across the same situation. It turns out, after 8+ hours of trying to figure this out, I get some rest and come back and solve it in under 30 minutes. It turns out I was hot on the tail of the answer every time.

From the host system, when I mount the encrypted disk for a backup, I do the following

sudo cryptsetup luksOpen /dev/sdd5 kub # a sneaky kind of wrong

It turns out, the name "kub" screws up everything. What name should it be? Why did I always use kub? The name should be what the encrypted disk name is in /etc/crypttab. I always used "kub" because it always worked for what I needed but it turns out, not when using update-initramfs on a chrooted system and trying to update-grub on it. The correct name in my /etc/crypttab turned out to be sdc5_crypt so

sudo cryptsetup luksOpen /dev/sdd5 sdc5_crypt # wow, the answer

Then after unlocking the disk correctly and making the relevant mounts (/dev/ /sys/ /run/ /dev/pts/ /proc/) I ran the following

sudo update-initramfs -k all -c
sudo update-grub

And the system became bootable. Wow "kub" is like calling someone named Jack, Bobby and Jack never bothers to correct you so you think you're right but it turns out Jack hates you for it.


Missing firmware for amdgpu After sudo apt-get dist-ugprade I saw following output in my terminal:

Setting up linux-modules-extra-4.18.0-16-generic (4.18.0-16.17) ...
Setting up linux-image-generic (4.18.0.16.17) ...
Setting up linux-headers-generic (4.18.0.16.17) ...
Setting up linux-generic (4.18.0.16.17) ...
Processing triggers for linux-image-4.18.0-16-generic (4.18.0-16.17) ...
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-4.18.0-16-generic
W: Possible missing firmware /lib/firmware/amdgpu/vega12_gpu_info.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/vega20_asd.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/vega20_sos.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/vega12_asd.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/vega12_sos.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/vega20_rlc.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/vega20_mec2.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/vega20_mec.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/vega20_me.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/vega20_pfp.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/vega20_ce.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/vega12_rlc.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/vega12_mec2.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/vega12_mec.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/vega12_me.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/vega12_pfp.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/vega12_ce.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/vega20_sdma1.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/vega20_sdma.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/vega12_sdma1.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/vega12_sdma.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/vega20_uvd.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/vega12_uvd.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/vega20_vce.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/vega12_vce.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/vega20_smc.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/vega12_smc.bin for module amdgpu
I: The initramfs will attempt to resume from /dev/dm-2
I: (/dev/mapper/ubuntu--vg-swap_1)
I: Set the RESUME variable to override this.
/etc/kernel/postinst.d/zz-update-grub:
Sourcing file `/etc/default/grub'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.18.0-16-generic
Found initrd image: /boot/initrd.img-4.18.0-16-generic
Found linux image: /boot/vmlinuz-4.18.0-15-generic
Found initrd image: /boot/initrd.img-4.18.0-15-generic
Found linux image: /boot/vmlinuz-4.18.0-10-generic
Found initrd image: /boot/initrd.img-4.18.0-10-generic
Adding boot menu entry for EFI firmware configuration
done

Can someone tell me where to find and how to install the missing firmware?

My graphic card is RADEON RX VEGA M

You can find firmware at linux-firmware git

It looks like the missing firmware files are there.

You can clone git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git and copy the missing files to /lib/firmware/amdgpu.

Download files from this repository and place them in your computer


Bluetooth Dial-Up Networking using Blueman I want to configure a dial up network connection via bluetooth to my phone in order to access the internet.

I use Lubuntu 12.04 (Ubuntu with LXDE) which has the Network Manager Applet and Blueman applet installed. I guess these are the same tools than on an Ubuntu installation, hence I ask my question on this site.

My phone is a Sony Ericsson W810i, my laptop is a Lenovo S10-2, my mobile phone provider is o2 Germany.

I scanned for my mobile phone using the Blueman applet. I connected the dial-up network via the context menu -> Serial Ports -> Dial-up Networking. A notification bubble says that the connection is available on the interface named ppp0.

ipconfig is telling something different: There is no ppp0 or something similar. I only see my eth0 (wired ethernet), eth1 (wifi) and lo interfaces. Of course, I can't ping google.com as the interface really seems to be not present at all.

When the dial-up network is being connected, my mobile phone says that it connects to the internet. Afterwards, I see the active connection on the phone's screen. When successfully connecting with the phone using another computer, it behaves exactly the same, so I guess that the phone isn't the problem.

I don't know if I configured the Dial-Up correctly. I use the phone number *99# which is very common on most mobile ISPs. I use the APN which my ISP is telling me to use. (I can't find the number on their support page, so I just use the default value *99#.) My mobile ISP is o2 Germany.

There are How-Tos out there which use the Network Manager Applet to setup a bluetooth dial-up connection, but I can't see any bluetooth devices in the context menu as on the screenshots in those How-Tos.

Do you have any suggestions what might be wrong / what I should try?

EDIT:

When choosing "Network Access Point" in the device's context menu instead of Serial Ports -> Dial-Up Networking, an interface bnep0 appears. However, neither an IPv4 address is assigned for that interface (but IPv6), nor the phone connects to the internet. Am I missing something? Can I connect to the internet after setting up this network connection?

I just figured it out and described it on Linux Mint forum.
It requires compilation but I've described it step by step.

http://forums.linuxmint.com/viewtopic.php?f=53&t=128245&p=697752#p697752


trying to erase a DVD+RW in Ubuntu 11.10 I burned a video onto a DVD+RW Windows Vista several years ago. I now want to erase the DVD using Ubuntu 11.10 and install Ubuntu 12.4 Studio onto this disc. I tried to blank the disc, but it didn't work. And now I can't get Windows 7 to read it as well as Ubuntu 11.10. How do I erase this disc for reuse?

Unless the disc is specifically meant to be reused, burned data on DVDs tends to be more or less permanent. It's possible to burn new files onto it, but you'd really be better off just buying a new DVD for the task. You probably won't be able to effectively use that one as an Ubuntu LiveCD.

I use "brasero".  On the "Tools" menu, select "Blank ...".  A "Disc Blanking" dialog box will open.  Click on "Blank".

On some drives, you can use

sudo cdrecord dev=/dev/cdrom blank=fast

That does not work for my drive.


Poor sound quality from laptop's built-in speakers only on Ubuntu On Ubuntu (every version I tried since about ~2009 or 2008), the sound quality is noticeably different than on Windows XP, regardless of what program I use for playback (YouTube, listening to MP3s, Spotify, etc.)
The sound is clearly worse and less natural on Ubuntu: my laptop sounds somewhat like a tin can (for lack of a better way to describe it), and when the volume gets even moderately high, the laptop case starts to resonate (which is just awful, and never happens on Windows XP, not even at the highest volume).
Please note---this is not a subjective quality difference: the laptop case will resonate on Ubuntu as soon as the volume gets turned up to mid-level.  It does not on Windows even at maximum volume.
Some extra info about my setup
The computer is a Dell Inspiron 6000, with "SigmaTel C Major Audio" sound.  On Windows I'm using the default drivers from Dell, I didn't modify any settings, and I checked that no extra sound processing is enabled (e.g. 3D or bass boost or whatever that's available on some computers).   On Ubuntu 11.10 I'm also using the defaults.  There's no noticeable difference in the sound volume of Ubuntu and WinXP.
Questions

Why is there a difference in sound quality?
Doesn't the audio data that is sent by programs get "rendered" to speakers as-is?  Is there some extra processing, perhaps to compensate for the characteristics of the speakers or laptop case, akin to colour-management?

What can I do to fix this, and make Ubuntu sound as natural as Windows XP on my laptop?

The same thing happened to me when I was using Ubuntu for the first time. The reason for me was that Ubuntu had the volume of speakers set to a too high value. Solving this problem is very easy:

Using the sound indicator, open Sound Settings and set the sound volume slider at "unamplified", as shown in the image:

I hope this solves the problem.

[I'm also facing the external speaker sound quality problem. To solve this problem follow simple steps.

connect your wireless speaker .
go sound setting and select your wireless speaker.
and also important select MODE option show in the image.
and select Hight Fidelity Playback(A2DP Sink)

and enjoy good quality sound ..
thanks...]


Unable to boot to Windows 7 after installing Ubuntu on a separate drive I have searched everywhere on the internet and I cannot seem to find a solution to this problem. I have an Alienware Aurora and with it came Windows 7. Recently, I inserted an additional HDD and installed Ubuntu on it. Upon boot up, I do not have the option of booting to a specific OS. I checked and everything is still on the original drive. I even went into my BIOS and tried to switch the drive from which the computer booted, but there was no option for the original drive. I also tried using boot-repair to no avail. Thanks in advance for the help. I realize that similar questions have been asked on these forums but none of them seem to be any help to me.
Edit:
I meant to add that I tried removing the Ubuntu drive therefore forcing it to boot to Windows. When I did this, it started a GRUB command line which I am completely unfamiliar with.

You just need to add entry in Grub to boot windows.

So just edit /etc/grub.d/40_custom (using SUDO) and add the following lines to the bottom of the file:

menuentry ‘Windows 7′ {
set root=’(hd0,msdos2)’
chainloader +1
}

(hd0,msdos2) Refers to first HDD ( /dev/sda2 ).

After making changes into grub, you need to update grub.cfg by using below command.

sudo update-grub2

Now when you boot your system, you will get Option to boot Ubuntu or Windows.

that's also happen to me, maybe you can try to press F9 after you restart your computer. then there's a  different drives will pop up then choose what you want.


How do I scan for viruses with ClamAV? I installed ClamAV via Terminal (Ctrl+Alt+T) with:

sudo apt-get install clamav

but how can I scan for viruses?

Terminal

At first you have to update the virus definitions with:

sudo freshclam

Then you can scan for viruses.

clamscan OPTIONS File/Folder

If necessary start with root permissions: sudo clamscan.

Examples:

To check all files on the computer, displaying the name of each file:

clamscan -r /

To check all files on the computer, but only display infected files and ring a bell when found:

clamscan -r --bell -i /

To scan all files on the computer but only display infected files when found and have this run in the background:

clamscan -r -i / &

Note - Display background process's status by running the jobs command.
To check files in the all users home directories:

clamscan -r /home

To check files in the USER home directory and move infected files to another folder:

clamscan -r --move=/home/USER/VIRUS /home/USER

To check files in the USER home directory and remove infected files (WARNING: Files are gone.):

clamscan -r --remove /home/USER

To see more options:

clamscan --help

See:

Latest documentation: PDF | HTML
ClamAV official Wiki
Ubuntu Wiki

Graphical User Interface: ClamTK

ClamTk is a frontend for ClamAV. You can install it via Terminal with:

sudo apt-get install clamtk

You can get the latest version from Bitbucket as Debian package.

There is also a PPA (Outdated):

sudo apt-add-repository ppa:landronimirc/clamtk
sudo apt-get update && sudo apt-get install clamtk

Scan Menu: Here you can choose a file, folder or a device for scanning

View Menu:

Quarantine Menu:

Advanced Menu:

Help Menu: Here you can check for updates.

See:

ClamTk@Sourceforge
ClamTk Help
ClamTk FAQ

The accepted answer is a great answer, but every time I reach this page, it's a pain to find the command I want from the clutter of information. So just providing a concise answer to the question:
sudo apt-get install clamav; sudo freshclam

To scan all folders in your computer (except /sys):
clamscan -r -i --exclude-dir="^/sys" --bell /

To scan specific folders or files, you have to create a file in which you list out which files/folders you want to scan, and tell clamav where to find that file:
clamscan -r -i --bell --file-list=/home/nav/ClamScanTheseFolders.txt

My ClamScanTheseFolders.txt contained:
/media/nav/someFolder1
/media/nav/someFolder2
/opt/someFolder/somefile


No internet connection on Virtualbox (Windows 7 as guest, ubuntu 13.04 as host) Internet works perfectly on host (Ubuntu 13.04, 32 bit, fully updated) but cannot connect to internet on guest Windows 7 (under Virtualbox 4.2).
Have tried NAT and Bridge Network - none worked.
I had internet connection in the guest OS a couple of months ago, but I haven't tried the virtualbox since and now it's gone for some reason.
I would be grateful if someone could help me re-connect the windows OS back online (without the need to format my computer or to uninstall and re-install the guest OS).
Thanks!

I was having the same problem on Ubuntu 12.10 64bit using Virtualbox 4.2.22. Here are the steps I took to solve my problem:

Open Virtualbox Manager
Select the machine you cannot get internet on in the left pane
Click the Settings button in the top menu
Click Network in the left pane in the settings window
Switched to Bridged Adapter in the Attached to drop-down menu
Select the name of the network adapter you are currently using on your host machine. I am using wireless so I chose eth0 which is my wireless network adapter. You can check which adapter you are currently using by opening the terminal (CTRL+ALT+T by default) and running ifconfig. It will probably be the eth adapter that shows an inet addr and shows data transfer next to RX bytes.
Under Advanced, make sure the machine is using the Desktop Adapter Type
Under Advanced, make sure Promiscuous Mode is set to Allow All
Under Advanced, make sure Cable connected is checked on
Hit OK to save your changes
Start your VM

At that point you should be able to start a web browser in your VM and get a connection. This video provided the information I listed above, even though they are using a Windows 7 host with a Windows Server guest.
This is an image showing an example of the settings you need (taken from this answer).

I ended up finding that my issue was in regards to my Network Center. Ensure that the wifi you are connected to is sharing internet, with the VirtualBox wifi adapter. This configuration is under the adapter settings in Network and Sharing Center.


Hitting control button ejects DVD drive I have upgraded to Ubuntu 14.04. Everything is fine so far. But every time I press left control button, my DVD drive ejects. It does not happen with right control button. I have searched for answers but could not find anything. Any help is much appreciated.

Final answer: In system settings, reassign the short-cut for the eject to anything not containing Ctrl

I don't have this problem but I may help you at least with a few ideas. First, I have Ubuntu installed on an old Windows laptop and as you may know the SUPER key showed in keyboard shortcuts is Windows key on my laptop. Now you may have a problem that Ubuntu will see your left CTRL as a key combo or a special key,so try to connect a different keyboard to see of it still does that. If yes, the key mapping has been understood wrong by Ubuntu  and you will have to search and download a keyboard mapping program, but the preliminary test for this is to put up the (or a) on-screen keyboard and see if clicking the LCTRL will still open your CD-ROM. In the ABSOLUTE worst case re-install Ubuntu.
Now I just found out: go to system settings, under Text Entry and in the bottom right corner you should see keyboard settings. Check that out. If nothing indicates the use of LCTRL then do sudo apt-get install gnome-tweak-tool in terminal and from there you HAVE to find it. Thanks for reading!!


Upgrade directly from 14.04.3 to 15.04 I already have Ubuntu 14.04.3 and I want to go to 15.04. Do I need to fully install the new version or can I upgrade it from the existing version?

Ubuntu wasn't designed to do that. You can upgrade to 14.10 and then 15.04, but that is a time-consuming process and there are a lot of things that can go wrong. If I were you, I'd back up everything on your system and install 15.04 fresh. However, I'd recommend waiting for October 22 when 15.10 comes out. After all, I doubt you want to deal with upgrading to 15.10 after you just installed 15.04.

These instructions are actually impossible to go from 14.04.x to 15.04 because Canconical no longer supports 14.10, so you can't upgrade to that. These instructions will be kept in case in the next LTS, someone needs to upgrade to a non-LTS.

I searched around, and this looks like it would work.
Use your favorite editor, such as vim (or nano or vi or emacs, etc) to edit /etc/update-manager/release-upgrades (note you need to make sure you do this as root or use sudo to edit the file) and change this line:

prompt=lts to prompt=normal.
After doing this, reboot your computer and do sudo do-release-upgrade. You'll need to reboot your computer and sudo do-release-upgrade again.

There's also a way to do it for the GUI update manager, which is to open it and look around the settings until you find something mentioning LTS. It should be a dropdown box or radio switch or something like that with the options: "LTS" or "any new versions". At least, something along those lines. Again, you'd have to initiate the update again. I hope this helps you out! Make sure only to use one option, though.


Can install Rails on Ubuntu 14.04 with Ruby 2.1.3 I am using Ubuntu 14.04. I wanted to use the latest ruby (version 2.1.3), so I installed it with RVM.

rvm install ruby --latest
rvm use ruby --latest --default

But when I try to install Rails, i get the following error:

vagrant@vagrant-ubuntu-trusty-64:~$ sudo gem install rails
Building native extensions.  This could take a while...
ERROR:  Error installing rails:
    ERROR: Failed to build gem native extension.

        /usr/bin/ruby1.9.1 extconf.rb
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError)
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from extconf.rb:1:in `<main>'

Gem files will remain installed in /var/lib/gems/1.9.1/gems/json-1.8.1 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/json-1.8.1/ext/json/ext/generator/gem_make.out

What is wrong?

IIRC, mkmf is in the ruby-dev package:

rvm install 1.9.1-dev

Install manually with sudo apt-get install ruby1.9.1-dev (depending on your version).

I followed the steps no this blog. It was helpful.
http://ryanbigg.com/2014/10/ubuntu-ruby-ruby-install-chruby-and-you/

Lastly, you'll want to free up space by telling Rubygems not to install the documentation for each package locally, run:
echo "gem: --no-ri --no-rdoc" > ~/.gemrc


Triple boot Ubuntu, Windows and Mac problem I run on an intel core 2 duo late 2009 imac 21.5"

I have rEFIt installed which changes boot camp (efi or w.e) to show a triple os boot, mac, windows, and linux.

I want to install to my WD Elements 2TB external HDD but it never works, i've been through some techniques in the installation to get it to work.

So.. i install boot loader (grub) to sdb like i should, sdb has root, boot, and swap partitions (as well as free space).. dw boot has at least 258mb.

When i reach the end of the setup where it tells me to restart my computer i hit that, then it comes to a black screen showing logging information, closing processes and whatnot, then the mac ejects the installation disc and tells me to hit enter to restart.

EVERY FRICKEN TIME i do this (from installing) it freezes as SOON as i hit enter ;'(!
So i have to force-off my mac and reboot. I've tried rebooting with and without rEFIt cd but still (unless i hold alt (or option for you mac users) it goes to the rEFIt treiple boot screen, it shows linux so i click that, and it boots up windows instead.. WTF? Can someone please help, otherwise i'll be turned off linux or ubuntu :(

[EDIT:] Sorry for this being too long for some people, really, it's not that long ;)

i think your problem may lie in trying to triple boot using an external hard drive. you'll probably have more success triple booting using internal hard drives only as external disks can change directory when peripherals are added and removed.

so maybe try again using internal drives only? i gave the lifehacker article above a quick whirl in my snow leopard vm and had no issues with the procedure. an alternative would be to install ubuntu to your portable hard drive as a normal installation (complete with mbr and all partitions on the hdd) which is possibly a more complicated way , but seems less messy.

hopefully this helps you

Did you try this : http://lifehacker.com/5531037/how-to-triple+boot-your-mac-with-windows-and-linux-no-boot-camp-required


How to distribute windows over virtual desktops in Gnome I have a load of virtual desktops running and I usually have one full screen application per desktop (so sort of like the Ratpoison WM but with an option to use it in other ways when needed). I want new windows to automatically be put in certain desktop numbers when they start up. What's the easiest way to do this?

If you're using Compiz, install compizconfig-settings-manager, activate the "Place Windows" plugin, and in the "Fixed Window Placement" tab, you can adjust which windows should default to which viewport.

If your requirement can make use of scripts, then it might be worth investigating wmctrl eg wmctrl -s 0 would switch to desktop 0.


Touchpad stop working I have an HP 430 PC-Notebook using Oneiric. And sometimes my touchpad just stops working.(I haven't installed anything, just safe playing with terminal following linuxcommand.org

In Windows, I could two-finger touch to toggle locking the touchpad.

And as far as I know, Ubuntu doesn't have this function so I don't think that's the problem...

There seems to be a bug. I'm running ubuntu release 11.10 and this problem occurred regulary. I solved this issue by un-checking the setting to disable the touchpad while typing in the Mouse and Touchpad setting application.

Regards

this is a common problem, there are several options
Options

1.look up the mouse options in System settings

Install dconf-tools

Launch it
Search for: org.gnome.settings-daemon.plugins.touchpad
Check touchpad-enable

See here is a known bug and there on the responses of people there are different solutions, https://bugs.launchpad.net/ubuntu/+bug/80410

4.happens to me when I close session and open again, the touchpad works.

good luck


How do I change the close/maximise/minimise button sizes in 13.10? How could I change the button size for the window controls. I'm using a touch screen and I'm having difficulty hitting the right one. I've tried adjusting fonts but this does not help.

Any ideas folks?

For this one - I actually use gnome-tweak-tool for that one.

sudo apt-get install -y gnome-tweak-tool

This will enable you to customize almost everything to your preference.  There are another two apps that would give you more options.

unity-tweak-tool
ubuntu-tweak


Windows 8 won't boot via GRUB after installing Ubuntu with boot-repair I've just purchased a new Acer Aspire V3-771G laptop which came pre-installed with windows 8.

I shrunk the main windows partition and installed Ubuntu 12.10. I then had to run boot-repair to be able to boot to Ubuntu. Here's the pasted report.

This worked and I could now boot Ubuntu and it provided me with 3 other entries which should supposedly allow me to boot back to windows 8. However when trying these menu entries I get the following errors:

Windows UEFI bkpbootmgfw.efi

/EndEntire
file path: /ACPI(a0341d0,0)/PCI(2,1f)/UnknownMessaging(12)
/HD(2,c8800,96000,fe030bf1430a6047,9a,9a)/File(\EFI\Microsoft\Boot)
/File(bkpbootmgfw.efi)/EndEntire
error: cannot load image.

Windows Boot UEFI loader

/EndEntire
file path: /ACPI(a0341d0,0)/PCI(2,1f)/UnknownMessaging(12)
/HD(2,c8800,96000,fe030bf1430a6046,9a,9a)/File(\EFI\Boot)
/File(bkpbootx64.efi)/EndEntire
error: cannot load image.

EFI/OEM/Boot/bootmgfw.efi

/EndEntire
file path: /ACPI(a0341d0,0)/PCI(2,1f)/UnknownMessaging(12)
/HD(2,c8800,96000,fe030bf1430a6046,9a,9a)/File(\EFI\OEM\Boot)
/File(bootmgfw.efi)/EndEntire
error: cannot load image.

I have looked in the /boot/efi partition and the .efi files listed in grub are there but I always get this error.

I had this problem after installing Ubuntu 14.04 alongside windows 8.1 on my nice new lenovo thinkpad t540p laptop.

However, all I had to do was disable the secure boot option in the bios. Having done that, the grub menu allows me to boot either Ubuntu or Windows from the options.

I did not need to do anything else.

I had this problem. Just ignore all of this and go back to your bios boot menu. Put Windows on the top of the list. When you wan't to go back to Ubuntu, then put Ubuntu on the top of the list.


Further question on Intel graphics driver Ok, Josh answered almost immed.!  I need to know specifically, now that I am using Nvidia card effectively, do I need to allow update manager to update the intel gr. drivers?

I must add, I believe I know why Update Manager is telling me I need to update those Intel gr. drivers.  It probably happened because I tried to update my nvidia drivers and got a buggy install, which let to to a black screen.  I shut the system down manually after that and rebooted to a black screen and upon a further reboot I ascertained that I could still dual-boot(windows 7) into the other os.  Then I went through the restart process and at the grub2 menu chose other options and it was probably, at that time, that Linux was smart enough to know that nvidia drivers as installed weren't cutting it, and reverted to the onboard Intel graphics system...does that make sense?  Anyway, after successfully getting up and running, I reinstalled my old but successful nvidia drivers and all was well again, except now upon running Update Manager, I am offered the Intel graphics driver upgrade each time, which, up til now I have unchecked...my question is now more obvious.  Should I accept the Intel driver update and if I do, will it once again override my nvidia drivers?

You will not have to update the Intel Driver, unless you plan on using it again at some point... But the update manager may update it anyways.. if it does don't worry about it..

It shouldn't override your NVidia drivers...

You can blacklist the update though if you don't want to install it... Although I haven't done this in forever (hadn't needed to) but it might make for another good, but separate question...

Look ubuntu support the intel graphics.
if you using Nvidia card so you have to update your Nvidia driver.
Look up your top panel one of applet is named additional driver.
In here you can update your Nvidia driver.
you also find t from system--Administration--additional driver.


What is the correct driver to use for a Samsung CLP365W printer? I cannot get my new Samsung CLP365W printer to print via either wired (USB printer cable) or Wireless. Wireless printing works in 'doze Vista.

I have tried installing the drivers Ubuntu recommended for it from the driver database. When I did this and tried to print a test page, it said it was doing, the printer status said "Processing-Connected to Printer" and then changed back to "Idle" without printing anything out.

I have just carried out a version of the driver installing instructions from the Samsung Website and done something in the terminal about sudo ./install.sh, after moving the files into the home folder. Install got as far as the following error message:

./noarch/worker.sh: 310: ./noarch/worker.sh: Illegal number: 09
**** Install finished

What does that mean please?

I solved this problem by this way:

sudo su
(enter password)
./uninstall.sh
./install.sh

As I understood, any changes made by previous installation attempts, were disturbing to a new one.

try removing the usblp module with:

rmmod usblp

and then run

./install.sh


cd desktop to folder on desktop In terminal, I need to do cd desktop then cd data then ls data. Data is a folder that connects windows partition of the computer to ubuntu.

cd Desktop was initially giving me an error (bash: cd: no such file or directory). I instead typed cd ~/Desktop, which worked. However, I cannot use cd data and I get the same error as before. I even tried cd ~/data. It does not work. Any help would be immensely appreciated.

That's the difference between command line and GUI. The icon you see isn't actually there. Under Ubuntu, typically USB disks and partitions are automatically mounted at /media/username folder.

The GUI icon you see on the desktop is just a "shortcut" in a sense, but the actual folder to which the partition is mounted is elsewhere. When you open it in GUI file manager, and press Ctrl+L you should see the real path to the mountpoint.

As for the part where you need to ls Data please note two things:

File and directory names are case sensitive.
If you cd Data you're telling the shell to enter the Data directory that should be located relative to where your shell is right now, i.e. the current working directory.  Doing cd ~/Desktop works because you told it the full path, not relative. When you cd ~/Desktop; ls Desktop it won't work - there's no Desktop within ~/Desktop. If you just run ls with no arguments, then it will work, because it lists items in the current directory by default

If I understand you right, you are looking to access data folder on your desktop.

Try cd ~/desktop/data then ls to get the contents of this directory.

If you want to create a shortcut use ln -s <actual path>. It says create a shortcut (in linux terms softlink to the actual path) in the current location.


Application menu support for LibreOffice 3.4.1 I have installed LibreOffice 3.4.1.

On the website it say that it has global menu support. This doesn't work.

I have downloaded a newer version of the package lo-menubar which doesn't work either. I don't know if it is the newest version.

I've tried the LibreOffice v3.4.0 workaround but that also did not work.

Is it possible to get the Application menu working for LibreOffice 3.4?

The extension mentioned in the other posts only works for x86_64!

So if you have a 32bit Ubuntu, as I do, that won't work for you.

I found a way to make it work, tough. Certainly, it's not the most elegant way, since I have no idea how to create a Libreoffice extension from source.

You can download the modified extension for 32bit here: lo-menubar.oxt
Download it, open it, agree in Libreoffice to install it, restart Libreoffice.

I hope I didn't violate any licenses…

If you don't trust me or your just curious what I did, here is what I did:

Download the extension that was mentioned in the other answers:
 lo-menubar.oxt

Get the 32bit deb from the Ubuntu repositories. Open a terminal and enter:

apt-get download lo-menubar

If you didn't change the directory, a file called *lo-menubar_0.1.0-0ubuntu1_i386.deb* should be in your home folder.

Now open lo-menubar.oxt with the archive manager: Right click on the lo-menubar.oxt, open with archive manager (I hope it's called like that, I am using Ubuntu in German)

Now both files should be open, each in an archive manager window.

In lo-menubar.oxt:

Remove the Linux_x86_64 folder
Change into the folder META-INF
Extract manifest.xml (just drag it onto your desktop)
Right click on the extracted manifest.xml - open it with a text editor
Find *platform=Linux_x86_64"* and change it into *platform=Linux_x86"*
Find *Linux_x86_64/menubar.uno.so"* and change it into *Linux_x86/menubar.uno.so"*
Save the manifest.xml and close your text editor
Drag the manifest.xml back into the archive manager, which has lo-menubar.oxt opened, to overwrite that file
Go back to the root folder of lo-menubar.oxt, keep it open.

Open the lo-menubar_0.1.0-0ubuntu1_i386.deb with the archive manager:  Right click on lo-menubar_0.1.0-0ubuntu1_i386.deb, open with archive manager

Change into the folder: /usr/lib/libreoffice/share/extensions/menubar/
Drag the Linux_x86 folder into the lo-menubar.oxt

Close everything and open the lo-menubar.oxt. Restart Libreoffice.

Currently there's no way to integrate LibreOffice 3.4 into the Global Menu.


How can I change the default audio device from command line? Ubuntu's desktop gui is great for changing audio settings (System->Preferences->Sound), like the default input/output device and setting the volume.

However, I would like to be able to do these things from the command-line. What tool is the gui using behind the scenes?

You can control PulseAudio thoroughly through the command line using pacmd and pactl commands. For options see man pages or the wiki at PulseAudio:

pacmd list-sinks (or pactl list short sinks) for name or index number of possible sinks

pacmd set-default-sink "SINKNAME" to set the default output sink

pacmd set-default-source "SOURCENAME" to set the default input

pacmd set-sink-volume index volume

pacmd set-source-volume index volume for volume control (65536 = 100 %, 0 = mute; or a bit more intuitive 0x10000 = 100 %, 0x7500 = 75 %, 0x0 = 0 %)

and many many more CLI options.

Note: Changing the output sink through the command line interface can only take effect if stream target device reading is disabled. This can be done by editing the corresponding line in /etc/pulse/default.pa to:

load-module module-stream-restore restore_device=false

Restart PulseAudio for changes to take effect:

pulseaudio -k

For a more elaborate tutorial on how to do this, and for instructions on how to change the sink during playback see this answer.

I found these instructions to be clear and easy to follow. It explains how to set the default audio output device (speakers, etc), from the command line, as well as how to make your chosen setting the system default, so that it is set after the machine is rebooted.

Set the default output sink
To list the output sinks available, type the following command:
$ pacmd list-sinks | grep -e 'name:' -e 'index:'

index: 0
name: <alsa_output.pci-0000_04_01.0.analog-stereo>
index: 1
name:  <combined>

The * in front of the index indicates the current default output.
To set a system wide default, add the source name in the default.pa file:
/etc/pulse/default.pa
...
set-default-sink alsa_output.pci-0000_04_01.0.analog-stereo
...
When done then you can logout/login or restart PulseAudio manually for these changes to take effect.

from Set the default output sink


How can I record my screen? How can I record my screen on Ubuntu?

The app I'm looking for has ideally all of these features:

Can record in a format that can be played back easily on any platform and/or accepted by YouTube or another popular video site
Can record just a window (instead of the whole screen), possibly selecting it with a mouse click
Can start recording after a configurable delay (e.g., I launch the app and have time to do arrangements to my desktop/window before actual recording starts)

gtk-recordmydesktop

Adds an easy to use graphical icon on the GNOME toolbar to make a pleasure use and configure the audio and video capture and screencast application recordMyDesktop.

As mentioned at 20.04: Can't install gtk-recordmydesktop and on the package search, the package is not available on the main repository anymore, and sudo apt install gtk-recordmydesktop fails. I'm not sure why the http://apt.ubuntu.com/p/gtk-recordmydesktop link seems to work, maybe it installs an older version. But this indicates that the software is not being actively supported.
recordmydesktop
This is the non-GUI backend of recordmydesktop, and it is still available in 20.04:
sudo apt install recordmydesktop
recordmydesktop --on-the-fly-encoding

This will record until you stop the program on the terminal e.g. with Ctrl + C.
--on-the-fly-encoding encodes the output immediately; without it you need to wait for a possibly long time at the end for the encoding to be done. I haven't seen any significant downsides to that option yet, likely it will just take a bit more of CPU resources, but it is generally worth it.
It should be able to do everything that gtk-recordmydesktop does, but it is a bit harder to learn as you have to deal with the command lines.
You can set a stop recording shortcut e.g. with:
recordmydesktop --stop-shortcut=Control+s

You can select to record a single window as shown at: How can I get the value of Window ID?
recordmydesktop --windowid `xwininfo | grep 'id: 0x' | grep -Eo '0x[a-z0-9]+'`

This will allow you to first select the window with a mouse click, and it starts recording after you click.
How to record sound output with it: https://unix.stackexchange.com/questions/3490/how-can-i-record-the-sound-output-with-gtk-recordmydesktop
xvidcap (no longer maintained, package is no longer available)

A screen capture enabling you to capture videos off your X-Window desktop for illustration or documentation purposes. It is intended to be a standards-based alternative to tools like Lotus ScreenCam.
Video can be saved in MPEG or AVI files format.

Thanks for all of the great suggestions here. My recommendation for tools that will work great for recording audio, video and editing the screencast is Camtasia and Screenflow. If you're looking for more ideas on recording your screen and creating an engaging screencast then check out this post: http://www.mediacore.com/blog/how-to-record-your-screen-and-create-engaging-screencasts It includes tons of tools and tips on audio, video and editing your screencast


What version of Ubuntu 11.10 should I prefer? 64bit or 32bit? Possible Duplicate:
  What is the difference between 32-bit and 64-bit and which should I choose?

My notebook Configuration:

Model: Dell N4110
Processor: 2nd Generation Intel® Core™ i3-2310M processor 2.10 GHz
RAM: 4GB

As far as I know, some software do not support 64 bit OS. What about this?

Ubuntu 11.10 has multiarch support and you shouldn't really have a problem running into software that won't work under 64-bit. I'd recommend the 64-bit variety so you can get the most out of your hardware.

32 bit will do for,why there is need of 64 bit,How can you say that hardware is 64 bit compatible


How to mount filesystem automatically? I accidentally unmounted file system from ubuntu. So, when I open my laptop, every time I have to run below command in command screen to open gui.

mount -o remount, rw /

How can I mount file system permanently ?

Hit super and type "disks" to open gnome-disk-utility. On the left pane, select the disk/partition you want to mount at startup. On the right, click on the cog/gear icon, select "Edit Mount Options..." and check the "Mount at system startup" option.

Use the Disks tool.
Select the device on the right side, and then click on the gear icon. There is an option to edit the mounting options


How do I install Ubuntu alongside a pre-installed Windows with UEFI? I'm absolutely new to Linux. I would like to know how to install Ubuntu alongside the pre-installed Windows 8+ OS.

Should I do it with Wubi, or through the Live USB/DVD?

What steps do I need to take to correctly install Ubuntu?

If you are using Ubuntu 16.04+, many issues with compatibility are now solved. But still, depending on the version you are using and the hardware/model you have, you might need all or some of the steps provided in this answer.
If you are reading this in August 2017+, I can say that with Ubuntu 17.04 I have installed it on over 40+ Laptops with UEFI, ranging from Lenovo, Dell, HP, Sony, Acer and Toshiba where the models were 2016 and Up, and I have had no issues at all installing Ubuntu by simply following the steps in the installer. With the basic steps I mean:

Insert the Ubuntu USB Installer
Select Install Ubuntu (Install Ubuntu alongside Windows)
Select Wireless Card & Upgrade 3rd Party software while installing Ubuntu
Finish installation and see Ubuntu install without any issue with Windows or Ubuntu.

Now, this is not a 100% full proof verification. Am just mentioning that I am impressed by the fact that out of 43 total Laptops, 43 did not have any issues whatsoever on my end. Still, if you do have an issue, this is the reason why this guide was created.

Before explaining the steps to do it, I want to be clear that I have tried many ways of installing Ubuntu with versions older than 15.04 (Or any other distro for that matter) from within Windows 8 or Windows 10. No luck. Microsoft Windows really created a big mess for all Linux distributions. If you have a pre-installed Windows 8 system, you will probably never be able to install Ubuntu or any other OS in the normal (LiveCD/LiveUSB) or Wubi way. This is because Windows 8 introduced several new features, of which 2 are:

UEFI which substitutes what we have known as the BIOS (an alternative to)
Secure Boot which prevents anything but the installed operating system, in this case, Windows 8 from booting. This is no longer the case for Ubuntu since 12.04.2 so there is no need to disable secure boot.

On a further note I want to mention something about Secure Boot taken from the UEFI Wiki

SecureBoot

"Secure Boot" is a new UEFI feature that appeared in 2012, with Windows 8 preinstalled computers. Ubuntu supports this feature starting with 12.10 64 bit (see this article) and 12.04.2 64 bit, but as PCs implementing support for it have only become widespread at the end of 2012 it is not yet widely tested, so it's possible that you may encounter problems booting Ubuntu under Secure Boot.

IMPORTANT: If you do find a bug, please file a bug report against the shim package in Ubuntu, preferably using the command:

ubuntu-bug shim

once you've installed with Secure Boot disabled. As mentioned by slangasek:

  It is not required to disable SecureBoot in the firmware to install
  Ubuntu on a Windows 8 machine. Ubuntu 12.04.2 and 12.10 are
  SecureBoot-compatible. Any machine that ships with the recommended
  Microsoft Third-Party Marketplace keys in firmware will be able to
  boot Ubuntu under SecureBoot. If there is any problem file a launchpad
  bug for the shim package.

I also want to notify that I spend this week testing 15.04 and had an excellent outcome. Of 12 Laptops ( 4 Toshibas, 3 HP & 5 Lenovo) where Windows 8.1 was pre-installed, on all cases, Ubuntu detected the Windows Boot Manager correctly, gave the option to install alongside Windows 8.1 (It actually said Install alongside Windows Boot Manager) and solved any issues that appeared on previous Ubuntu versions. I basically did not have to do anything else on this cases. This was with Secure Boot on and on an EFI enabled boot system. I also. Tested 4 Windows 10 PCs and it worked perfectly with 15.10 & 16.04.

This does not mean that in your case it will work perfectly, it just means that on my cases, I had a 100% Ubuntu Perfect installation. Again, with 15.04 (Also on 15.10 and 16.04. On all cases it was 64-bit). I even had talks with users like Marius Nestor from Softpedia who actually had to disable Secure Boot in order for the installation to work, so it should be noted that, even if I currently have an excellent experience with Secure Boot, you might not. Keep this in mind when all else fails (We can thank Marius for his excellent contribution). I would in any case, send the bug report to the provided link above.

So with all of this said, installing Ubuntu via WUBI is not doable (not recommended at least from me), things like trying to boot for example with the Windows 8 bootloader are not possible right now unless something changes in the future (There are also some bugs related to this in launchpad, like the one mentioned by bcbc). Apart from this, WUBI does not work from within Windows 8 and up if you have UEFI with a GPT Partition (Not MS-DOS type partition). Pleas read Does UEFI support mean Wubi will now work on laptops shipped with Windows 8? for more information.

Not only that, but trying to install 32 bit Ubuntu is impossible. You need the 64 bit version for everything to work correctly. Read more about Wubi in Can I install Ubuntu inside Windows?

The following is a small guide to install Ubuntu with a Pre-Installed Windows 8 or 10 system. The steps HAVE TO BE done in the precise order I mention them here to get everything started. If a step is skipped or done before another, you will most likely end up with some of the problems mentioned at the bottom of this guide.

For the time, you need to do it via a LiveCD, LiveDVD or LiveUSB, assuming (actually requiring) you have the following points:

You are using a 64-bit version of at least Ubuntu 12.04.2. 32-bit versions will not work.
Your system came with Windows 8 or 10 pre-installed (And you do not want to delete it)
You are not installing Ubuntu inside of Windows 8 or 10 but rather alongside of it. Inside it is impossible because it needs Wubi which is unsupported.
Your system has UEFI activated (And cannot be disabled) with Secure Boot.
You have already created a free space for Ubuntu from within Windows 8 with at least 8 GB (I recommend to leave at least 20 GB or so, so you can test the hell out of it).
You made sure that you actually have free space left on the drive to create the needed partitions and you also made sure that you did not have all primary partitions used (In case of using an MS-DOS Scheme) because this will create a problem with the Ubuntu installer showing you only the "Replace Windows" option instead of the "Alongside Windows" option.
You know how to burn a LiveCD, LiveDVD or LiveUSB from within Windows 8. If not, look for Windows apps that can do that for you. I do mine in another PC with Ubuntu ^^.
Windows 8 was not shutdown in either Hibernation mode or any other mode ('fast start-up' which is by default on Windows 8) that leaves it on a saved state. Shutdown Windows 8 in the normal way, with the shutdown option. This will prevent other problems related to this from appearing. Read the bottom (TROUBLESHOOT) of this answer for more information regarding this point.
You are installing on an MS-DOS type disk scheme (You can only have 4 primary partitions as opposed to GPT Scheme) which has at least 1 Free Primary Partition (You can find out the type of scheme you have from here if operating on an Ubuntu Live CD or here if from Windows). Remember that if you are already using 4 Primary Partitions no partitions will appear on the Ubuntu installer since there are no more Primary partitions left to use (MS-DOS type partitions are limited to 4 Primary ones, GPT are limited to 128). This happens a lot on many laptops that come with 4 pre-created primary partitions. If you are installing on a GPT type partition and want it to boot, you need to leave UEFI enabled.

PLEASE READ THE ABOVE POINTS SINCE MANY USERS JUMP THIS PART AND WHEN THEIR PROBLEMS ARE FOUND IT NORMALLY IS BECAUSE THEY DID NOT FOLLOW ONE OF THEM.

Before we start we need to do the following:

Run compmgmt.msc on  Windows 8. From there on, create a partition with enough size. Note that I mention creating this FROM Windows 8 because I have had cases where doing the partition from the LiveUSB rendered Windows 8 unbootable, even after doing a boot repair. So to remove that problem or have a greater chance of removing it (Or simply skipping the problem altogether) and making sure both systems work, partition your hard drive from within Windows 8 first.

Now follow this steps to have a working Windows 8 + Ubuntu installed on your system:

Windows 8 + Ubuntu

We first need to know with what type of motherboard options we are dealing with. Open a terminal (By going to the start menu and typing PowerShell for example) and run the terminal as an Administrator (Right Click the app that will show in the start menu and select Run as Administrator). Now type Confirm-SecureBootUEFI. This can give you 3 results:

True - Means your system has a Secure boot and is Enabled

False - Means your system has a Secure boot and is Disabled

Cmdlet not supported on this platform - Means your system does not support Secure boot and most likely you do not need this guide. You can install Ubuntu by simply inserting the LiveCD or LiveUSB and doing the installation procedure without any problems.

If you have it Enabled and have the necessary partitioning done then we can proceed with this guide. After booting into Windows 8 we go to the power off options and while holding the SHIFT key, click on Restart.

(This is a really old trick on most Windows, even since Windows 3.1 where you hold a key to do something special when rebooting)

Windows 8 will show you a totally different restart window:

When you get the menu above, select Troubleshoot

You will then get the following options:

Select UEFI Firmware Settings

NOTE - In the Spanish version of Windows 8, the option for UEFI Firmware Settings is not available in several laptops, tested Lenovo, HP, and Acer. They do have an option to boot the computer and another custom menu will appear which lets you do a couple of things. In the case of Lenovo, you will not have an option to install Ubuntu with Windows 8, the only option is to remove Windows 8 completely. This only applies if you are not using 15.04+.

THIS IS AN IMPORTANT PART

The system will reboot and you will be allowed to go to the BIOS (If not press the appropriate key, some common are DEL,F2 or F10).

In this part, I can't help much since each BIOS is different for each Motherboard model. There are 2 options you can take here, both of which are optional since Ubuntu might install without any problems at all. You can either look for an option to disable Secure Boot or an option to disable UEFI. In some cases you will be able to find both, it will show in the BIOS as an option called Secure Boot or Enable UEFI.

If you find this options, then depending if you cannot install Ubuntu with Secure Boot enable then disable Secure Boot (Remember to report this as a bug using ubuntu-bug shim), to be able to still stay in UEFI mode and also be able to Boot with Ubuntu. In some motherboards, this will be the only option you actually need to change and also will be the only option you see related to UEFI because they will not offer the possibility to disable UEFI.

DUAL BOOT ISSUES

I would also like to mention an important note here. If you happen to install Ubuntu in Legacy Mode (No SecureBoot) you might have problems booting both, Windows and Ubuntu at the same time since they will both not appear on a Dual-Boot Menu. If you have Windows on UEFI for example and you install Ubuntu on Legacy Mode, you will only be able to boot to Ubuntu in Legacy Mode and Windows in UEFI Mode.

So before proceeding, make sure that you are installing Ubuntu with the same boot options as Windows. This way you will be able to choose which one to boot from in the same boot menu and not worry if one will work or not. From the Ubuntu UEFI Guide
you can see that there is a section that teaches you how to know if you actually installed Ubuntu in the same Boot setup as Windows (UEFI Mode):

An Ubuntu installed in EFI mode can be detected the following way:

    its /etc/fstab file contains an EFI partition (mount point: /boot/efi)
    it uses the grub-efi bootloader (not grub-pc)
    from the installed Ubuntu, open a terminal (Ctrl+Alt+T) then type the following command:

    [ -d /sys/firmware/efi ] && echo "Installed in EFI mode" || echo "Installed in Legacy mode"

So if you have ANY dual boot problems, this could be the problem. Please read the Ubuntu UEFI Guide since it covers various ways of solving Dual boot problems and converting Ubuntu to Legacy or EFI mode. I have already tested this with various Ask Ubuntu members that helped me apart from 2 Laptops I was provided with for the testing. This should then solve any Dual Boot problems related to Windows 8 + Ubuntu, but I again encourage anyone with problems (same or new) to file a bug report as mentioned above. The Ubuntu Developers are working very hard in providing an easy to install solution for all cases and this is one of the top priorities.

Continuing with the guide, in other motherboards that do offer the possibility to disable UEFI which would completely eliminate UEFI and Secure Boot on it and boot in the normal BIOS like way, if you find this is the way you want (To have a UEFI free computer and not face any of the problems related to this) then, by all means, do it. I for one have tested the Intel DZ68DB and did both case studies. Remember that doing so will make the Dual Boot process not work in almost all cases you will be left with a system that either Boot Windows in UEFI or Boots Ubuntu in Legacy.

With that in mind, remember to also select the Boot Order to make sure that it boots either your CDROM, DVDROM or USB Drive so you can boot from your Live Ubuntu image after rebooting.

Some points we should consider before continuing:

If Windows 8 was installed with UEFI enabled, it is highly recommended to stay in UEFI, although if you still want to disable it for specific reasons you can, GRUB will create the bootable part for Windows 8. But if you do disable UEFI and want to access Windows 8 afterward (before installing Ubuntu), it will not work since the boot part for Windows 8 needs UEFI (Again the Dual Boot problem).
If you only disable Secure Boot, there is no problem in some cases. You are only disabling the part that creates the most problem between Windows and Linux, which is the one that prevents Ubuntu from booting correctly. In either case, I encourage you to first try to install Ubuntu with UEFI/Secureboot, since in most cases it will work. if you disable any of them and install Ubuntu, you might not be able to boot to Windows 8 afterward through the GRUB Boot Menu.

Now before saving, some motherboards offer a Boot Mode option. Verify that this option is not pointing to UEFI Boot but instead to CSM Boot (Compatibility Support Module) which provides support for Legacy BIOS like systems.

Other systems offer a UEFI Boot option you can enable or disable. Depending on the options I mentioned above you can set this to the one you want.

And lastly, others offer a UEFI/Legacy Boot First option where you select which one you wish to use first. Obviously, the option is self-explanatory.

Now save the changes and reboot.

When the Ubuntu Live image starts, it will show rather different than the normal one we are all used to. Do not worry, this is because Ubuntu has an alternative boot option when a system has EFI installed. Just select everything like you are used to. I highly recommend reading the following article in the Ubuntu site regarding Ubuntu installations when using UEFI. If there is a problem, then try to create a small partition (About 250 MB of size) for the EFI part of the system. This is done in the installation part where it asks you if you want to install on the desired partition or used the Advanced Options. Select the advanced options if you come up with a problem.  In there, create a 250 MB partition for EFI and the rest for GRUB and other stuff you are accustomed to.

I think up to here you should be fine and have avoided several problems typically found when trying Ubuntu with Windows 8 which are:

Not booting a LiveCD/LiveDVD/LiveUSB/Wubi
Not installing Ubuntu because of security issues (Yeah right, more correctly monopoly issues)
Not booting either Windows 8 / 10 or Ubuntu (not showing either one of them)
Not letting Ubuntu create a partition
Not recognizing the EFI part of the system
Ubuntu not recognizing the Windows 8 / 10 Partition
Not seeing GRUB and booting directly to Windows
Windows 8 / 10 not booting or readable because or partition changes are done from Ubuntu

TROUBLESHOOTING

YOUR COMPUTER BOOTS DIRECTLY TO WINDOWS

This is a common problem and if you do not get a GRUB menu, re-installing or repairing grub will NOT HELP

Every BIOS/EFI system is different, it might look like one of the following pictures:

Notice the "UEFI Boot Option Priority" or "Boot Option Menu". Usually, Windows is the default and Ubuntu (or as in the second picture elementary OS) will be an option.

Once you select Ubuntu on the UEFI boot menu you will then get a grub menu. You should be able to boot either Ubuntu or Windows from the grub menu.

Another issue that could make the system boot directly to Windows (without even showing the GRUB menu) is if either Windows took hold of the boot manager or after installing Ubuntu, the EFI partition was not properly configured for Windows. To solve this, simply go to Windows and open a terminal, then type the following (Need Administrative Privileges):

bcdedit /set {bootmgr} path \EFI\ubuntu\shimx64.efi

This will configure the Windows Boot Manager to take into consideration the GRUB Boot Manager. This could still happen even after running the Boot Repair from within Ubuntu. So making sure that Windows reads the Ubuntu EFI partition, in case you are using an EFI boot system instead of the old BIOS will solve it. In the above command line, the difference between shimx64.efi and grubx64.efi is that shimx64 is the actual Microsoft signed binary that works with Secure Boot enabled while grubx64 is the normal grub binary (Not signed).

Windows 8.1 / 10 Not Recognized / Ubuntu not showing option to Install Alongside

If you have followed all the steps above including making a partition ahead of time through Windows 8.x, proceed with the normal Ubuntu installation. When you arrive at the option to how you would like to install it if you do not see the option to install Alongside it, select "Something Else" instead of wiping the hard drive. Configure the new partition layout on the empty space you've set aside that isn't Windows 8 / 10.

You need to create at least 1 partition for the root system (Which shows as the symbol "/") and set it to Ext4, another for SWAP (Virtual Memory). The SWAP space can be as small as 128MB if you have a lot of ram or as high as 4GB. With this 2 partitions created based on the empty space you provided you should be ready to proceed. And one last one for the EFI part which should be around 100MB.

When the installer asks where to put the bootloader, tell it to put it on the partition with the type "efi". This will install GRUB which will load once your system starts in the future which will give you the choice of going with Ubuntu (or whatever flavor is installed) or going to the Windows Boot Manager which will take you to Windows 8.

I would also recommend reading the following links to get additional information on some issues and causes in this particular part:

"Install alongside" option missing. How do I install Ubuntu beside Windows using "Something Else"?
How do I install Ubuntu alongside UEFI enabled Windows 8?
How to use manual partitioning during installation?

REPAIRING THE BOOT

After finishing the installation, if you happen to have Windows 8 disabled from booting and it only boots to Ubuntu, do not worry. In Ubuntu after it boots, install Boot-Repair in Ubuntu by opening a Terminal and typing the following:

sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo apt-get update
sudo apt-get install boot-repair
boot-repair

Boot Repair will mention that we have some GRUB error, that we have an EFI system and that Ubuntu rocks. Since Ubuntu rocks (It does not work if Ubuntu does not rock! ^^), just click on Apply so boot repair fixes everything. Now reboot and you should see Windows 8 and Ubuntu side by side.

For cases with rare booting problems, partitioning or using old hard drives on a newer motherboard, your solution might be checking out FixParts which solves misaligned partitions and other partitioned type problems.

If you are experiencing one of the following issues:

Loosing Data when copying from Ubuntu to Windows 8 after shutting down Windows 8
Can not access your Windows partitions from Ubuntu getting a Disk contains an unclean file system

This is most likely the cause of an option in Windows 8 called Fast Startup which behaves similar to hibernation and keeps a snapshot of the system so when you boot up, it will load faster. Since it keeps a snapshot, anything you copy or change in Windows 8 from Ubuntu after doing the fake shutdown will be lost (Apart from other issues found HERE).

The solution in Windows 8 is to go to:

Control Panel --> Power Options --> Choose what the power button does

In here click on "Change settings that are currently unavailable" where you should see something like this:

Uncheck the option that says "Turn on fast startup".
You also need to disable hibernation. You can do this with this command (you need to be in a console with admin rights):

powercfg.exe -h off

This should remove the hibernation file and enable partition to be mounted in Ubuntu.

A demonstration video is now available on this issue. We can install Ubuntu 12.04.2 (64 bit versions) onwards with SecureBoot enabled. But we need to disable the SecureBoot after the Boot Repair step.

With Ubuntu, you really can't go wrong with preparing a live install media by using unetbootin. With unetbootin you can use your Hard Disk or an external flash drive for the installation media.

1. installing on A Hard Disk

In the unetbootin window, choose Hard Disk from the drop down menu. Choose the Ubuntu ISO you want to install from and perform the rest of the steps needed to finalize the installation. The next time you boot up your system, you will see the unetbootin boot menu rather than booting into Windows.

2. installing on a USB flash drive

This is fairly straightforward but you can't use this method to install OSes to UEFI-GPT systems unless you install the OS to run in legacy mode. To install to systems that use the BIOS firmware standard, this is the best and most practical method. The variation from the method depicted above is that you have to choose USB Drive in the drop-down menu in the unetbootin window.


Problem with installing Ubuntu alongside Windows 7 I have my notebook with the preinstalled Windows 7. I've decided to try Ubuntu as well. Unfortunately I couldn't manage to install it. I was following the guide "How to dual-boot Windows 7 and Ubuntu 10.04.

After booting Ubuntu from the liveUSB and proceeding to the "Allocate drive space" dialogue box, I've discovered that the installed Windows 7 couldn't be identified and there is no item "Install Ubuntu alongside Windows 7".

In this situation I've chosen "Something else" item for manual partition allocation. But at the next dialogue box I couldn't find any of my 4 partitions. The only item which is visible is "/dev/sda/".

My question, what was wrong? And what should I do to overcome the stated issue?

P.S.: Initially there are was a problem with installation of Ubuntu due to the dynamic disk type. Using the EASEUS Partition Master I've revert it to basic disk type.

From what I see on your report it looks like you used WUBI to install your version of Ubuntu, but from the USB. There is a MBR Bootloader error on Sda7. This is where Ubuntu resides and Wubi is present. Because of this error your unable to boot into Windows.

WUBI stands for Windows Based Ubuntu Installer which is used to install Ubuntu literally within the Windows NTFS file system. In fact there is no partitioning involved as the Ubuntu OS resides within the Windows NTFS directory as a folder.

Somewhere along the lines WUBI didn't finish completing the Grub entry or something

You'll need to repair Windows first by popping in your Windows CD...then going to the Repair Windows selection. Then afterwards perform a chkdsk. This should correct the issue.

You can use the Wubi Method Of Installation for installing Ubuntu alongside Windows. It is just an easy method. In this method:

Open the downloaded ISO file.
Run Wubi.exe.
Select the relevant options on the Ubuntu Installer Window that open.
Select "Reboot Now" and Click Finish.

For more details visit this link.


How do I check which terminal I am using? I have Ubuntu on my machine and I am running awesome window manager on top of it. How do I check which terminal I am running? Is there a command for it?

TL;DR

to find currently running shell use ls -l /proc/$$/exe
to find currently running terminal, use xprop _NET_WM_PID WM_CLASS. The value of pid later can be passed to ps -p <pid> -o args command.
Technically, for terminal emulator you don't even need a command, as stated in the comments:

  what do you mean by which? Click Help --> About is that it? – JoKeR

Shell vs Terminal

First thing we need to have clarified is what exactly is being asked - find out the running shell or running terminal. Often these two terms are used interchangeably, but they are different things altogether. Shell is the command-line interpreter, specifically interactive shell is the prompt plus text field where you enter commands. Shells can also be non-interactive, for example a script starts non-interactive shell, or bash -c 'echo hello world' also starts non-interactive shell.

By contrast, terminal is the interface to shell ( though it could be another application as well). Originally terminal referred to actual hardware, but nowadays they're mostly software. What you see when you press Ctrl+Alt+t or click on the terminal icon in GUI, that starts a terminal emulator, a window which mimics behavior of hardware, and within that window you can see the shell running. Ctrl+Alt+F2 (or any of the 6 function keys) will open virtual console, aka tty. I recommend reading Why is a virtual terminal “virtual”, and what/why/where is the “real” terminal? for more info on the specifics.

Getting the shell information

Each user has a default shell assigned to them in /etc/passwd for their username. Assuming you are using default configuration and haven't called another shell explicitly as a command, it is sufficient to do:

echo $SHELL

But of course this only shows default value. Suppose we do the following:

user@ubuntu:~$ dash
$

We were originally in bash, but started interactive session of /bin/dash, Ubuntu's POSIX or system shell. The variable $SHELL won't change,  because that's not its purpose - it shows default not current value. We will need to approach this from another perspective - the perspective of a process, which is something I've covered in Am I using bash or sh?

$ echo $$
4824
$ cat /proc/4824/comm
mksh
$ bash
xieerqi@eagle:~$ echo $$
6197
xieerqi@eagle:~$ cat /proc/6197/comm
bash

Here we take advantage of /proc/ filesystem. The name of the process and command-line parameters are displayed in /proc/<pid>/comm. All we need is to provide shell's PID, which is what $$ does. In the example above I am adding that separately, but there is nothing stopping us from doing just

cat /proc/$$/comm

Variation on the theme could also be

ps -p $$ -o args

Another way we could approach this is via checking where /proc/<pid>/exe. This file is a symlink that points to the executable file. Thus we can do

user@ubuntu:~$ ls -l /proc/$$/exe
lrwxrwxrwx 1 adminx adminx 0 Apr  4 18:20 /proc/1241/exe -> /bin/bash
user@ubuntu:~$ sh
$ ls -l /proc/$$/exe
lrwxrwxrwx 1 adminx adminx 0 Apr  4 18:20 /proc/1255/exe -> /bin/dash

Either of the two approaches works in 99% of the cases. Of course, there are ways in which they can be subverted. For instance, symlink won't point anywhere if the executable was deleted shortly after the shell started ( and in that case you probably will encounter system issues, since removing /bin/sh, /bin/dash, or even /bin/bash is not recommended - after all a lot of scripts rely on them, especially system-level ones). Command name for shell is usually set as the very first argument in execve() syscall. This is covered in How does bash know how it is being invoked? , so if you have an application that launches a shell via execve(), it could give it any name. But these are non-standard and non-typical things, that should be avoided for the sake of consistency and security.

Getting Terminal Information

We can start with the environment variables. Many terminals seem to mask themselves as xterm-compatible, which is reported by echo $TERM or echo $COLORTERM. But then environment variables are not very reliable tool. They can be set and unset. We can do the same thing with PIDs again, except this time we will look at parent PID. As you may remember, terminal is the interface to the shell and often starts the shell itself. Therefore we can find out what process is the parent process of our shell:

$ ps -p $$ -o args,ppid
COMMAND                      PPID
bash                         1234
$ ps -p 1234 -o args
COMMAND
/usr/lib/gnome-terminal/gnome-terminal-server

Let's try with another terminal app, sakura:

$ ps -p $$ -o args,ppid
COMMAND                      PPID
/bin/bash                   16950
$ ps -p 16950 -o args
COMMAND
sakura

From there we can already see that what started this shell is gnome-terminal. This method of course works assuming you're working with interactive shell. If we're trying to find out the parent of bash -c '...' or the shell started via ssh, for example, PID may very well be from non-terminal application and maybe non-GUI at all.

So if we want to specifically deal with GUI terminal, what we can do is run xprop, click on the desired window, grep its pid, and find out what's the name of that process matching pid. Or in other words:

$ ps aux | grep $(xprop | awk -F'='  '/PID/ {print $2}')
xieerqi   2124  0.6  1.7 208068 34604 ?        Sl   18:47   1:49 gnome-terminal

Additionally, as per specifications , window managers should set WM_CLASS property. Thus, we can get that from xprop as well:

$ xprop WM_CLASS
WM_CLASS(STRING) = "sakura", "Sakura"

Of course, this also has its 1% of disadvantages: setting WM_CLASS properties relies on window manager doing that, and PID is not guaranteed for a window to be accurate ( see What process created this X11 window? ), which may involve complex debugging. And these aren't shortcomings of the methods themselves but of X11 server. However, most stable and well known window managers ( like openbox, Metacity, blackbox ) and most applications are well behaved so we shouldn't expect problems with something like Gnome Terminal or Terminator.

But when it comes to GUI terminal emulators, we don't even need to find a command. We can just use the About dialog of the window itself. Exception to that rule is xterm.

Simple answer.  Works for both console or ssh.

Example for simple character terminal:

ssh username@systemname
echo $TERM
dumb

tells you that you can't open GUI apps on that connection

Example for xterm  (also works with PuTTY/Xming on Windows)

ssh -Y username@systemname      -- omit this if using PuTTY --
echo $TERM
xterm

means that you can use GUI commands like opening the leafpad editor or nautilus file manager.

On the console it is the same:

Open terminal window
echo $TERM
xterm


Future Warning with gdebi while installing some packages I installed gdebi and then tried to install some .deb with it. The first time I tried installing them, it didn't, showing these:

/usr/bin/gdebi:113: FutureWarning: Possible nested set at position 1
  c = findall("[[(](\S+)/\S+[])]", msg)[0].lower()

Tried again, using gdebi and it installed, but the message still appeared after prompting me if I wanted to install.

Since it says it's a future warning, should I be worried?


apt-get package is not available but is referred to by another package - but cannot find that package When I try to install a package with apt-get install, I'll occasionally see a message of the form

Package somePackage is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package somePackage has no installation candidate

Does anyone know how to find out what package(s) it is actually referring to?

Note:

I looked at "But is referred to by another package." - Finding that package and it suggested using apt-cache search to find the package that refers to it. Yet if I do this for somePackage, I won't get any output.

For example, apt-cache search openoffice.org-hunspell returns no output, but apt-cache search gcc returns several packages.

Edit:

There are several different packages that have caused the first part of the problem for me in the past, but the apt-cache search not turning anything up has (so far) only happened for the openoffice.org-hunspell package.

I guess that what I want to know the most is this: when I see the error message "Package somePackage has no installation candidate," I'd like to have a sure-fire way to know

Was it replaced with another package (in which case knowing what the new package name is would be helpful); or
Was it just removed altogether; or
Is there some problem with /etc/apt/sources.list that means I can't get it.

I had this kind of errors when the universe repos were not enabled (it was a minimal server  install). Enabling them solved the issue (the package were provided by such repos). HTH.

Package somePackage is not available, but is referred to by another package.
  This may mean that the package is missing, has been obsoleted, or
  is only available from another source

It means that a package have dependency, suggestion or recommendation to "somePackage", but somePackage itself and any associated meta data is not available. You should look, by yourself, for the replacement of somePackage (if the package was in the official repositories, it's very likely that there's a empty package that points to the replacement), in case the package has been renamed, or forget about it, in case you are trying to get a package that was removed from the repositories for any motive. There's simply no way to do this programmatically.


Installing Ubuntu on MacBook Pro VirtualBox I try to install Ubuntu on my MacBook Pro using VirtualBox. However, there seems to be no guide on how to do this-—most are about installing on Windows PC using VirtualBox.

Would someone help direct me on how to do this? Thank you!

The procedure is pretty much identical to windows computers. You get the ISO for Ubuntu, and configure a new VM through the Virtualbox GUI how you like it. After configuration is complete, double click the VM to open, and choose your ISO file. Then, wait for it to boot up. After that, go through normal installation. When it asks you to restart, restart. When it asks you to remove install media and press enter, press enter. VirtualBox will automatically remove the install media for you.

I'm running 20.04 in VirtualBox 6.1.10 on MacOS 10.15.  Per other answers follow the wizard and it all just works.

download from https://releases.ubuntu.com/20.04/ubuntu-20.04-live-server-amd64.iso
follow wizard on MacOS to setup
alternatively example doing from command line using python as controller. This is pretty much host OS independent - just way paths are built would not work in PowerShell.  The default preseed config files on MacOS hence use of custom files with patching

def vbinstall(alog, config, buildkey):
    name = buildkey
    home = Path.home()
    download = f"{Path.cwd()}/downloads/{config['ubuntu'][buildkey]['dl'].split('/')[-1]}"
    vb = hm.vbhost(host=config["virtualbox"])
    cfg = f"{Path.cwd()}/bin/UnattendedTemplates/ubuntu_preseed.cfg"
    exit, out = vb.cmd("VBoxManage list vms")
    # alog.info(f"shared folder {config['sharedstorage']} -exists ")
    alog.info(f"shared folder [{config['sharedstorage']}] exists [{Path(config['sharedstorage']).is_dir()}]")
    for l in out:
        vms = l.split()[0].strip("\"")
        if vms == name:
            alog.info(f"Server exists {vms}.  Skipping setup....")
            return
    aux = f"{Path.cwd()}/bin/UnattendedTemplates/aux-{buildkey}"
    alog.info(f"aux {aux}")
    exit, out = vb.cmd(f"rm -rf {aux}")
    exit, out = vb.cmd(f"mkdir {aux}")
    with open(f"{Path.cwd()}/bin/UnattendedTemplates/autoinstall.yaml") as f: aconfig=yaml.safe_load(f)
    # aconfig["autoinstall"]["hostname"] = buildkey
    aconfig["autoinstall"]["identity"]["hostname"] = buildkey
    aconfig["autoinstall"]["identity"]["username"] = config['mcs']['user']
    aconfig["autoinstall"]["identity"]["password"] = config['mcs']['encrypted']
    # substitute @@user@@ in late commands
    aconfig["autoinstall"]["late-commands"] = \
        [re.sub("\@\@user\@\@", config['mcs']['user'], l) for l in aconfig["autoinstall"]["late-commands"]]
    with open(f"{aux}/autoinstall.yaml", "w") as f:
        f.write("#cloud-config\n")
        yaml.dump(aconfig, f)
    with open(f"{aux}/user-data", "w") as f:
        f.write("#cloud-config\n")
        yaml.dump(aconfig, f)
    exit, out = vb.cmd(f"touch {aux}/meta-data")

    # want to keep UUID of VM constant for remoteit and plex - if defined use it
    uuid = f'--uuid {config["ubuntu"][name]["uuid"]}' if "uuid" in config["ubuntu"][name].keys() else ""
    # allow for VM specific location of sharedfolder
    sharedstorage = config["ubuntu"][name]["sharedstorage"] if "sharedstorage" in config["ubuntu"][name].keys() else \
                            config["sharedstorage"]
    alog.info(f"uuid: [{uuid}] storage: [{sharedstorage}]")

    # VBoxManage createvm --name {name} --ostype \"Ubuntu_64\" --register --basefolder {home}/\"VirtualBox VMs\"/
    vbi =    f'''
VBoxManage createvm --name {name} --ostype \"Ubuntu_64\" --register --basefolder {home}/\"VirtualBox VMs\"/ {uuid}
#Set memory and network
VBoxManage modifyvm {name} --ioapic off
VBoxManage modifyvm {name} --memory 1024 --vram 128
VBoxManage modifyvm {name} --nic1 bridged
VBoxManage modifyvm {name} --bridgeadapter1 'en0: en0'
VBoxManage modifyvm {name} --graphicscontroller vmsvga
VBoxManage modifyvm {name} --audio none
#Create Disk and connect Debian Iso
VBoxManage createhd --filename {home}/\"VirtualBox VMs\"/{name}_DISK.vdi --size 15000 --format VDI
VBoxManage createhd --filename {sharedstorage}/{buildkey}-plex.vhd --size 50000 --format VHD
VBoxManage storagectl {name} --name "SATA Controller" --add sata --controller IntelAhci
VBoxManage storageattach {name} --storagectl "SATA Controller" --port 0 --device 0 --type hdd --medium  {home}/\"VirtualBox VMs\"/{name}_DISK.vdi
VBoxManage storageattach {name} --storagectl "SATA Controller" --port 1 --device 0 --type hdd --medium  {sharedstorage}/{buildkey}-plex.vhd

# shared storage
VBoxManage sharedfolder add {name} --name mcs --hostpath {sharedstorage} --automount
VBoxManage sharedfolder add {name} --name active --hostpath "{config['ubuntu'][name]['media']['active']}" --automount
VBoxManage sharedfolder add {name} --name archive --hostpath "{config['ubuntu'][name]['media']['archive']}" --automount

#Enable RDP
VBoxManage modifyvm {name} --vrde on
VBoxManage modifyvm {name} --vrdemulticon on --vrdeport 10001

# install
VBoxManage unattended install {name} --user={config['mcs']['user']} --password={config['mcs']['pwd']} \
    --auxiliary-base-path {aux}/ \
    --install-additions --iso={download} --country=SG  --post-install-template={cfg} --script-template={cfg}
    '''
    exit, out = vb.cmd(vbi, assertfail=False)
    for l in out: alog.info(f"{l}")
    alog.info(f"finished {name} initial setup")
    isolinux(aux, buildkey, config, alog)
    preseed(aux, buildkey, config, alog)
    exit, out = vb.cmd(f"VBoxManage startvm {name} #--type headless", assertfail=False)
    alog.info(f"vm start [{exit}] {out}")


Can I reformat a Windows PC hard drive and install the Ubuntu Operating System My daughter gave me her old PC, and I reformatted the hard drive with my own XP System Disk.  However, if I don’t activate the license, which I can’t, it will self-destruct within 30 days.

If I download the Ubuntu software, can I burn it on a CD and re-format the hard drive, and also install the Ubuntu operating system on the hard drive?
Will that  CD have accessory software applications included, e.g. a word processor, a spreadsheet, a video player, video editor, photo application, etc., as indicated on your website?
If I can't get Internet access on the Ubuntu PC would I be able to download some freebie applications such as Irfanview and OpenOffice on my other (Windows) PC, and transfer the download files to the Ubuntu machine, and install them?

If I download the Ubuntu software, can I burn it on a CD and re-format the hard drive, and also install the Ubuntu operating system on the hard drive?

Yes, Actually Ubuntu is more than a software, It is an Operating System.

  Will that CD have accessory software applications included, e.g. a word processor, a spreadsheet, a video player, video editor, photo application, etc., as indicated on your website?

Yes, it includes

Word processor = LibreOffice writer
Spreadsheet = LibreOffice Calc
Video player = Totem
Video editor = No (Earlier versions of Ubuntu had pitivi video editor, but 12.04 has none) You can of course download the video editor after installing Ubuntu

  If I can't get Internet access on the Ubuntu PC would I be able to download some freebie applications such as Irfanview and OpenOffice on my other (Windows) PC, and transfer the download files to the Ubuntu machine, and install them?

Not exactly, You may have assumed that, Windows programs and Ubuntu programs are similar. Actually it isn't. You can't expect Windows program to run on Ubuntu just like you run it in Windows. Such as Irfanview. But of course, Some of the Windows program can be run using WINE, but it is not like Ubuntu native programs.

See this Wikipedia article to know How Ubuntu differs from a Windows PC.

See this question to have an alternative to Irfanview: Ubuntu replacement for IrfanView

For OpenOffice, you have LibreOffice pre-installed which is very much compatible with Microsoft Office and OpenOffice.

Yes
Yes
Yes. Look into downloading a .deb file. A deb file is like a windows .exe file used for downloading programs. http://txt.binnyva.com/2009/03/download-deb-files-using-apt-get/ and then install with dpgk -i myfile.deb.


How can I shorten my command line (bash) prompt? Currently it is:

michael@Castle2012-Ubuntu-laptop01:~/Dropnot/webs/rails_v3/linker/spec/controllers$

Outside of renaming my machine and directory structure...

How could I make it be something more like:

michael:controllers$

To change it for the current terminal instance only
Just enter PS1='\u:\W\$ ' and press enter.

To change it "permanently"
In your ~/.bashrc, find the following section:

if [ "$color_prompt" = yes ]; then
    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi

Remove the @\h, and replace the \w with an uppercase \W, so that it becomes:

if [ "$color_prompt" = yes ]; then
    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u\[\033[00m\]:\[\033[01;34m\]\W\[\033[00m\]\$ '
else
    PS1='${debian_chroot:+($debian_chroot)}\u:\W\$ '
fi

Save, exit, close terminal and start another to see the result.

Tons more options!

See here for a more extensive howto, with many more options
See this answer for using up a tiny Python script to set the prompt so that the shortening only occurs when you are deep in a directory structure.

I wrote a function you can modify to suit your needs:

function termprompt() {
    PS1="${PS1//@\\h/}"     # Remove @host
    PS1="${PS1//\\w/\\W}"   # Change from full directory to last name
}

Place this function at or near the bottom of ~/.bashrc after the PS1 line has been fully computed.

You would type termprompt whenever you wanted to shorten your prompt or, have termprompt called from the bottom of your ~/.bashrc for permanency.

The advantage of this technique over many other answers is .bashrc can setup PS1 in four different ways (xterm+no-color, xterm+color, no-xterm+no-color, no-xterm+color). This answer supports all four current methods and probably future methods too.

Another advantage is this method has less complex control codes to traverse over in order to insert your changes.


How to copy & paste from Ubuntu VirtualBox guest to Windows host? I am running VirtualBox 4.1.4 on my Windows 7 laptop, running an Ubuntu 11.10 guest.

I would like to copy text from Ubuntu's terminal and paste it into a file on the Windows host. This doesn't work for some reason.

Any ideas?

Go to VirtualMachine's Settings->General->Advanced->Shared Clipboard (Bidirectional)

Reboot your virtual machine.

for me it solved the problem (it was set on Disabled), I had some machines working some not, so i checked settings in working ones they had bidirectional clipboard. Dont know if this was upgrade issue or... just double check your shared clipboard options.

Hope this helps someone.

VirtualBox V 4.1.20

For some reason I was not able to copy from my WindowsXP VM in VirtualBox to Ubuntu. However, I solved the problem by enabling a shared folder.

You can do that by going to Devices > Shared Folders > Shared Folder Settings in the alt menu on the VM window. After you set up a folder in the host, you can access it inside the VM in My Network Places: