<div><br></div><div>Well from the instruction of <a href="https://wiki.ubuntu.com/Core" target="_blank">https://wiki.ubuntu.com/Core</a> i thought sudo packages already installed and i thought i am doing something wrong, may be instruction on above link should be updated to mention this for new guys like me, that sudo packages should be installed explicitly to make it work?</div>
<div><br></div><div>Secondly now I tried to install pakcages in Ubuntu Core, i idid something like below</div><div><br></div><div>host# chroot <span style="background-color:rgb(255,255,255);color:rgb(51,51,51);font-size:13px;line-height:19px">/mnt/root</span><br>
chroot# dpkg -i /tmp/*.deb<br>chroot# apt-get update<br></div><div><br></div><div>sudo apt-get update Command fails with below errors, kindly suggest how to get rid of them...i was just thinking if to get rid of below errors i need to modify some file how would i do it as by default no editor is installed like vi or other?</div>
<div><br></div><div>Err <a href="http://archive.ubuntu.com">http://archive.ubuntu.com</a> precise InRelease</div><div><br></div><div>Err <a href="http://archive.ubuntu.com">http://archive.ubuntu.com</a> precise-updates InRelease</div>
<div><br></div><div>Err <a href="http://archive.ubuntu.com">http://archive.ubuntu.com</a> precise-security InRelease</div><div><br></div><div>Err <a href="http://archive.ubuntu.com">http://archive.ubuntu.com</a> precise Release.gpg</div>
<div> Temporary failure resolving '<a href="http://archive.ubuntu.com">archive.ubuntu.com</a>'</div><div>Err <a href="http://archive.ubuntu.com">http://archive.ubuntu.com</a> precise-updates Release.gpg</div><div>
Temporary failure resolving '<a href="http://archive.ubuntu.com">archive.ubuntu.com</a>'</div><div>Err <a href="http://archive.ubuntu.com">http://archive.ubuntu.com</a> precise Release.gpg</div><div> Temporary failure resolving '<a href="http://archive.ubuntu.com">archive.ubuntu.com</a>'</div>
<div> </div><div>Reading package lists... Done</div><div>W: Failed to fetch <a href="http://archive.ubuntu.com/ubuntu/dists/precise/InRelease">http://archive.ubuntu.com/ubuntu/dists/precise/InRelease</a></div><div>W: Failed to fetch <a href="http://archive.ubuntu.com/ubuntu/dists/precise-updates/InRelease">http://archive.ubuntu.com/ubuntu/dists/precise-updates/InRelease</a></div>
<div>W: Failed to fetch <a href="http://archive.ubuntu.com/ubuntu/dists/precise-security/InRelease">http://archive.ubuntu.com/ubuntu/dists/precise-security/InRelease</a></div><div><br></div><div>W: Failed to fetch <a href="http://archive.ubuntu.com/ubuntu/dists/precise/Release.gpg">http://archive.ubuntu.com/ubuntu/dists/precise/Release.gpg</a> Temporary failure resolving '<a href="http://archive.ubuntu.com">archive.ubuntu.com</a>'</div>
<div><br></div><div>W: Failed to fetch <a href="http://archive.ubuntu.com/ubuntu/dists/precise-updates/Release.gpg">http://archive.ubuntu.com/ubuntu/dists/precise-updates/Release.gpg</a> Temporary failure resolving '<a href="http://archive.ubuntu.com">archive.ubuntu.com</a>'</div>
<div><br></div><div>W: Failed to fetch <a href="http://archive.ubuntu.com/ubuntu/dists/precise-security/Release.gpg">http://archive.ubuntu.com/ubuntu/dists/precise-security/Release.gpg</a> Temporary failure resolving '<a href="http://archive.ubuntu.com">archive.ubuntu.com</a>'</div>
<div><br></div><div>W: Some index files failed to download. They have been ignored, or old ones used instead.</div><br><div class="gmail_quote">On Wed, Dec 5, 2012 at 1:00 PM, Kieran Grant <span dir="ltr"><<a href="mailto:kieran.thehacker.grant@gmail.com" target="_blank">kieran.thehacker.grant@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On 05/12/12 17:01, David Henningsson wrote:<br>
> On 12/04/2012 03:14 PM, Emmet Hikory wrote:<br>
>> Saqlain Abbas wrote:<br>
>>> I have installed Ubuntu core on VM i followed instruction from<br>
>>><br>
>>> <a href="https://wiki.ubuntu.com/Core" target="_blank">https://wiki.ubuntu.com/Core</a><br>
>>><br>
>>> I am able to boot and login, but if try apt-get install I get below<br>
>>> errors,<br>
>>> my system (virgin ubuntu core) got no packages installed like synaptic<br>
>>> package manager etc<br>
>>><br>
>>> "could not open lock file /var/lib/dpkg/lock -open (13:permission<br>
>>> denied)<br>
>>> unable to lock the administration directory (/var/lib/dpkg) , are<br>
>>> you root?"<br>
>>><br>
>>> I can't try using "sudo" command as it is not installed on (ubuntu<br>
>>> core).<br>
>><br>
>> If you wish to run apt-get, you will either need to grant a root<br>
>> password,<br>
>> and use su, or mount the filesystem on some other machine, chroot<br>
>> into it, and<br>
>> install sudo from the chroot.<br>
>><br>
>>> [T]he user i created "ubuntu" I added it to adm and sudo groups,<br>
>>> "groups" command shows it is added to "ubuntu" "adm" and "sudo"<br>
>>> groups. My<br>
>>> other part of question is as user is added to sudo group why i got no<br>
>>> "root" permission?<br>
>><br>
>> Because the sudo package is not installed, so there is no<br>
>> interpretation<br>
>> of the sudo group meaning anything. While the adm group does grant<br>
>> the ability<br>
>> to access many files, it does not provide for any sort of root access.<br>
>><br>
><br>
> The instructions at <a href="https://wiki.ubuntu.com/Core" target="_blank">https://wiki.ubuntu.com/Core</a> clearly says to add<br>
> the local user to the sudo group. This makes no sense if the sudo<br>
> package is not part of Ubuntu Core, so either the instructions are<br>
> broken, or Ubuntu Core is broken because it should have included the<br>
> sudo package?<br>
><br>
</div></div>The answers provided are correct, but you need to add sudo package manually.<br>
<br>
Download ubuntu-core, as directed, and if you want to use it in an<br>
image, say for example a VM (this is pretty much what I do):<br>
Pre-download or pre-build Linux Kernel Debs (Download is easier)<br>
host$ dd if=/dev/zero bs=1 seek=size-in-bytes count=1 of=./image<br>
host$ su<br>
host# mkdir mnt<br>
host# mkfs.ext{2,3,4} -f ./image<br>
host# mount ./image mnt<br>
host# cd mnt<br>
host# tar -xvnf ../ubuntu-core-{version}-core-{arch}.tar.gz<br>
host# cd ..<br>
host# cp /path/to/kernel/debs mnt/var/cache/apt/archives<br>
host# chroot mnt<br>
chroot# dpkg -i /var/cache/apt/archives/*.deb<br>
chroot# apt-get update && apt-get upgrade<br>
chroot# apt-get install net-tools sudo vim{/other editor of choice}<br>
{aptitude/other package manager if you want} {and anything else you feel<br>
you need}<br>
chroot# apt-get clean<br>
chroot# adduser username<br>
chroot# addgroup username adm<br>
chroot# addgroup username sudo<br>
chroot# add<br>
chroot# exit<br>
host# cd ..<br>
host# cp mnt/boot/vmlin* . && cp mnt/boot/init* . # copy kernel and init<br>
image to outside chroot<br>
host# umount mnt<br>
host# exit<br>
host$ kvm -m 512M -vga std -soundhw ac97,sb16 -smp<br>
{n},sockets=1,threads=1,cores={n} -kernel vmlinux-... -initrd initrd-...<br>
-append "vga=ask root=/dev/sda" hda=image -daemonize<br>
<br>
(Also look at <a href="https://wiki.ubuntu.com/Core/InstallationExample" target="_blank">https://wiki.ubuntu.com/Core/InstallationExample</a>)<br>
<br>
Or you can skip the whole image creation process, just extract<br>
ubuntu-core as root into empty directory and do similar process, then<br>
you can tar archive it later to send to a target computer (using a Live USB)<br>
<br>
The only thing of note I have, is that today I had a phantom bug that if<br>
I change my /etc/apt/sources.list file (in chroot) to point to somewhere<br>
else it fails (Does the ubuntu-core know the ip address of<br>
<a href="http://archive.ubuntu.com" target="_blank">archive.ubuntu.com</a>? as there is no nslookup package installed in core to<br>
lookup alt mirrors)<br>
<br>
From,<br>
Kieran Grant<br>
<div class="HOEnZb"><div class="h5"><br>
--<br>
Ubuntu-devel-discuss mailing list<br>
<a href="mailto:Ubuntu-devel-discuss@lists.ubuntu.com">Ubuntu-devel-discuss@lists.ubuntu.com</a><br>
Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel-discuss" target="_blank">https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel-discuss</a><br>
</div></div></blockquote></div><br><br>