Re: can't use apt-get command with ubuntu core

2012-12-05 Thread Kieran Grant
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@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel-discuss


Re: can't use apt-get command with ubuntu core

2012-12-05 Thread Saqlain Abbas
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.gpgTemporary
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.gr...@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)

 

Re: can't use apt-get command with ubuntu core

2012-12-05 Thread Kieran Grant
Ok, first of all, I've added ubuntu-devel-discuss@lists.ubuntu.com to my
CC list as I thought how I responded to the email would have worked (I
don't see it in my local mailing list copy, I tried Ctrl+Shift+L to
'reply to list' in thunderbird, now I am 'replying to all')

It looks like you got the phantom bug I got, so this is my best guess is
to resolve archive.ubuntu.com and temporarily add it to the chroot
environments etc/hosts file... This is because the Ubuntu Core doesn't
have nslookup and cannot resolve the IP address. (I guess if you have
already resolved it, it somehow uses your system's cache or something,
either way, it is an odd bug)

host# nslookup archive.ubuntu.com
Copy or write down the IP address you get
host# vim (or other text editor as root) mnt/etc/hosts
Add the line:
ip-address-from-above archive.ubuntu.com
You can alternatively do this:
host# echo ip-address archive.ubuntu.com  mnt/etc/hosts
host# chroot mnt
host# apt-get update

I suspect that both the 'sudo' package, 'net-tools' and 'dnsutils' are
meant to be part of Ubuntu Core.

From,
Kieran Grant

On 05/12/12 20:51, Saqlain Abbas wrote:

 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
 http://archive.ubuntu.com'
 Err http://archive.ubuntu.com precise-updates Release.gpg
   Temporary failure resolving 'archive.ubuntu.com
 http://archive.ubuntu.com'
 Err http://archive.ubuntu.com precise Release.gpg
   Temporary failure resolving 'archive.ubuntu.com
 http://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
 http://archive.ubuntu.com'

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

 W: Failed to fetch
 http://archive.ubuntu.com/ubuntu/dists/precise-security/Release.gpg
  Temporary failure resolving 'archive.ubuntu.com
 http://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.gr...@gmail.com
 mailto:kieran.thehacker.gr...@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 

Re: can't use apt-get command with ubuntu core

2012-12-05 Thread Kieran Grant
On 05/12/12 21:21, Kieran Grant wrote:
 Ok, first of all, I've added ubuntu-devel-discuss@lists.ubuntu.com to
 my CC list as I thought how I responded to the email would have worked
 (I don't see it in my local mailing list copy, I tried Ctrl+Shift+L to
 'reply to list' in thunderbird, now I am 'replying to all')
Lol, I figured out why it wasn't showing, now that I think about it, it
makes sense for me to not be sent the email I sent... (First time
replying to a mailing list). I just have to put a rule in that if I
reply to an email in one of my  dedicated mailing list folders, to not
send it to the Sent Folder... (And make sure I reply from the email
address I am subscribed too, yikes, I think I need to go away from the
computer, my brain is starting to go a bit silly)

-- 
Ubuntu-devel-discuss mailing list
Ubuntu-devel-discuss@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel-discuss


Re: can't use apt-get command with ubuntu core

2012-12-05 Thread Saqlain Abbas
lol, but Thanks Kieran, now apt-get update working for me also :)

On Wed, Dec 5, 2012 at 4:34 PM, Kieran Grant 
kieran.thehacker.gr...@gmail.com wrote:

 On 05/12/12 21:21, Kieran Grant wrote:
  Ok, first of all, I've added ubuntu-devel-discuss@lists.ubuntu.com to
  my CC list as I thought how I responded to the email would have worked
  (I don't see it in my local mailing list copy, I tried Ctrl+Shift+L to
  'reply to list' in thunderbird, now I am 'replying to all')
 Lol, I figured out why it wasn't showing, now that I think about it, it
 makes sense for me to not be sent the email I sent... (First time
 replying to a mailing list). I just have to put a rule in that if I
 reply to an email in one of my  dedicated mailing list folders, to not
 send it to the Sent Folder... (And make sure I reply from the email
 address I am subscribed too, yikes, I think I need to go away from the
 computer, my brain is starting to go a bit silly)

 --
 Ubuntu-devel-discuss mailing list
 Ubuntu-devel-discuss@lists.ubuntu.com
 Modify settings or unsubscribe at:
 https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel-discuss




-- 
Kind Regards,
Saqlain Abbas.
-- 
Ubuntu-devel-discuss mailing list
Ubuntu-devel-discuss@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel-discuss


can't use apt-get command with ubuntu core

2012-12-04 Thread Saqlain Abbas
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 i try apt-get update command i get below errors

apt-get update

E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission
denied)
E: Unable to lock directory /var/lib/apt/lists/
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission
denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you
root?

I tried to remove lock file manually but i again get permission denied
error, the 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?

-- 
Kind Regards,
Saqlain Abbas.
-- 
Ubuntu-devel-discuss mailing list
Ubuntu-devel-discuss@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel-discuss


Re: can't use apt-get command with ubuntu core

2012-12-04 Thread Emmet Hikory
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.

-- 
Emmet HIKORY

-- 
Ubuntu-devel-discuss mailing list
Ubuntu-devel-discuss@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel-discuss


Re: can't use apt-get command with ubuntu core

2012-12-04 Thread Saqlain Abbas
 If you wish to run apt-get, you will either need to grant a root
password, 'and use su'..

In Ubuntu Core root user is already added but i don't know root user
password (and it dont ask me to reset root user password adduser command
just say user already present), may be i missed something very basic?

I would like to use it to install packages (i.e. sudo and other necessary,
resolving dependencies manually is tedious :( ) su asks for root password
but i dont know it.. For the same purpose i added ubuntu user to sudo
group (but you already clarified without sudo pakcages it would not have
any effect).

The reason i am interesting these packages from Ubuntu Core is because it
seems something really obvious to have root access in an OS,  but su asks
for password which i dont know...

Thanks,
Saqlain.

On Tue, Dec 4, 2012 at 7:14 PM, Emmet Hikory per...@ubuntu.com 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.

 --
 Emmet HIKORY

 --
 Ubuntu-devel-discuss mailing list
 Ubuntu-devel-discuss@lists.ubuntu.com
 Modify settings or unsubscribe at:
 https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel-discuss




-- 
Kind Regards,
Saqlain Abbas.
-- 
Ubuntu-devel-discuss mailing list
Ubuntu-devel-discuss@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel-discuss


Re: can't use apt-get command with ubuntu core

2012-12-04 Thread David Henningsson

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?


--
David Henningsson, Canonical Ltd.
https://launchpad.net/~diwic

--
Ubuntu-devel-discuss mailing list
Ubuntu-devel-discuss@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel-discuss