# Can I do a clean install with *new* portage packages?

## metalhead4344

Hi,

Ok, I just installed gentoo on my system at home. But I have a slight problem, I live in a really small town and there is absolutely no way to get broadband. However I have access to a T3 at work (lol). Well, I'm not satisfied with the install I got from the package cd (sound bugs in older kde, kdm login problems.. .etc). I ran Suse 10 with kDE3.5.3 before this, and know that most if not all of these bugs have been fixed now... however my internet is so slow I can't update anything... because everything I need to update + dependencies will take months of downloading (24/7).

So, is there a way to do a clean install... with a new kernel, portage snapshot, and installing new packages downloaded from a portage mirror on cd?

If its not possible I could always take my comp to a friend's house with broadband for updating... but this would save hassle.

Heh, hopefully my dial-up woes will be solved when I go to college next year, lol.

----------

## NeddySeagoon

NeddySeagoons' Rough Guide to Maintaining Gentoo via "Sneakernet"

Users intending to maintain Gentoo with no internet access start here. 

To make life easer for yourself, do not use the defualt locations of /usr/portage/distfiles and /usr/portage/packages - redefine the locations in /etc/make.conf and do any moving of contens thats required.

Now its quite safe to delete /usr/portage when you update the portage tree with a new snapshot. Your downloaded source files and any binary packages you may have made will be preserved.

Get an new, up to date portage snapshot, delete your /usr/portage and untar your new snapshot to /usr, just as the install guide tells you. You now have an updated portage tree in place.

Users needing a few odds and ends to get networking or Wifi operating start here 

Now you can do --pretend emerges against your new portage tree.

```
emerge <target> -fp
```

will provide you with a list of URLs you need to fetch to be able to run the emerge for real. Here, <target> can include any other flags to emerge, like -u,  -D, -N that affect what is built. See man emerge.

Fetch all the required URLs and copy them to wherever you redefined /usr/portage/distfiles to be.

Now you have everything in place to run 

```
emerge <target>
```

for real.

[1] "Sneakernet" was the name given to sharing files via floppy disk, before Ethernet was common on PCs.

----------

## metalhead4344

Thanks for the guide. Will definately prove useful. So, it is possible... just need some help with my plan.

My first major question is... I have 2 cdrom drives (dvd-rom, and a dvd-burner) and I will put the universal live cd in the dvd-rom drive (hdc)... I'm not gonna bother setting it up as a dvd-rom just for the purposes of installation. When I run the gentoo installation, instead of unpacking the portage snapshot included on the live cd, how can I mount my 2nd cdrom drive to unpack the portage snapshot on it... would it be something like this (note I have 2 internal hard drives as well):

```
mount /dev/hdd /mnt/cdrom2
```

or is it going to be 

```
mount /dev/cdroms/cdrom1 /mnt/cdrom2
```

1. To get a newer kernel I should grab a stage3 tarbell from an internet mirror ,download it and burn it onto a cd for later use... correct? Then untar it as the handbook describes...

2.To have an undated portage snapshot I should download it ahead of time and burn that onto the cd I'm making as well. Then when the time comes to unpack the normal portage snapshot I should just untar that one instead of the one on the universal install cd, right?

3.Since I'll be emerging my new packages later normally and not using GRP with the usepkg option (because I want to configure my use flags) I'll edit my make.conf during installation to include the use flags I want.

4. Then when the installation guide says to update the portage tree I'll just run:

```
emerge --sync
```

 and it will use my snapshot I copied from my other cd... right?

5.  I should put all the things I'm installing (and their dependancies) on the cd... in the correct folders (ex. syslog-ng needs to be app-admin/syslog-ng)... I'm just not sure about how I'm going to make portage use the cd as an installation source.

6. Then I'd like to have a kde-meta install (I can always remove stuff I don't want later). I need to download all the packages that would normally be installed from the package cd... have those on the cd as well and once I have a working gentoo install emerge kde-meta and it should use the cd I burned as its install source. I just need a full listing of what is installed in emerge kde-meta

All in all I guess I need to know how to mount my 2nd cdrom drive when i"m booted from the live cd, how to make portage use that cd as an installation source, and a listing of packages and dependencies emerged with emerge kde-meta. And please if I've forgotten anything let me know.

Thanks anyone who's taking the time to read this, your response is definately appreciated... if I had broadband I wouldn't worry about this. I just want to make sure that all the stuff I install is up to date at the beginning becuase a system wide update would take forever with my connection

----------

## NeddySeagoon

metalhead4344,

 *metalhead4344 wrote:*   

> My first major question is... I have 2 cdrom drives (dvd-rom, and a dvd-burner) and I will put the universal live cd in the dvd-rom drive (hdc)... I'm not gonna bother setting it up as a dvd-rom just for the purposes of installation. When I run the gentoo installation, instead of unpacking the portage snapshot included on the live cd, how can I mount my 2nd cdrom drive to unpack the portage snapshot on it... would it be something like this (note I have 2 internal hard drives as well):
> 
> ```
> mount /dev/hdd /mnt/cdrom2
> ```
> ...

 

Make a mountpoint for the second cdrom. You may want to make it at 

```
/mnt/gentoo/mnt/cdrom
```

if the stage 3 does not make it for you. Anything  you mount there will be accessable inside the chroot. 

 *metalhead4344 wrote:*   

