can't use apt-get command with ubuntu core

Saqlain Abbas saqlain.abbas.7 at gmail.com
Wed Dec 5 10:51:41 UTC 2012


Well from the instruction of https://wiki.ubuntu.com/Core 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?

Secondly now I tried to install pakcages in Ubuntu Core, i idid something
like below

host# chroot /mnt/root
chroot# dpkg -i /tmp/*.deb
chroot# apt-get update

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?

Err http://archive.ubuntu.com precise InRelease

Err http://archive.ubuntu.com precise-updates InRelease

Err http://archive.ubuntu.com precise-security InRelease

Err http://archive.ubuntu.com precise Release.gpg
  Temporary failure resolving 'archive.ubuntu.com'
Err http://archive.ubuntu.com precise-updates Release.gpg
  Temporary failure resolving 'archive.ubuntu.com'
Err http://archive.ubuntu.com precise Release.gpg
  Temporary failure resolving 'archive.ubuntu.com'

Reading package lists... Done
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/precise/InRelease
W: Failed to fetch
http://archive.ubuntu.com/ubuntu/dists/precise-updates/InRelease
W: Failed to fetch
http://archive.ubuntu.com/ubuntu/dists/precise-security/InRelease

W: Failed to fetch
http://archive.ubuntu.com/ubuntu/dists/precise/Release.gpg    Temporary
failure resolving 'archive.ubuntu.com'

W: Failed to fetch
http://archive.ubuntu.com/ubuntu/dists/precise-updates/Release.gpg
Temporary failure resolving '
archive.ubuntu.com'

W: Failed to fetch
http://archive.ubuntu.com/ubuntu/dists/precise-security/Release.gpg
Temporary failure resolving '
archive.ubuntu.com'

W: Some index files failed to download. They have been ignored, or old ones
used  instead.

On Wed, Dec 5, 2012 at 1:00 PM, Kieran Grant <
kieran.thehacker.grant at gmail.com> wrote:

> On 05/12/12 17:01, David Henningsson wrote:
> > On 12/04/2012 03:14 PM, Emmet Hikory wrote:
> >> Saqlain Abbas wrote:
> >>> I have installed Ubuntu core on VM i followed instruction from
> >>>
> >>> https://wiki.ubuntu.com/Core
> >>>
> >>> I am able to boot and login, but if try apt-get install I get below
> >>> errors,
> >>> my system (virgin ubuntu core) got no packages installed like synaptic
> >>> package manager etc
> >>>
> >>> "could not open lock file /var/lib/dpkg/lock -open (13:permission
> >>> denied)
> >>> unable to lock the administration directory (/var/lib/dpkg) , are
> >>> you root?"
> >>>
> >>> I can't try using "sudo" command as it is not installed on (ubuntu
> >>> core).
> >>
> >>      If you wish to run apt-get, you will either need to grant a root
> >> password,
> >> and use su, or mount the filesystem on some other machine, chroot
> >> into it, and
> >> install sudo from the chroot.
> >>
> >>> [T]he user i created "ubuntu" I added it to adm and sudo groups,
> >>> "groups" command shows it is added to "ubuntu" "adm" and "sudo"
> >>> groups. My
> >>> other part of question is as user is added to sudo group why i got no
> >>> "root" permission?
> >>
> >>      Because the sudo package is not installed, so there is no
> >> interpretation
> >> of the sudo group meaning anything.  While the adm group does grant
> >> the ability
> >> to access many files, it does not provide for any sort of root access.
> >>
> >
> > The instructions at https://wiki.ubuntu.com/Core clearly says to add
> > the local user to the sudo group. This makes no sense if the sudo
> > package is not part of Ubuntu Core, so either the instructions are
> > broken, or Ubuntu Core is broken because it should have included the
> > sudo package?
> >
> The answers provided are correct, but you need to add sudo package
> manually.
>
> Download ubuntu-core, as directed, and if you want to use it in an
> image, say for example a VM (this is pretty much what I do):
> Pre-download or pre-build Linux Kernel Debs (Download is easier)
> host$ dd if=/dev/zero bs=1 seek=size-in-bytes count=1 of=./image
> host$  su
> host# mkdir mnt
> host# mkfs.ext{2,3,4} -f ./image
> host# mount ./image mnt
> host# cd mnt
> host# tar -xvnf ../ubuntu-core-{version}-core-{arch}.tar.gz
> host# cd ..
> host# cp /path/to/kernel/debs mnt/var/cache/apt/archives
> host# chroot mnt
> chroot# dpkg -i /var/cache/apt/archives/*.deb
> chroot# apt-get update && apt-get upgrade
> chroot# apt-get install net-tools sudo vim{/other editor of choice}
> {aptitude/other package manager if you want} {and anything else you feel
> you need}
> chroot# apt-get clean
> chroot# adduser username
> chroot# addgroup username adm
> chroot# addgroup username sudo
> chroot# add
> chroot# exit
> host# cd ..
> host# cp mnt/boot/vmlin* . && cp mnt/boot/init* . # copy kernel and init
> image to outside chroot
> host# umount mnt
> host# exit
> host$ kvm -m 512M -vga std -soundhw ac97,sb16 -smp
> {n},sockets=1,threads=1,cores={n} -kernel vmlinux-... -initrd initrd-...
> -append "vga=ask root=/dev/sda" hda=image -daemonize
>
> (Also look at https://wiki.ubuntu.com/Core/InstallationExample)
>
> Or you can skip the whole image creation process, just extract
> ubuntu-core as root into empty directory and do similar process, then
> you can tar archive it later to send to a target computer (using a Live
> USB)
>
> The only thing of note I have, is that today I had a phantom bug that if
> I change my /etc/apt/sources.list file (in chroot) to point to somewhere
> else it fails (Does the ubuntu-core know the ip address of
> archive.ubuntu.com? as there is no nslookup package installed in core to
> lookup alt mirrors)
>
> From,
> Kieran Grant
>
> --
> Ubuntu-devel-discuss mailing list
> Ubuntu-devel-discuss at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-devel-discuss/attachments/20121205/f412b6b7/attachment.html>


More information about the Ubuntu-devel-discuss mailing list