> 1. To get a newer kernel I should grab a stage3 tarbell from an internet mirror ,download it and burn it onto a cd for later use... correct? Then untar it as the handbook describes...
> 
> 

 I think the stage 3 tarball on the net will be the same as the one on the liveCD

 *metalhead4344 wrote:*   

> 2.To have an undated portage snapshot I should download it ahead of time and burn that onto the cd I'm making as well. Then when the time comes to unpack the normal portage snapshot I should just untar that one instead of the one on the universal install cd, right?
> 
> 

 Thats right.

 *metalhead4344 wrote:*   

> 3.Since I'll be emerging my new packages later normally and not using GRP with the usepkg option (because I want to configure my use flags) I'll edit my make.conf during installation to include the use flags I want.

 It would be eaiser for you if you 

```
emerge ufed
```

Thats the USE FLag Editor.

 *metalhead4344 wrote:*   

> 4. Then when the installation guide says to update the portage tree I'll just run:
> 
> ```
> emerge --sync
> ```
> ...

 You skip this step. emerge --sync updates the portage tree from the internet. You have the latest snapshot, which is as good as you can do.

 *metalhead4344 wrote:*   

> 5.  I should put all the things I'm installing (and their dependancies) on the cd... in the correct folders (ex. syslog-ng needs to be app-admin/syslog-ng)... I'm just not sure about how I'm going to make portage use the cd as an installation source.

  You misunderstand how portage works. The portage tree (ebuilds) has the structure you descibe, you get that for free in the snapshot. The sources to be used by the ebuilds all go in the same directory. By defualt, its /usr/portage/distfiles. You configure where it is by setting some options in /etc/make.conf.  See  /etc/make.conf.example. You can use the sources directly from the CD. It will be fine the first time round but will make updates more difficult because they often build on the source you already have. For example, the basic vanillia kernel is about 40Mb to download. Then there are some small patch files.  When the kernel goes from -r2 to -r3, you may need another patch. However, emerge will ask you for the whole lot, since it can't see whats on the CD that you used last time. Make a directory on the hard drive for distfiles outside of /usr/portage.

 *metalhead4344 wrote:*   

> 6. Then I'd like to have a kde-meta install (I can always remove stuff I don't want later). I need to download all the packages that would normally be installed from the package cd... have those on the cd as well and once I have a working gentoo install emerge kde-meta and it should use the cd I burned as its install source. I just need a full listing of what is installed in emerge kde-meta

 Don't expect to do it all in one go, or to get it all on one CD.

 *metalhead4344 wrote:*   

> All in all I guess I need to know how to mount my 2nd cdrom drive when i"m booted from the live cd, how to make portage use that cd as an installation source, and a listing of packages and dependencies emerged with emerge kde-meta. And please if I've forgotten anything let me know.

 You need to untar the stage 3, install the portage snapshot, then you can run 

```
emerge <target> -fp 
```

to get your lisy of URLs. Its only at that time can the sources you need be determined.

----------

## metalhead4344

Thanks for the help, it is much appreciated  :Smile: 

----------

## Dralnu

This may do well in the Docs section, if any admins/mods are watching.

----------

## metalhead4344

ok, I've got a working gentoo system with my updated portage snapshot installed, and whatnot. So all I'm waiting for now is a chance to download the nessicery files.

----------

## NeddySeagoon

Moved from Portage & Programming to Documentation, Tips & Tricks after a suggestion by Dralnu

----------

## Dralnu

 *NeddySeagoon wrote:*   

> Moved from Portage & Programming to Documentation, Tips & Tricks after a suggestion by Dralnu

 

thank you

----------

## Joseph K.

Anyone that untars a new portage snapshot also wants to follow it up immediately with 

```
emerge --metadata
```

to update the portage cache.

----------

## Wonderwill

YYYYYYYYEEEEEEEEEEEAAAAAAAAAAHHHHHHHHHHH THIS SOLVED AN ISSUE THAT HAS LASTED WEEKS!!!!!!! THANKS SOOO MUCH!!!!   :Laughing:   :Laughing:   :Wink: 

----------

## DrSlony

Do not emerge --metadata, I did that and it broke my portage somehow. I restarted again without emerge --metadata and it worked.

----------

## eccerr0r

With renewed interest in this, just a word of warning:

When you emerge --fetchonly --pretend (-fp above), there are two issues:

1.  Currently there appears to be a strange bug where if you use --fetchonly, the dependency tree is not fully computed, and you may miss packages needed to download.  This is witnessed by if your --pretend with --fetchonly now produces slot conflicts and other violations where it was clean without --fetchonly.  I don't know if there was a bug filed on this, but it's annoying, and has been like this for years now.

2.  The URLs presented are the actual URLs that contains the files.  However if you need to fetch from somewhere other than distfiles.gentoo.org and the ebuild renames the file, you will need to manually rename the file as well in order to match the filename the ebuild expects when actually building.  You can tell if the SRC_URI contains a -> operator, if there is an -> operator, a rename is necessary that the URLs in --fetchonly --pretend does not appear to display.  Unfortunately there isn't an easy way to rename the files with the results from --fetchonly --pretend, perhaps a feature enhancement to fetchonly pretend is to dump out a list of wget (and mv) commands that renames the files properly after fetching.

There are a lot of packages that do renames, mostly when upstream does not put their package name in the filename.  If you can get away with downloading solely from distfiles.gentoo.org, you should be fine, but some license agreements prohibit distfiles.gentoo.org from distributing the files.

----------

